Search code examples
ruby-on-railsrubycapistranobundleransible

Capistrano Deploy error in the form of bundle stdout: Nothing written bundle stderr: Nothing written


So I've recently set up an Azure VM and have been trying to get our application to deploy to Azure. I wrangled with a bunch of errors, but I'm really getting stuck here after i run cap production deploy:check --trace

We used Ansible to set the server up, and nginx is working fine on the server. Now we're just trying to get the darn thing to deploy to the machine, but we're getting a strange issue where it fails to execute as the deploy user, for whatever reason and says that nothing is written.

Any help would be greatly appreciated.

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 18
bundle stdout: Nothing written
bundle stderr: Nothing written
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/command.rb:97:in `exit_status='
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:153:in `block (5 levels) in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:551:in `call'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:562:in `channel_request'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:466:in `dispatch_incoming_packets'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:222:in `preprocess'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:206:in `process'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `block in loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:175:in `block (3 levels) in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:514:in `call'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:546:in `channel_open_confirmation'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:466:in `dispatch_incoming_packets'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:222:in `preprocess'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:206:in `process'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `block in loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:177:in `block (2 levels) in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:191:in `with_ssh'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:136:in `block in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:35:in `block (5 levels) in <top (required)>'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/abstract.rb:85:in `with'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:26:in `block (4 levels) in <top (required)>'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/abstract.rb:77:in `within'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:25:in `block (3 levels) in <top (required)>'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
SSHKit::Command::Failed: bundle exit status: 18
bundle stdout: Nothing written
bundle stderr: Nothing written
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/command.rb:97:in `exit_status='
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:153:in `block (5 levels) in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:551:in `call'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:562:in `channel_request'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:466:in `dispatch_incoming_packets'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:222:in `preprocess'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:206:in `process'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `block in loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:175:in `block (3 levels) in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:514:in `call'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:546:in `channel_open_confirmation'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:466:in `dispatch_incoming_packets'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:222:in `preprocess'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:206:in `process'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `block in loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:177:in `block (2 levels) in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:191:in `with_ssh'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:136:in `block in _execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:35:in `block (5 levels) in <top (required)>'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/abstract.rb:85:in `with'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:26:in `block (4 levels) in <top (required)>'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/abstract.rb:77:in `within'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:25:in `block (3 levels) in <top (required)>'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/macbook/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/sshkit-1.6.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => deploy:updated => bundler:install
The deploy has failed with an error: Exception while executing as [email protected]: bundle exit status: 18
bundle stdout: Nothing written
bundle stderr: Nothing written
** Invoke deploy:failed (first_time)
** Execute deploy:failed

Solution

  • According to the source exit status 18 means a Ruby version mismatch. Generally, this indicates that you have a ruby line in your Gemfile that requires a version that is different from what you're using to execute Bundler (2.2.0 in this case).

    It's surprising that it says that nothing was written to stdout or stderr, as Bundler normally does print an error in this case. There may be another problem causing the error output to be suppressed.