Error when setting up Golang backend and PostgreSQL with Kamal

I’m trying to set up a Golang backend with a PostgreSQL database using Kamal 2. But I’m hitting a snag.

When I run the kamal setup command, I get this error:

ERROR (KeyError): Exception while executing as ubuntu@localhost: key not found: #<SSHKit::Host:0x000059c7eb101ed8 @keys=[], @local=false, @use...

The container starts, but I can’t access it through the Kamal proxy. I’ve double-checked my deploy.yml file and it looks okay to me. I’ve got the SSH key stored on the host machine too.

I tried adding the key with ssh-add, but no luck. Any ideas what might be causing this? I’m pretty stumped.

Has anyone run into a similar issue when deploying with Kamal? What am I missing here?

I encountered a similar issue when deploying with Kamal. The error you’re seeing typically points to SSH key problems. Have you verified that the SSH key specified in your deploy.yml exists and has the correct permissions? Also, ensure the key is properly added to your SSH agent. Try running ‘ssh-add -l’ to list loaded keys. If it’s not there, add it manually with ‘ssh-add /path/to/your/key’. Another potential fix is to explicitly specify the SSH key in your deploy.yml file using the ‘ssh_options’ parameter. This bypasses reliance on the SSH agent. Lastly, check if your target server’s authorized_keys file includes the public key you’re trying to use for deployment.

yo, that error’s annoying af. have u tried clearing ur ssh agent and re-adding the key? sometimes it gets wonky. also, check if ur deploy.yml has the right ssh_user and host. maybe try deploying to a diff server if u got one? just to see if its a server issue. good luck man, kamal can be a pain sometimes!

hmm, that’s a tricky one! have u tried checking ur SSH config file? sometimes theres weird permission issues there. also, maybe try running kamal with verbose logging? could give more clues. oh, and double-check ur deploy.yml for any typos in the SSH settings? just spitballing here. what version of kamal r u using btw?