I am trying to launch one of my projects on Github onto a Digital Ocean droplet. I am using the rails-server-template repo from the book "Deploying Rails Applications". I cloned the skeleton repo as mentioned in the book. I then followed both of the Quickstart chapters 4 and 16 (provisioning with Chef/Berkshelf, and deploying with Capistrano) and edited the template according to the instructions.
The provisioning script ran just fine, although it seemed to hang on the first try. It had no problems going through to completion on the second try. And after checking the Droplet IP address, the NGINX server message appeared as expected, so things seemed to be working fine there.
So, after setting up capistrano scripts and pointing them to my repo, I then tried running the Capistrano 'deploy:setup_config' command and it blows up right after (or maybe during) the Unicorn setup procedures. See the error message below (it is only the part just before and after the error message appears.
I would love any hints on things I could try or if it's clear from the error message what the problem might be? I ran the 'deploy:setup_config' with a few extra debug and trace options, but I still have no idea what caused capistrano to abort. I spent a few hours searching and reading around similar messages from Google searches, but nothing I tried worked. To my noob deploying brain, it appears to be an SSH issue. So I even made sure that I had ssh agent forwarding set up and it now appears that I do (I didn't initially), yet the error continues to halt the operation even after this was fixed.
== ERROR MESSAGE BELOW:
DEBUG [b9208e5b] Command: ( RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.2 /usr/bin/env chmod +x /home/deploy/apps/shared/config/unicorn_init.sh ) D, [2015-03-19T03:04:56.581563 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: queueing packet nr 77 type 90 len 44 D, [2015-03-19T03:04:56.581839 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: sent 120 bytes D, [2015-03-19T03:04:56.600361 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: read 52 bytes D, [2015-03-19T03:04:56.600635 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: received packet nr 91 type 91 len 28 I, [2015-03-19T03:04:56.600775 #10311] INFO -- net.ssh.connection.session[3fcae950b3bc]: channel_open_confirmation: 10 0 0 32768 I, [2015-03-19T03:04:56.601065 #10311] INFO -- net.ssh.connection.channel[3fcae98a9d84]: sending channel request "env" D, [2015-03-19T03:04:56.601241 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: queueing packet nr 78 type 98 len 44 I, [2015-03-19T03:04:56.601552 #10311] INFO -- net.ssh.connection.channel[3fcae98a9d84]: sending channel request "exec" D, [2015-03-19T03:04:56.601712 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: queueing packet nr 79 type 98 len 156 D, [2015-03-19T03:04:56.601891 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: sent 248 bytes D, [2015-03-19T03:04:56.619705 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: read 88 bytes D, [2015-03-19T03:04:56.620077 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: received packet nr 92 type 93 len 28 I, [2015-03-19T03:04:56.620336 #10311] INFO -- net.ssh.connection.session[3fcae950b3bc]: channel_window_adjust: 10 +2097152 D, [2015-03-19T03:04:56.620778 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: received packet nr 93 type 99 len 12 I, [2015-03-19T03:04:56.621003 #10311] INFO -- net.ssh.connection.session[3fcae950b3bc]: channel_success: 10 D, [2015-03-19T03:04:56.623588 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: read 140 bytes D, [2015-03-19T03:04:56.624133 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: received packet nr 94 type 98 len 44 I, [2015-03-19T03:04:56.624377 #10311] INFO -- net.ssh.connection.session[3fcae950b3bc]: channel_request: 10 exit-status false D, [2015-03-19T03:04:56.624593 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: received packet nr 95 type 96 len 12 I, [2015-03-19T03:04:56.624688 #10311] INFO -- net.ssh.connection.session[3fcae950b3bc]: channel_eof: 10 D, [2015-03-19T03:04:56.624819 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: received packet nr 96 type 97 len 12 I, [2015-03-19T03:04:56.624890 #10311] INFO -- net.ssh.connection.session[3fcae950b3bc]: channel_close: 10 D, [2015-03-19T03:04:56.625106 #10311] DEBUG -- tcpsocket[3fcae8adb5e0]: queueing packet nr 80 type 97 len 28 INFO [b9208e5b] Finished in 0.044 seconds with exit status 0 (successful). cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as deploy@104.131.156.16: no implicit conversion of nil into String /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in rescue in block (2 levels) in execute' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:inblock (2 levels) in execute' TypeError: no implicit conversion of nil into String /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-cookbook-0.2.1/lib/capistrano/cookbook/helpers/substitute_strings.rb:9:in gsub!' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-cookbook-0.2.1/lib/capistrano/cookbook/helpers/substitute_strings.rb:9:inblock in sub_strings' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-cookbook-0.2.1/lib/capistrano/cookbook/helpers/substitute_strings.rb:8:in each' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-cookbook-0.2.1/lib/capistrano/cookbook/helpers/substitute_strings.rb:8:insub_strings' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-cookbook-0.2.1/lib/capistrano/cookbook/tasks/setup_config.cap:29:in block (4 levels) in ' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-cookbook-0.2.1/lib/capistrano/cookbook/tasks/setup_config.cap:28:ineach' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/capistrano-cookbook-0.2.1/lib/capistrano/cookbook/tasks/setup_config.cap:28:in block (3 levels) in ' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:ininstance_exec' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in run' /Users/jose8a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:inblock (2 levels) in execute' Tasks: TOP => deploy:setup_config
deploy.rb:
lock '3.4.0'
set :log_level, :debug
set :application, 'yojobs'
set :deploy_user, 'deploy'
set :ssh_options, { :forward_agent => true}
set :ssh_options, { verbose: :debug }
#setup repo details
set :scm, :git
set :repo_url, 'git@http://ift.tt/1DEFXx2'
# setup rvm
set :rbenv_type, :system
set :rbenv_ruby, '2.1.2'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
# how many old releases do we want to keep, not much
set :keep_releases, 5
# files we want symlinking to specific entries in shared
set :linked_files, %w{config/database.yml config/secrets.yml}
# dirs we want symlinking to shared
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# this:
# http://ift.tt/1H81mwm
# is worth reading for a quick overview of what tasks are called
# and when for `cap stage deploy`
namespace :deploy do
end
production.rb (note: I'm masking the actual IP address here):
set :stage, :production
set :branch, "master"
# This is used in the Nginx VirtualHost to specify which domains
# the app should appear on. If you don't yet have DNS setup, you'll
# need to create entries in your local Hosts file for testing.
set :server_name, 'MY.IP.ADDR.ESS'
# used in case we're deploying multiple versions of the same app
# side by side. Also provides quick sanity checks when looking at
# filepaths
set :full_path_name, "#{fetch(:application)}_#{fetch(:stage)}"
server 'MY.IP.ADDR.ESS', user: 'deploy', roles: %w{web app db}, primary: true
set :deploy_to, "/home/#{fetch(:deploy_user)}/apps/#{fetch(:full_app_name)}"
# don't try to infer something as important as environment from stage name
set :rails_env, :production
# number of unicorn workers, this will be reflected in
# the unicorn.rb and the monit configs
set :unicorn_worker_count, 5
# wether we're using ssl or not, used for building nginx
# config file
set :enable_ssl, false
Aucun commentaire:
Enregistrer un commentaire