Baremetal deployment connection failure due to port

Hello,

I’m following the guide at https://redwoodjs.com/docs/deploy/baremetal and have updated the deploy.toml file to include a port = 12345 to prevent default port 22 being used. However, when I run yarn rw deploy baremetal production --first-run there is a connection failure and the reported issue is: connect ECONNREFUSED 127.0.0.1:22. This would suggest it is ignoring my port specification?

NOTE: I have altered the IP address shown here to the standard localhost value instead of my real production server IP.

Any help with this issue would be appreciated.

Thanks

Hey Josh,

I do not think the port option changes the ssh port. Rather, I believe it sets the port that either the web side or api side serves from. @rob will be able to tell you for sure.

If you are indeed wanting to try to ssh into your machine using a different port, try setting host = "127.0.0.1:12345" in the deploy.toml. That might do it.

Hi Josh, as @PantheRedEye said, that port has nothing to do with deploy, that setting is the port for the web or api side to be available at (depends on whether you set it under the [web] or [api] section).

I haven’t tried ssh-ing on a port other than 22, but you can try setting it in the host option in deploy.toml:

host: myserver.com:12345

But it’s possible that setting the port is a separate config value that isn’t currently passed through to the underlying node-ssh library. If adding it to the host doesn’t work for you, let me know and I’ll open a PR that adds it. If we get it done quick enough it’ll be available in the next 3.1 release!

Hi all,

Excellent thanks for clarifying this port option is nothing to do with the SSH into the remote. It may be best to update the generated documentation in the generated deploy.toml file as I found it slightly confusing given it does state the port option is SSH related.

I did try originally adding the port to the hostname but unfortunately I got a different connection error where it could not retrieve address info. I can’t recall the exact error message but it included getaddrinfo in the error.

I can update this thread later when I’m home with the exact error message if needed and I can also quote the generated deploy.toml documentation too if needed.

Thanks a lot again for the help.

I checked the node-ssh docs and it does list port as a separate option that we don’t currently forward from the config file:

I created an issue here: [Feature]: Add `port` config option from node-ssh to Baremetal config · Issue #6426 · redwoodjs/redwood · GitHub If you think that’s something you’d like to work on, you’re more than welcome to create a PR! I’m at a company retreat thing the next few days, but I should be able to get to it tonight if don’t get a chance. Either way, thanks for letting us know about the problem!

Okay I might give it a bash tonight myself if I can quickly familiarise myself with the codebase.

Thanks again for this clarification and overall for a very nice project for the community.