SSHKit::Runner::ExecuteError: Exception while executing on host: bundle exit status: 4

3,231 views
Skip to first unread message

Vell

unread,
Aug 15, 2014, 11:21:53 AM8/15/14
to capis...@googlegroups.com
Versions:
  • Ruby: ruby-2.0.0-p451
  • CapistranoL 3.2.1
  • Rake 10.3.2 / Rails 4.1.4
Platform:
  • Working on.... Mac OS X 10.9.4
  • Deploying to... CentOS release 6.5 (Final)
Logs:
  • Capfile
  • deploy.rb
  • Stage files (production.rb, staging.rb)
I am having issues getting capistrano to fully deploy my application. I have my own internal git repository where I am pulling my custom engines and my application and it seems that something going on with sshkit is causing things to blow up.

I am not sure what exactly to test with ssh kit to get further information on what my issue is. Is there a way I can narrow down what might be going on?

The specific gem file that is giving me issues I have tried using the https address and the ssh address. The log that is on pastebin is for using ssh. But even when using https I get the following error:

Fatal: HTTP request failed
error
: The requested URL returned error: 401 Unauthorized while accessing https://giterver.domain.com/engines/aspphauthenticatable.git/info/refs


fatal
: HTTP request failed
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/command.rb:97:in `exit_status='
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:148:in `
block (5 levels) in _execute'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `call'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:561:in `
channel_request'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `
process'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `
loop'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:170:in `block (3 levels) in _execute'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `
call'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `
dispatch_incoming_packets'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `
block in loop'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:172:in `
block (2 levels) in _execute'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `
tap'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/capistrano-bundler-1.1.2/lib/capistrano/tasks/bundler.cap:30:in `
block (5 levels) in <top (required)>'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:85:in `with'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/capistrano-bundler-1.1.2/lib/capistrano/tasks/bundler.cap:22:in `block (4 levels) in <top (required)>'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:77:in `
within'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/capistrano-bundler-1.1.2/lib/capistrano/tasks/bundler.cap:21:in `block (3 levels) in <top (required)>'

/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `
run'
/Users/lovell/.rvm/gems/ruby-2.0.0-p451/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host myserver.domain.com: bundle exit status: 11
bundle stdout
: Nothing written

Does anyone have any ideas of things I could do to address these problems?


Rafa García

unread,
Aug 18, 2014, 3:59:08 AM8/18/14
to capis...@googlegroups.com
Hi,

  I'm not wrong remote server (which is being deployed) try to download source code and doesn't have access to repository.
Could you connect to remote server and try to execute git clone with https url to check if it works?

Regards


--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/64d157ce-7515-4a50-81ca-688a8a81363c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vell

unread,
Aug 18, 2014, 8:37:16 AM8/18/14
to capis...@googlegroups.com
Yes. That's the baffling thing. I did a guy clone even in the directory I was attempting to deploy too and I didn't have any problems. 

Sent from my iPhone

Rafa García

unread,
Aug 20, 2014, 12:14:06 PM8/20/14
to capis...@googlegroups.com
Reviewing the log, your problem seems to be happening in the gem install step (bundler:install task).

I hope it helps a little, regards


Vell

unread,
Aug 25, 2014, 9:21:17 AM8/25/14
to capis...@googlegroups.com


On Wednesday, August 20, 2014 12:14:06 PM UTC-4, Rafa García wrote:
Reviewing the log, your problem seems to be happening in the gem install step (bundler:install task).

I hope it helps a little, regards

Sorry for the late response. I have been away and unable to get to email. Here is is more debugging that I found.

After a failed deployment, I went to the directory where the application was deployed to and ran bundle install. I was presented with the following notification:

You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

You have added to the Gemfile:
* source: g...@gitserver.domain.com:engines/auth_engin.git (at master)

You have deleted from the Gemfile:

You have changed in the Gemfile:
* aspph_authenticatable from `g...@gitserver.domain.com:engines/auth_engin.git (at master)` to `no specified source`


 So I ran
bundle install --no-deployment

And this confirms that the issue was with getting the gem dependencies from the engine that I created and was trying to install with the application.

The server I am deploying to is not a production server. The RAILS_ENV is set to 'dev_server' which I am not sure capistrano knows how to deal with since it is not a 'development', 'staging', or 'production' server. As a test, I changed my config/deploy/dev_server.rb to config/deploy/development.rb and I get the same error.

So my question now how do get this to deploy on my development server without me needing to manually run 'bundle install --no-deployment' and what does this mean when I try to deploy to production?

My current deploy.rb file can be found here: http://pastebin.com/uGNtv4LE

Vell

unread,
Aug 25, 2014, 1:07:13 PM8/25/14
to capis...@googlegroups.com


On Monday, August 25, 2014 9:21:17 AM UTC-4, Vell wrote:


On Wednesday, August 20, 2014 12:14:06 PM UTC-4, Rafa García wrote:
Reviewing the log, your problem seems to be happening in the gem install step (bundler:install task).

I hope it helps a little, regards

Sorry for the late response. I have been away and unable to get to email. Here is is more debugging that I found.

After a failed deployment, I went to the directory where the application was deployed to and ran bundle install. I was presented with the following notification:

You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

You have added to the Gemfile:
* source: g...@gitserver.domain.com:engines/auth_engin.git (at master)

You have deleted from the Gemfile:

You have changed in the Gemfile:
* aspph_authenticatable from `g...@gitserver.domain.com:engines/auth_engin.git (at master)` to `no specified source`


 So I ran
bundle install --no-deployment

And this confirms that the issue was with getting the gem dependencies from the engine that I created and was trying to install with the application.

The server I am deploying to is not a production server. The RAILS_ENV is set to 'dev_server' which I am not sure capistrano knows how to deal with since it is not a 'development', 'staging', or 'production' server. As a test, I changed my config/deploy/dev_server.rb to config/deploy/development.rb and I get the same error.

So my question now how do get this to deploy on my development server without me needing to manually run 'bundle install --no-deployment' and what does this mean when I try to deploy to production?

My current deploy.rb file can be found here: http://pastebin.com/uGNtv4LE

Does it make sense that I can add 
 
 set :bundle_flags, "--no-deployment"

To my config/deploy/development.rb file and exclude it for my config/deploy/production.rb file and things would work as I expect them to?
Reply all
Reply to author
Forward
0 new messages