Save 36% for Black Friday! Learn more

Jamie

Joined

3,020 Experience
30 Lessons Completed
0 Questions Solved

Activity

Posted in Deploy Ubuntu 22.04 Jammy Jellyfish Discussion

Okay, I have managed to deploy now. Someone on stack overflow suggested installing gems ed25519 and bcrypt_pbkdf (only now do I notice Loris on May 30, 2022 did this here :rollseyes:). I did this, but was still getting an exception. The thread is here:

https://stackoverflow.com/questions/75900868/rails-7-deployment-fails-using-capistrano-with-sshkitrunnerexecuteerror/75924541#75924541

It appears I needed to edit ~/.ssh/config to include:

Host *
IdentityFile /home/user/.ssh/id_ed255190

The other issues I ran into were needing (in config/deploy.rb) to set:

ask :branch,git rev-parse --abbrev-ref HEAD.chomp

Otherwise Capistrano fails with this error:

DEBUG [47bb050c] fatal: not a valid object name: master
DEBUG [47bb050c] tar:
DEBUG [47bb050c] This does not look like a tar archive
DEBUG [47bb050c] tar:
DEBUG [47bb050c] Exiting with failure status due to previous errors

Finally, I encountered this error:

2023/04/06 16:36:46 [alert] 138879#138879: *1 Error opening '/home/deploy/flix/Passengerfile.json' for reading: Permission denied (errno=13); This error means that the Nginx worker process (PID 138879, running as UID 33) does not have permission to access this file. Please read this page to learn how to fix this problem: https://www.phusionpassenger.com/library/admin/nginx/troubleshooting/?a=upon-accessing-the-web-app-nginx-reports-a-permission-denied-error; Extra info, client: xxx.xx.xxx.xxx, server: _, request: "GET / HTTP/1.1", host: "xx.xx.xxx.xx"

This was fixed by sudo chmod o+x $HOME -- thanks to Gustavo Garcia (here on 17 Jan 2022) for documenting that!

At long, long last I have my first Rails website deployed via the help in these pages and pure voodoo with Capistrano - which I still do not understand! I hope these comments help others who encounter similar issues.

Posted in Deploy Ubuntu 22.04 Jammy Jellyfish Discussion

Thanks for the guide, which almost works, with:

Ubuntu 22.04.2 LTS Jammy (client and server)
Ruby 3.2.0 / Rails 7.0.4.2
capistrano (3.17.2)
capistrano-bundler (2.1.0)
capistrano-passenger (0.2.1)
capistrano-rails (1.6.2)
capistrano-rbenv (2.2.0)
net-ssh (7.1.0)
openssl (default: 3.1.0)

When running cap production deploy (withHostKey /etc/ssh/ssh_host_ed25519_key in the ssh server config file - I am using ed25519 keys) I get this error:

verify_host_key: :secure is deprecated, use :always
Thread:0x00007f169f27a710 /home/user/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sshkit-1.21.4/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
/home/user/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sshkit-1.21.4/lib/sshkit/runners/parallel.rb:15:in rescue in block (2 levels) in execute': Exception while executing as deploy@xx.xx.xx.xx: could not settle on host_key algorithm (SSHKit::Runner::ExecuteError)
Server host_key preferences: ssh-ed25519
Client host_key preferences: ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512
from /home/user/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sshkit-1.21.4/lib/sshkit/runners/parallel.rb:11:in
block (2 levels) in execute'
/home/user/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/net-ssh-7.1.0/lib/net/ssh/transport/algorithms.rb:410:in `negotiate': could not settle on host_key algorithm (Net::SSH::Exception)
Server host_key preferences: ssh-ed25519
Client host_key preferences: ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512
...
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@xx.xx.xx.xx: could not settle on host_key algorithm
Server host_key preferences: ssh-ed25519
Client host_key preferences: ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512

And when no HostKey is set on the server I get this error:

verify_host_key: :secure is deprecated, use :always
Thread:0x00007f0d3c68a6c8 /home/user/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sshkit-1.21.4/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
/home/user/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sshkit-1.21.4/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as deploy@xx.xx.xx.xx: fingerprint SHA256:6EF6B30F9E557F948C402C89002C7C8A is unknown for "xx.xx.xx.xx" (SSHKit::Runner::ExecuteError)
...
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@xx.xx.xx.xx: fingerprint SHA256:6EF6B30F9E557F948C402C89002C7C8A is unknown for "xx.xx.xx.xx"

Caused by:
Net::SSH::HostKeyUnknown: fingerprint SHA256:6EF6B30F9E557F948C402C89002C7C8A is unknown for "xx.xx.xx.xx"

Tasks: TOP => rbenv:validate
(See full trace by running task with --trace)


I can do a password-less ssh into the server, no problem, so PubKey authentication appears to work just fine.

Please! If anyone else has had, and overcome this problem, I would really appreciate your help - I've been trying to fix this for days now!

Thanks in advance.