I am using the latest version of Capistrano w/ my Rails 4 application. When running cap dpeloy. I get a lot of output including this failure:
DEBUG [04b6e226] Running /usr/bin/env [ -f /var/www/skateboxes/releases/20131022135522/config/database.yml ] on 162.243.33.179
DEBUG [04b6e226] Command: [ -f /var/www/skateboxes/releases/20131022135522/config/database.yml ]
DEBUG [04b6e226] Finished in 0.280 seconds with exit status 1 (failed).
How do I figure out what is going on here?
Update #1
I should say that I have gitignored config/database.yml (as was suggested by the capistrano docs). I then added the following to my config/deploy.rb
set :linked_files, %w{config/database.yml}
I then created a file on my VPS at /var/www/skateboxes/shared/config/database.yml.
Am I not understanding how linked_files works?
Update #2
It turns out that the file is actually being linked from shared/conf/database.yml to current/config/database.yml so now I'm confused as to why it's saying failed
Update #3
Here is the entire output of my deploy
DEBUG Uploading /tmp/git-ssh.sh 0.0%
INFO Uploading /tmp/git-ssh.sh 100.0%
INFO [37fffef8] Running /usr/bin/env chmod +x /tmp/git-ssh.sh on 162.243.33.179
DEBUG [37fffef8] Command: ( RAILS_ENV=production /usr/bin/env chmod +x /tmp/git-ssh.sh )
INFO [37fffef8] Finished in 0.282 seconds with exit status 0 (successful).
DEBUG [d8542e52] Running /usr/bin/env git ls-remote git#github.com:kyledecot/skateboxes.git on 162.243.33.179
DEBUG [d8542e52] Command: ( RAILS_ENV=production GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/git-ssh.sh /usr/bin/env git ls-remote git#github.com:kyledecot/skateboxes.git )
DEBUG [d8542e52] Finished in 1.448 seconds with exit status 0 (successful).
DEBUG [d8542e52] e0f96188b9567a84048a0e1238f219abc6351607 HEAD
DEBUG [d8542e52] e0f96188b9567a84048a0e1238f219abc6351607 refs/heads/master
DEBUG [d8542e52] Finished in 1.448 seconds with exit status 0 (successful).
INFO [5a13328b] Running /usr/bin/env mkdir -pv /var/www/skateboxes/shared /var/www/skateboxes/releases on 162.243.33.179
DEBUG [5a13328b] Command: ( RAILS_ENV=production /usr/bin/env mkdir -pv /var/www/skateboxes/shared /var/www/skateboxes/releases )
INFO [5a13328b] Finished in 0.719 seconds with exit status 0 (successful).
INFO [293e065b] Running /usr/bin/env mkdir -pv /var/www/skateboxes/shared/config on 162.243.33.179
DEBUG [293e065b] Command: ( RAILS_ENV=production /usr/bin/env mkdir -pv /var/www/skateboxes/shared/config )
INFO [293e065b] Finished in 0.780 seconds with exit status 0 (successful).
DEBUG [4eb81576] Running /usr/bin/env [ -f /var/www/skateboxes/shared/config/database.yml ] on 162.243.33.179
DEBUG [4eb81576] Command: [ -f /var/www/skateboxes/shared/config/database.yml ]
DEBUG [4eb81576] Finished in 0.744 seconds with exit status 0 (successful).
DEBUG [89a9e1fa] Running /usr/bin/env [ -f /var/www/skateboxes/repo/HEAD ] on 162.243.33.179
DEBUG [89a9e1fa] Command: [ -f /var/www/skateboxes/repo/HEAD ]
DEBUG [89a9e1fa] Finished in 0.734 seconds with exit status 0 (successful).
INFO The repository mirror is at /var/www/skateboxes/repo
DEBUG [3cc4d694] Running /usr/bin/env if test ! -d /var/www/skateboxes/repo; then echo "Directory does not exist '/var/www/skateboxes/repo'" 1>&2; false; fi on 162.243.33.179
DEBUG [3cc4d694] Command: if test ! -d /var/www/skateboxes/repo; then echo "Directory does not exist '/var/www/skateboxes/repo'" 1>&2; false; fi
DEBUG [3cc4d694] Finished in 0.735 seconds with exit status 0 (successful).
INFO [1cb24a84] Running /usr/bin/env git remote update on 162.243.33.179
DEBUG [1cb24a84] Command: cd /var/www/skateboxes/repo && ( RAILS_ENV=production /usr/bin/env git remote update )
DEBUG [1cb24a84] Fetching origin
DEBUG [1cb24a84] remote: Counting objects: 5, done.
remote: Compressing objects: 100% (1/1), done.
DEBUG [1cb24a84] remote: Total 3 (delta 2), reused 3 (delta 2)
DEBUG [1cb24a84] Unpacking objects: 33% (1/3)
DEBUG [1cb24a84] Unpacking objects: 66% (2/3)
Unpacking objects: 100% (3/3), done.jects: 100% (3/3)
DEBUG [1cb24a84] From github.com:kyledecot/skateboxes
DEBUG [1cb24a84] de7f4a1..e0f9618 master -> master
INFO [1cb24a84] Finished in 0.817 seconds with exit status 0 (successful).
DEBUG [edd6c793] Running /usr/bin/env if test ! -d /var/www/skateboxes/repo; then echo "Directory does not exist '/var/www/skateboxes/repo'" 1>&2; false; fi on 162.243.33.179
DEBUG [edd6c793] Command: if test ! -d /var/www/skateboxes/repo; then echo "Directory does not exist '/var/www/skateboxes/repo'" 1>&2; false; fi
DEBUG [edd6c793] Finished in 0.732 seconds with exit status 0 (successful).
INFO [009b81fe] Running /usr/bin/env mkdir -p /var/www/skateboxes/releases/20131022145520 on 162.243.33.179
DEBUG [009b81fe] Command: cd /var/www/skateboxes/repo && ( RAILS_ENV=production GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/git-ssh.sh /usr/bin/env mkdir -p /var/www/skateboxes/releases/20131022145520 )
INFO [009b81fe] Finished in 0.317 seconds with exit status 0 (successful).
INFO [e9554374] Running /usr/bin/env git archive master | tar -x -C /var/www/skateboxes/releases/20131022145520 on 162.243.33.179
DEBUG [e9554374] Command: cd /var/www/skateboxes/repo && ( RAILS_ENV=production GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/git-ssh.sh /usr/bin/env git archive master | tar -x -C /var/www/skateboxes/releases/20131022145520 )
INFO [e9554374] Finished in 0.356 seconds with exit status 0 (successful).
INFO [165a7c40] Running /usr/bin/env mkdir -pv /var/www/skateboxes/releases/20131022145520/config on 162.243.33.179
DEBUG [165a7c40] Command: ( RAILS_ENV=production /usr/bin/env mkdir -pv /var/www/skateboxes/releases/20131022145520/config )
INFO [165a7c40] Finished in 1.174 seconds with exit status 0 (successful).
DEBUG [c2f7de66] Running /usr/bin/env [ -L /var/www/skateboxes/releases/20131022145520/config/database.yml ] on 162.243.33.179
DEBUG [c2f7de66] Command: [ -L /var/www/skateboxes/releases/20131022145520/config/database.yml ]
DEBUG [c2f7de66] Finished in 0.572 seconds with exit status 1 (failed).
DEBUG [09de2f2c] Running /usr/bin/env [ -f /var/www/skateboxes/releases/20131022145520/config/database.yml ] on 162.243.33.179
DEBUG [09de2f2c] Command: [ -f /var/www/skateboxes/releases/20131022145520/config/database.yml ]
DEBUG [09de2f2c] Finished in 0.304 seconds with exit status 1 (failed).
INFO [05570e6e] Running /usr/bin/env ln -s /var/www/skateboxes/shared/config/database.yml /var/www/skateboxes/releases/20131022145520/config/database.yml on 162.243.33.179
DEBUG [05570e6e] Command: ( RAILS_ENV=production /usr/bin/env ln -s /var/www/skateboxes/shared/config/database.yml /var/www/skateboxes/releases/20131022145520/config/database.yml )
INFO [05570e6e] Finished in 0.541 seconds with exit status 0 (successful).
INFO [8499b753] Running /usr/bin/env rm -rf /var/www/skateboxes/current on 162.243.33.179
DEBUG [8499b753] Command: ( RAILS_ENV=production /usr/bin/env rm -rf /var/www/skateboxes/current )
INFO [8499b753] Finished in 0.762 seconds with exit status 0 (successful).
INFO [bddc6793] Running /usr/bin/env ln -s /var/www/skateboxes/releases/20131022145520 /var/www/skateboxes/current on 162.243.33.179
DEBUG [bddc6793] Command: ( RAILS_ENV=production /usr/bin/env ln -s /var/www/skateboxes/releases/20131022145520 /var/www/skateboxes/current )
INFO [bddc6793] Finished in 0.289 seconds with exit status 0 (successful).
DEBUG [38a6b176] Running /usr/bin/env ls -x /var/www/skateboxes/releases on 162.243.33.179
DEBUG [38a6b176] Command: ( RAILS_ENV=production /usr/bin/env ls -x /var/www/skateboxes/releases )
DEBUG [38a6b176] Finished in 0.741 seconds with exit status 0 (successful).
DEBUG [38a6b176] 20131022133912 20131022133939 20131022134435 20131022135522 20131022145350
DEBUG [38a6b176] 20131022145520
DEBUG [38a6b176] Finished in 0.741 seconds with exit status 0 (successful).
INFO Keeping 5 of 6 deployed releases on 162.243.33.179
INFO [7da6047f] Running /usr/bin/env rm -rf /var/www/skateboxes/releases/20131022133912 on 162.243.33.179
DEBUG [7da6047f] Command: ( RAILS_ENV=production /usr/bin/env rm -rf /var/www/skateboxes/releases/20131022133912 )
INFO [7da6047f] Finished in 0.530 seconds with exit status 0 (successful).
DEBUG [7cdd5da9] Running /usr/bin/env if test ! -d /var/www/skateboxes/releases; then echo "Directory does not exist '/var/www/skateboxes/releases'" 1>&2; false; fi on 162.243.33.179
DEBUG [7cdd5da9] Command: if test ! -d /var/www/skateboxes/releases; then echo "Directory does not exist '/var/www/skateboxes/releases'" 1>&2; false; fi
DEBUG [7cdd5da9] Finished in 0.727 seconds with exit status 0 (successful).
INFO [906548e8] Running /usr/bin/env echo "Branch master deployed as release 20131022145520 by kyledecot; " >> /var/www/skateboxes/revisions.log on 162.243.33.179
DEBUG [906548e8] Command: echo "Branch master deployed as release 20131022145520 by kyledecot; " >> /var/www/skateboxes/revisions.log
INFO [906548e8] Finished in 0.279 seconds with exit status 0 (successful).
That's not a failure, see https://github.com/leehambley/sshkit/pull/33.
It says failed because that is not a file, thus the test command ([ aka man (1) test) has exited with status 1.
The command in question is coming out of this code, reproduced below:
desc 'Symlink linked files'
task :linked_files do
next unless any? :linked_files
on roles :app do
execute :mkdir, '-pv', linked_file_dirs(release_path)
fetch(:linked_files).each do |file|
target = release_path.join(file)
source = shared_path.join(file)
unless test "[ -L #{target} ]"
if test "[ -f #{target} ]"
execute :rm, target
end
execute :ln, '-s', source, target
end
end
end
end
desc 'Check files to be linked exist in shared'
task :linked_files do
next unless any? :linked_files
on roles :app do |host|
linked_files(shared_path).each do |file|
unless test "[ -f #{file} ]"
error t(:linked_file_does_not_exist, file: file, host: host)
exit 1
end
end
end
end
The task name says it all, really, if your file is listed in the :linked_files variable, it must exist in shared_path, otherwise it will cause Capistrano to abort when the file does not exist.
You haven't yet said whether or not this is causing your deploy to fail, and since you've posted so little of the log, indicating nothing but normal behaviour, nobody can guess.
You appear to be posting logs from the Symlink linked files task, which is supposed to fail on config/database.yml if it doesn't exist, it has failed to find it, so it does not have to be deleted.
Related
I was following this tutorial to deploy app to linode server. Previously i had deployed successfully to the linode server. This time i am getting stack level too deep error.
https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma
The Ubuntu version in the production linode server is 17.04.
When i do cap production deploy:initial after finishing all the deploy steps, i get the following error
INFO START 2017-11-25 03:29:56 +0000 cap production deploy:initial
INFO ---------------------------------------------------------------------------
DEBUG [598edc13] Command: [ -d ~/.rvm ]
DEBUG [598edc13] Finished in 8.488 seconds with exit status 0 (successful).
DEBUG [36c71e7b] Running ~/.rvm/bin/rvm version on karaokesagar.com
DEBUG [36c71e7b] Command: ~/.rvm/bin/rvm version
DEBUG [36c71e7b] rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
DEBUG [36c71e7b]
DEBUG [36c71e7b] Finished in 0.721 seconds with exit status 0 (successful).
DEBUG [617d85cf] Running ~/.rvm/bin/rvm current on karaokesagar.com
DEBUG [617d85cf] Command: ~/.rvm/bin/rvm current
DEBUG [617d85cf] ruby-2.4.2
DEBUG [617d85cf]
DEBUG [617d85cf] Finished in 0.740 seconds with exit status 0 (successful).
DEBUG [9ab88745] Running ~/.rvm/bin/rvm default do ruby --version on karaokesagar.com
DEBUG [9ab88745] Command: ~/.rvm/bin/rvm default do ruby --version
DEBUG [9ab88745] ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
DEBUG [9ab88745]
DEBUG [9ab88745] Finished in 0.988 seconds with exit status 0 (successful).
INFO [cfb7cd43] Running /usr/bin/env mkdir -p /tmp on karaokesagar.com
DEBUG [cfb7cd43] Command: /usr/bin/env mkdir -p /tmp
INFO [cfb7cd43] Finished in 0.473 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/git-ssh-karaoke-production-ubuntu.sh 0.0%
INFO Uploading /tmp/git-ssh-karaoke-production-ubuntu.sh 100.0%
INFO [c33a7c23] Running /usr/bin/env chmod 700 /tmp/git-ssh-karaoke-production-ubuntu.sh on karaokesagar.com
DEBUG [c33a7c23] Command: /usr/bin/env chmod 700 /tmp/git-ssh-karaoke-production-ubuntu.sh
INFO [c33a7c23] Finished in 0.452 seconds with exit status 0 (successful).
INFO [3033792c] Running /usr/bin/env git ls-remote git#bitbucket.org:kofhearts/karaokesansar.git HEAD on karaokesagar.com
DEBUG [3033792c] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-karaoke-production-ubuntu.sh" ; /usr/bin/env git ls-remote git#bitbucket.org:kofhearts/karaokesansar.git HEAD )
DEBUG [3033792c] d79f75cee9853e0c2b2c488118a4c68048a40422
DEBUG [3033792c] HEAD
INFO [3033792c] Finished in 1.427 seconds with exit status 0 (successful).
INFO [8ef83012] Running /usr/bin/env mkdir -p /home/deploy/apps/karaoke/shared /home/deploy/apps/karaoke/releases on karaokesagar.com
DEBUG [8ef83012] Command: /usr/bin/env mkdir -p /home/deploy/apps/karaoke/shared /home/deploy/apps/karaoke/releases
INFO [8ef83012] Finished in 0.409 seconds with exit status 0 (successful).
INFO [c0d1a7ac] Running /usr/bin/env mkdir -p /home/deploy/apps/karaoke/shared/public/assets on karaokesagar.com
DEBUG [c0d1a7ac] Command: /usr/bin/env mkdir -p /home/deploy/apps/karaoke/shared/public/assets
INFO [c0d1a7ac] Finished in 0.454 seconds with exit status 0 (successful).
DEBUG [445830bb] Running [ -f /home/deploy/apps/karaoke/shared/puma.rb ] on karaokesagar.com
DEBUG [445830bb] Command: [ -f /home/deploy/apps/karaoke/shared/puma.rb ]
DEBUG [445830bb] Finished in 0.453 seconds with exit status 0 (successful).
DEBUG [cbca27f5] Running [ -f /home/deploy/apps/karaoke/current/REVISION ] on karaokesagar.com
DEBUG [cbca27f5] Command: [ -f /home/deploy/apps/karaoke/current/REVISION ]
DEBUG [cbca27f5] Finished in 0.445 seconds with exit status 1 (failed).
DEBUG [30b29881] Running [ -f /home/deploy/apps/karaoke/repo/HEAD ] on karaokesagar.com
DEBUG [30b29881] Command: [ -f /home/deploy/apps/karaoke/repo/HEAD ]
DEBUG [30b29881] Finished in 0.444 seconds with exit status 0 (successful).
INFO The repository mirror is at /home/deploy/apps/karaoke/repo
DEBUG [c9d9e8a5] Running if test ! -d /home/deploy/apps/karaoke/repo; then echo "Directory does not exist '/home/deploy/apps/karaoke/repo'" 1>&2; false; fi on karaokesagar.com
DEBUG [c9d9e8a5] Command: if test ! -d /home/deploy/apps/karaoke/repo; then echo "Directory does not exist '/home/deploy/apps/karaoke/repo'" 1>&2; false; fi
DEBUG [c9d9e8a5] Finished in 0.447 seconds with exit status 0 (successful).
INFO [560e0445] Running /usr/bin/env git remote set-url origin git#bitbucket.org:kofhearts/karaokesansar.git on karaokesagar.com
DEBUG [560e0445] Command: cd /home/deploy/apps/karaoke/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-karaoke-production-ubuntu.sh" ; /usr/bin/env git remote set-url origin git#bitbucket.org:kofhearts/karaokesansar.git )
INFO [560e0445] Finished in 0.455 seconds with exit status 0 (successful).
INFO [cd7fd82e] Running /usr/bin/env git remote update --prune on karaokesagar.com
DEBUG [cd7fd82e] Command: cd /home/deploy/apps/karaoke/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-karaoke-production-ubuntu.sh" ; /usr/bin/env git remote update --prune )
DEBUG [cd7fd82e] Fetching origin
DEBUG [cd7fd82e]
INFO [cd7fd82e] Finished in 1.505 seconds with exit status 0 (successful).
DEBUG [aeba79fe] Running if test ! -d /home/deploy/apps/karaoke/repo; then echo "Directory does not exist '/home/deploy/apps/karaoke/repo'" 1>&2; false; fi on karaokesagar.com
DEBUG [aeba79fe] Command: if test ! -d /home/deploy/apps/karaoke/repo; then echo "Directory does not exist '/home/deploy/apps/karaoke/repo'" 1>&2; false; fi
DEBUG [aeba79fe] Finished in 0.411 seconds with exit status 0 (successful).
INFO [f2eaad41] Running /usr/bin/env mkdir -p /home/deploy/apps/karaoke/releases/20171125033012 on karaokesagar.com
DEBUG [f2eaad41] Command: cd /home/deploy/apps/karaoke/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-karaoke-production-ubuntu.sh" ; /usr/bin/env mkdir -p /home/deploy/apps/karaoke/releases/20171125033012 )
INFO [f2eaad41] Finished in 0.451 seconds with exit status 0 (successful).
INFO [5e835bed] Running /usr/bin/env git archive master | /usr/bin/env tar -x -f - -C /home/deploy/apps/karaoke/releases/20171125033012 on karaokesagar.com
DEBUG [5e835bed] Command: cd /home/deploy/apps/karaoke/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-karaoke-production-ubuntu.sh" ; /usr/bin/env git archive master | /usr/bin/env tar -x -f - -C /home/deploy/apps/karaoke/releases/20171125033012 )
INFO [5e835bed] Finished in 0.569 seconds with exit status 0 (successful).
DEBUG [ce808311] Running if test ! -d /home/deploy/apps/karaoke/repo; then echo "Directory does not exist '/home/deploy/apps/karaoke/repo'" 1>&2; false; fi on karaokesagar.com
DEBUG [ce808311] Command: if test ! -d /home/deploy/apps/karaoke/repo; then echo "Directory does not exist '/home/deploy/apps/karaoke/repo'" 1>&2; false; fi
DEBUG [ce808311] Finished in 0.449 seconds with exit status 0 (successful).
DEBUG [26122d06] Running /usr/bin/env git rev-list --max-count=1 master on karaokesagar.com
DEBUG [26122d06] Command: cd /home/deploy/apps/karaoke/repo && ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-karaoke-production-ubuntu.sh" ; /usr/bin/env git rev-list --max-count=1 master )
DEBUG [26122d06] d79f75cee9853e0c2b2c488118a4c68048a40422
DEBUG [26122d06]
DEBUG [26122d06] Finished in 0.449 seconds with exit status 0 (successful).
DEBUG [1e5a5e74] Running if test ! -d /home/deploy/apps/karaoke/releases/20171125033012; then echo "Directory does not exist '/home/deploy/apps/karaoke/releases/20171125033012'" 1>&2; false; fi on karaokesagar.com
DEBUG [1e5a5e74] Command: if test ! -d /home/deploy/apps/karaoke/releases/20171125033012; then echo "Directory does not exist '/home/deploy/apps/karaoke/releases/20171125033012'" 1>&2; false; fi
DEBUG [1e5a5e74] Finished in 0.453 seconds with exit status 0 (successful).
INFO [6f3e3303] Running /usr/bin/env echo "d79f75cee9853e0c2b2c488118a4c68048a40422" >> REVISION on karaokesagar.com
DEBUG [6f3e3303] Command: cd /home/deploy/apps/karaoke/releases/20171125033012 && /usr/bin/env echo "d79f75cee9853e0c2b2c488118a4c68048a40422" >> REVISION
INFO [6f3e3303] Finished in 0.451 seconds with exit status 0 (successful).
INFO [7410c8d3] Running /usr/bin/env mkdir -p /home/deploy/apps/karaoke/releases/20171125033012/public on karaokesagar.com
DEBUG [7410c8d3] Command: /usr/bin/env mkdir -p /home/deploy/apps/karaoke/releases/20171125033012/public
INFO [7410c8d3] Finished in 0.449 seconds with exit status 0 (successful).
DEBUG [81416c34] Running [ -L /home/deploy/apps/karaoke/releases/20171125033012/public/assets ] on karaokesagar.com
DEBUG [81416c34] Command: [ -L /home/deploy/apps/karaoke/releases/20171125033012/public/assets ]
DEBUG [81416c34] Finished in 0.456 seconds with exit status 1 (failed).
DEBUG [a5177be9] Running [ -d /home/deploy/apps/karaoke/releases/20171125033012/public/assets ] on karaokesagar.com
DEBUG [a5177be9] Command: [ -d /home/deploy/apps/karaoke/releases/20171125033012/public/assets ]
DEBUG [a5177be9] Finished in 0.449 seconds with exit status 1 (failed).
INFO [c644ee05] Running /usr/bin/env ln -s /home/deploy/apps/karaoke/shared/public/assets /home/deploy/apps/karaoke/releases/20171125033012/public/assets on karaokesagar.com
DEBUG [c644ee05] Command: /usr/bin/env ln -s /home/deploy/apps/karaoke/shared/public/assets /home/deploy/apps/karaoke/releases/20171125033012/public/assets
INFO [c644ee05] Finished in 0.447 seconds with exit status 0 (successful).
DEBUG [91e265b4] Running if test ! -d /home/deploy/apps/karaoke/releases/20171125033012; then echo "Directory does not exist '/home/deploy/apps/karaoke/releases/20171125033012'" 1>&2; false; fi on karaokesagar.com
DEBUG [91e265b4] Command: if test ! -d /home/deploy/apps/karaoke/releases/20171125033012; then echo "Directory does not exist '/home/deploy/apps/karaoke/releases/20171125033012'" 1>&2; false; fi
DEBUG [91e265b4] Finished in 0.447 seconds with exit status 0 (successful).
DEBUG [b0e66b40] Running ~/.rvm/bin/rvm default do bundle check --path /home/deploy/apps/karaoke/shared/bundle on karaokesagar.com
DEBUG [b0e66b40] Command: cd /home/deploy/apps/karaoke/releases/20171125033012 && ~/.rvm/bin/rvm default do bundle check --path /home/deploy/apps/karaoke/shared/bundle
DEBUG [b0e66b40] [31mThe following gems are missing[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * net-ssh (4.2.0)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * net-scp (1.2.1)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * sshkit (1.15.1)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * airbrussh (1.3.0)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * debug_inspector (0.0.3)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * binding_of_caller (0.7.2)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * byebug (9.1.0)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * capistrano (3.10.0)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * capistrano-bundler (1.3.0)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * capistrano-rails (1.3.1)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * capistrano-rvm (0.1.2)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * capistrano3-puma (3.1.1)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * spring (2.0.2)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * sqlite3 (1.3.13)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [31m * web-console (2.3.0)[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] [33mInstall missing gems with `bundle install`[0m
DEBUG [b0e66b40]
DEBUG [b0e66b40] Finished in 1.448 seconds with exit status 1 (failed).
INFO [63b1c824] Running ~/.rvm/bin/rvm default do bundle install --path /home/deploy/apps/karaoke/shared/bundle --without development test --deployment --quiet on karaokesagar.com
DEBUG [63b1c824] Command: cd /home/deploy/apps/karaoke/releases/20171125033012 && ~/.rvm/bin/rvm default do bundle install --path /home/deploy/apps/karaoke/shared/bundle --without development test --deployment --quiet
INFO [63b1c824] Finished in 1.675 seconds with exit status 0 (successful).
DEBUG [5cf60307] Running if test ! -d /home/deploy/apps/karaoke/releases/20171125033012; then echo "Directory does not exist '/home/deploy/apps/karaoke/releases/20171125033012'" 1>&2; false; fi on karaokesagar.com
DEBUG [5cf60307] Command: if test ! -d /home/deploy/apps/karaoke/releases/20171125033012; then echo "Directory does not exist '/home/deploy/apps/karaoke/releases/20171125033012'" 1>&2; false; fi
DEBUG [5cf60307] Finished in 0.450 seconds with exit status 0 (successful).
INFO [ca0f0299] Running ~/.rvm/bin/rvm default do bundle exec rake assets:precompile on karaokesagar.com
DEBUG [ca0f0299] Command: cd /home/deploy/apps/karaoke/releases/20171125033012 && ( export RAILS_ENV="production" RAILS_GROUPS="" ; ~/.rvm/bin/rvm default do bundle exec rake assets:precompile )
DEBUG [ca0f0299] /home/deploy/apps/karaoke/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
DEBUG [ca0f0299]
DEBUG [ca0f0299] /home/deploy/apps/karaoke/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
DEBUG [ca0f0299]
DEBUG [ca0f0299] rake aborted!
DEBUG [ca0f0299]
DEBUG [ca0f0299] SystemStackError: stack level too deep
DEBUG [ca0f0299]
DEBUG [ca0f0299] /home/deploy/apps/karaoke/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
DEBUG [ca0f0299]
DEBUG [ca0f0299] /home/deploy/apps/karaoke/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
DEBUG [ca0f0299]
DEBUG [ca0f0299] /home/deploy/apps/karaoke/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
DEBUG [ca0f0299]
DEBUG [ca0f0299] /home/deploy/apps/karaoke/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
DEBUG [ca0f0299]
DEBUG [ca0f0299] /home/deploy/apps/karaoke/shared/bundle/ruby/2.4.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
DEBUG [ca0f0299]
DEBUG [ca0f0299] /home/deploy
I appreciate any help to this dilemma i am facing. Thanks!
UPDATE:
I also tried to increase the stack size by
ulimit -s 32384
but that also didnt help.
ok bundle update did the job. It turns out the default app was using a lot of old gems so after updating and pushing it to the repo and then deploying it to the remote vps it worked.
My deploy goes good until the sidekiq:start:
00:18 sidekiq:start
01 sidekiq --index 0 --pidfile /home/user/cap/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /home/user/cap/shared/log/sidekiq.log --concurrency 4 --daemon
01 /usr/bin/env: sidekiq: No such file or directory
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as user#app.domain.com: sidekiq exit status: 127
sidekiq stdout: Nothing written
sidekiq stderr: /usr/bin/env: sidekiq: No such file or directory
SSHKit::Command::Failed: sidekiq exit status: 127
sidekiq stdout: Nothing written
sidekiq stderr: /usr/bin/env: sidekiq: No such file or directory
Tasks: TOP => sidekiq:start
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as user#app.domain.com: sidekiq exit status: 127
sidekiq stdout: Nothing written
sidekiq stderr: /usr/bin/env: sidekiq: No such file or directory
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [c0e43b64] Command: if test ! -d /home/user/cap/releases/20160629062112; then echo "Directory does not exist '/home/user/cap/releases/20160629062112'" 1>&2; false; fi
DEBUG [c0e43b64] Finished in 0.079 seconds with exit status 0 (successful).
DEBUG [2c3323b9] Running /usr/bin/env [ -f /home/user/cap/shared/tmp/pids/sidekiq-0.pid ] as user#app.domain.com
DEBUG [2c3323b9] Command: cd /home/user/cap/releases/20160629062112 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.0" ; /usr/bin/env [ -f /home/user/cap/shared/tmp/pids/sidekiq-0.pid ] )
DEBUG [2c3323b9] Finished in 0.083 seconds with exit status 1 (failed).
INFO [6813e38f] Running /usr/bin/env ln -s /home/user/cap/releases/20160629062112 /home/user/cap/releases/current as user#app.domain.com
DEBUG [6813e38f] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.0" ; /usr/bin/env ln -s /home/user/cap/releases/20160629062112 /home/user/cap/releases/current )
INFO [6813e38f] Finished in 0.080 seconds with exit status 0 (successful).
INFO [6d1d7708] Running /usr/bin/env mv /home/user/cap/releases/current /home/user/cap as user#app.domain.com
DEBUG [6d1d7708] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.0" ; /usr/bin/env mv /home/user/cap/releases/current /home/user/cap )
INFO [6d1d7708] Finished in 0.080 seconds with exit status 0 (successful).
DEBUG [0dbc1637] Running if test ! -d /home/user/cap/releases/20160629062112; then echo "Directory does not exist '/home/user/cap/releases/20160629062112'" 1>&2; false; fi as user#portal.nordcloud…
DEBUG [0dbc1637] Command: if test ! -d /home/user/cap/releases/20160629062112; then echo "Directory does not exist '/home/user/cap/releases/20160629062112'" 1>&2; false; fi
DEBUG [0dbc1637] Finished in 0.079 seconds with exit status 0 (successful).
DEBUG [6b62769e] Running /usr/bin/env [ -f /home/user/cap/shared/tmp/pids/sidekiq-0.pid ] as user#app.domain.com
DEBUG [6b62769e] Command: cd /home/user/cap/releases/20160629062112 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.0" ; /usr/bin/env [ -f /home/user/cap/shared/tmp/pids/sidekiq-0.pid ] )
DEBUG [6b62769e] Finished in 0.081 seconds with exit status 1 (failed).
INFO [eaed2dfc] Running /usr/bin/env sidekiq --index 0 --pidfile /home/user/cap/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /home/user/cap/shared/log/sidekiq.log --concurrency …
DEBUG [eaed2dfc] Command: cd /home/user/cap/releases/20160629062112 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.0" ; /usr/bin/env sidekiq --index 0 --pidfile /home/user/cap/shared/tmp/p…
DEBUG [eaed2dfc] /usr/bin/env: sidekiq: No such file or directory
Does anyone have hints what's going on, what is it looking for in /usr/bin/env and mail question: how do I solve it?
Looks like you use rbenv. Do you also have the Capistrano support gem included?
https://github.com/capistrano/rbenv
Also, take a look into this bug report - might be helpful!
This is baffling because I've properly updated and pushed to GIT's master branch before running 'cap staging deploy' but the changes just don't render on the staging server.
Please let me know if I can provide more info that may be helpful.
Thanks in advance for any help.
The app is restarting successfully the deploy too:
INFO [907b2583] Running /usr/bin/env touch /var/www/my_app/my_app-stgng/current/tmp/restart.txt as deploy#x.x.x.x
DEBUG [907b2583] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 /usr/bin/env touch /var/www/my_app/my_app-stgng/current/tmp/restart.txt )
INFO [907b2583] Finished in 0.666 seconds with exit status 0 (successful).
Edit: The deploy script is set to the correct branch, however the source code in /views doesn't match local source.
Edit: The correct source is in the git repo master branch. This seems to suggest my deploy is pulling from a different fork than intended.
Edit: Capistrano deploy log excerpt pertaining to GIT:
DEBUG Uploading /home/deploy/deploy_tmp/myappme_app/git-ssh.sh 0.0%
INFO Uploading /home/deploy/deploy_tmp/myappme_app/git-ssh.sh 100.0%
INFO [ffabbafb] Running /usr/bin/env chmod +x /home/deploy/deploy_tmp/myappme_app/git-ssh.sh as deploy#x.x.x.x
DEBUG [ffabbafb] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 /usr/bin/env chmod +x /home/deploy/deploy_tmp/myappme_app/git-ssh.sh )
INFO [ffabbafb] Finished in 0.640 seconds with exit status 0 (successful).
INFO [16e6d3cd] Running /usr/bin/env git ls-remote --heads git#bitbucket.org:CryptoWhippet/myappme_app.git as deploy#x.x.x.x
DEBUG [16e6d3cd] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git ls-remote --heads git#bitbucket.org:CryptoWhippet/myappme_app.git )
DEBUG [16e6d3cd] 2cd85c80e2d9b4c33b791c341dd19894 refs/heads/master
INFO [16e6d3cd] Finished in 5.960 seconds with exit status 0 (successful).
[..]
DEBUG [4341e870] Running /usr/bin/env [ -f /var/www/my_app/my_app-stgng/repo/HEAD ] as deploy#x.x.x.x
DEBUG [4341e870] Command: [ -f /var/www/my_app/my_app-stgng/repo/HEAD ]
DEBUG [4341e870] Finished in 0.691 seconds with exit status 0 (successful).
INFO The repository mirror is at /var/www/my_app/my_app-stgng/repo
DEBUG [20a36e89] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy#x.x.x.x
DEBUG [20a36e89] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [20a36e89] Finished in 0.648 seconds with exit status 0 (successful).
INFO [6bb0fabc] Running /usr/bin/env git remote update as deploy#x.x.x.x
DEBUG [6bb0fabc] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git remote update )
DEBUG [6bb0fabc] Fetching origin
INFO [6bb0fabc] Finished in 4.061 seconds with exit status 0 (successful).
DEBUG [bcc4ff25] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy#x.x.x.x
DEBUG [bcc4ff25] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [bcc4ff25] Finished in 0.648 seconds with exit status 0 (successful).
INFO [a3663844] Running /usr/bin/env mkdir -p /var/www/my_app/my_app-stgng/releases/20151209132220 as deploy#x.x.x.x
DEBUG [a3663844] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env mkdir -p /var/www/my_app/my_app-stgng/releases/20151209132220 )
INFO [a3663844] Finished in 0.650 seconds with exit status 0 (successful).
INFO [b2cf939e] Running /usr/bin/env git archive master | tar -x -f - -C /var/www/my_app/my_app-stgng/releases/20151209132220 as deploy#x.x.x.x
DEBUG [b2cf939e] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git archive master | tar -x -f - -C /var/www/my_app/my_app-stgng/releases/20151209132220 )
INFO [b2cf939e] Finished in 3.266 seconds with exit status 0 (successful).
DEBUG [b21a4932] Running /usr/bin/env if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi as deploy#x.x.x.x
DEBUG [b21a4932] Command: if test ! -d /var/www/my_app/my_app-stgng/repo; then echo "Directory does not exist '/var/www/my_app/my_app-stgng/repo'" 1>&2; false; fi
DEBUG [b21a4932] Finished in 0.646 seconds with exit status 0 (successful).
DEBUG [efdb30ab] Running /usr/bin/env git rev-list --max-count=1 --abbrev-commit master as deploy#x.x.x.x
DEBUG [efdb30ab] Command: cd /var/www/my_app/my_app-stgng/repo && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.1 GIT_ASKPASS=/bin/echo GIT_SSH=/home/deploy/deploy_tmp/myappme_app/git-ssh.sh /usr/bin/env git rev-list --max-count=1 --abbrev-commit master )
DEBUG [efdb30ab] 8b9d346
DEBUG [efdb30ab] Finished in 0.630 seconds with exit status 0 (successful).
There was a bug with some version of sass-rails that weren't recompiling stylesheets on deploy. You should first check if the git directory on your staging server is the same as in master, then check if functionality you added is working. If so, and you have only issues with stylesheets or maybe javascript and you probably need to play with gem versions.
To find working gem version you may manually change gemfile on staging server, then use same command as capistrano uses for bundle and precompiling assets.
If it doesnt help, check the cloned (by capistrano) repository mirror to confirm it's in the same state as origin/maser. If it doesn't match, and you're sure the git repository setting in your deploy configuration is correct, you should purge the repository directory and re-run your deploy routine.
Did you restart your server or not?
there are couple of things which we need to do after deployment once you deploy the code we need to checkout the server and we need to restart the server instance so that the changes should be come up your staging server, hopefully this may help you.
might be you need to add some task at your staging configuration file so that the server should be restated automatically if you want to restart the automatically.
after 'deploy:publishing', 'deploy:restart'
Hello I have problem with deploy my app.
I can't deploy my application because I have problem with git release
DEBUG[53fd915c] Finished in 2.573 seconds with exit status 0 (successful).
INFO[545c6125] Running /usr/bin/env mkdir -pv ~/deploy/shared ~/deploy/releases on
DEBUG[545c6125] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared ~/deploy/releases )
INFO[545c6125] Finished in 0.042 seconds with exit status 0 (successful).
INFO[021eadb4] Running /usr/bin/env mkdir -pv ~/deploy/shared/bin ~/deploy/shared/log ~/deploy/shared/tmp/pids ~/deploy/shared/tmp/cache ~/deploy/shared/tmp/sockets ~/deploy/shared/vendor/bundle ~/deploy/shared/public/system on DEBUG[021eadb4] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared/bin ~/deploy/shared/log ~/deploy/shared/tmp/pids ~/deploy/shared/tmp/cache ~/deploy/shared/tmp/sockets ~/deploy/shared/vendor/bundle ~/deploy/shared/public/system )
INFO[021eadb4] Finished in 0.040 seconds with exit status 0 (successful).
INFO[c4cc4af5] Running /usr/bin/env mkdir -pv ~/deploy/shared/config on DEBUG[c4cc4af5] Command: ( RVM_BIN_PATH=~/.rvm/bin /usr/bin/env mkdir -pv ~/deploy/shared/config )
INFO[c4cc4af5] Finished in 0.038 seconds with exit status 0 (successful).
DEBUG[c231d0c7] Running /usr/bin/env [ -f ~/deploy/shared/config/database.yml ] on DEBUG[c231d0c7] Command: [ -f ~/deploy/shared/config/database.yml ]
DEBUG[c231d0c7] Finished in 0.032 seconds with exit status 0 (successful).
DEBUG[b42c9ef2] Running /usr/bin/env [ -f ~/deploy/current/REVISION ] on DEBUG[b42c9ef2] Command: [ -f ~/deploy/current/REVISION ]
DEBUG[b42c9ef2] Finished in 0.031 seconds with exit status 1 (failed).
DEBUG[9f6e7e95] Running /usr/bin/env [ -f ~/deploy/repo/HEAD ] on
DEBUG[9f6e7e95] Command: [ -f ~/deploy/repo/HEAD ]
DEBUG[9f6e7e95] Finished in 0.031 seconds with exit status 0 (successful).
INFOThe repository mirror is at ~/deploy/repo
DEBUG[2c4a5ab1] Running /usr/bin/env if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi on
DEBUG[2c4a5ab1] Command: if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi
DEBUG[2c4a5ab1] Finished in 0.029 seconds with exit status 0 (successful).
INFO[ba7cef28] Running /usr/bin/env git remote update on
DEBUG[ba7cef28] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env git remote update )
INFO[ba7cef28] Finished in 0.038 seconds with exit status 0 (successful).
DEBUG[f0098e08] Running /usr/bin/env if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi on
DEBUG[f0098e08] Command: if test ! -d ~/deploy/repo; then echo "Directory does not exist '~/deploy/repo'" 1>&2; false; fi
DEBUG[f0098e08] Finished in 0.031 seconds with exit status 0 (successful).
INFO[4b4fe200] Running /usr/bin/env mkdir -p ~/deploy/releases/20140805094710 on
DEBUG[4b4fe200] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env mkdir -p ~/deploy/releases/20140805094710 )
INFO[4b4fe200] Finished in 0.038 seconds with exit status 0 (successful).
INFO[1bd3716b] Running /usr/bin/env git archive master | tar -x -C ~/deploy/releases/20140805094710 on
DEBUG[1bd3716b] Command: cd ~/deploy/repo && ( RVM_BIN_PATH=~/.rvm/bin GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/aligator/git-ssh.sh /usr/bin/env git archive master | tar -x -C ~/deploy/releases/20140805094710 )
DEBUG[1bd3716b] fatal: Not a valid object name
DEBUG[1bd3716b] tar: This does not look like a tar archive
DEBUG[1bd3716b] tar: Exiting with failure status due to previous errors
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host : git exit status: 2
git stdout: Nothing written
git stderr: Nothing written
Anyone have idea why it happen?
Maybe it's a problem with rvm or something, I spent with this a lot of time but no success
I also got the same issue like you (but my case is deploy to specific branch), and some one suggest here Capistrano error tar: This does not look like a tar archive. But he gave 2 options that should not suitable to my situation, I don't want to delete my current repo.
So after 1 hour to workaround, I have a solution:
Ex:
before: (deploy/production.rb)
set :branch, ENV["BRANCH_NAME"] || "master"
(I stay at master branch then run command)
BRANCH_NAME=another_branch_name cap production deploy
then I get an error like above
after: (deploy/production.rb)
set :branch, `git rev-parse --abbrev-ref HEAD`.chomp
(I stay at another_branch_name then run command)
cap production deploy
the error was fixed.
I'm using Capistrano 3.2.1 with Rails 4.0 in my application. I'm trying to install gem from my github repo. But it's not working. I have no idea what's going on. When I run ssh -T git#github.com on my server it gets succeed. But when I run cap production deploy I get following errors:
DEBUG [d89fd157] 000a0d807aabdb327d80bbe21d5212e62142f9ca refs/tags/staging-2014-05-22-15-58-38-0400^{}
DEBUG [d89fd157] 1cbcc8350316c7511035f1ef85f1f8d177197a24 refs/tags/staging-2014-05-22-16-55-02-0400
DEBUG [d89fd157] 5e905411ca362abe83fdbfbb4aa81222945dcecc refs/tags/staging-2014-05-22-16-55-02-0400^{}
DEBUG [d89fd157] fa200661a9791aefa41318a54c3fee477a246ece refs/tags/staging-2014-05-22-20-01-16-0400
DEBUG [d89fd157] 665fd3d871e75f6b092c11572c23e126d139d9d9 refs/tags/staging-2014-05-22-20-01-16-0400^{}
DEBUG [d89fd157] 84b23c1e93c47d91d4a442866d83a9e275428369 refs/tags/staging-2014-05-23-11-27-24-0400
DEBUG [d89fd157] 10a2c4dab3e76eb05ba07b18392f92bcc7e30ccf refs/tags/staging-2014-05-23-11-27-24-0400^{}
DEBUG [d89fd157] b7ca8b7bcad98e4160deb06df6688153e372f658 refs/tags/staging-2014-05-28-22-48-47-0530
DEBUG [d89fd157] f69bf3a92ad5ef65cb9425428be0446c2459143a refs/tags/staging-2014-05-28-22-48-47-0530^{}
DEBUG [d89fd157] 62a2a29e5c88e3603666826421cb1ea28f78423c refs/tags/staging-2014-05-29-00-46-10-0530
DEBUG [d89fd157] f69bf3a92ad5ef65cb9425428be0446c2459143a refs/tags/staging-2014-05-29-00-46-10-0530^{}
DEBUG [d89fd157] 960e24c40e0ab7207f92812f34015ae41a307e7e refs/tags/staging-2014-05-29-00-51-04-0530
DEBUG [d89fd157] f69bf3a92ad5ef65cb9425428be0446c2459143a refs/tags/staging-2014-05-29-00-51-04-0530^{}
DEBUG [d89fd157] Finished in 2.876 seconds with exit status 0 (successful).
INFO [dc211684] Running /usr/bin/env mkdir -pv /data/apps/myautobrain/shared /data/apps/myautobrain/releases on 107.170.168.224
DEBUG [dc211684] Command: ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 /usr/bin/env mkdir -pv /data/apps/myautobrain/shared /data/apps/myautobrain/releases )
INFO [dc211684] Finished in 1.669 seconds with exit status 0 (successful).
INFO [3b633fa7] Running /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/log /data/apps/myautobrain/shared/tmp /data/apps/myautobrain/shared/vendor/bundle /data/apps/myautobrain/shared/db/backups /data/apps/myautobrain/shared/config/settings on 107.170.168.224
DEBUG [3b633fa7] Command: ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/log /data/apps/myautobrain/shared/tmp /data/apps/myautobrain/shared/vendor/bundle /data/apps/myautobrain/shared/db/backups /data/apps/myautobrain/shared/config/settings )
INFO [3b633fa7] Finished in 1.646 seconds with exit status 0 (successful).
INFO [1581b4a0] Running /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/config on 107.170.168.224
DEBUG [1581b4a0] Command: ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 /usr/bin/env mkdir -pv /data/apps/myautobrain/shared/config )
INFO [1581b4a0] Finished in 1.691 seconds with exit status 0 (successful).
DEBUG [48a6c211] Running /usr/bin/env [ -f /data/apps/myautobrain/shared/config/database.yml ] on 107.170.168.224
DEBUG [48a6c211] Command: [ -f /data/apps/myautobrain/shared/config/database.yml ]
DEBUG [48a6c211] Finished in 1.676 seconds with exit status 0 (successful).
DEBUG [0a11405e] Running /usr/bin/env [ -f /data/apps/myautobrain/shared/config/database.yml ] on 107.170.168.224
DEBUG [0a11405e] Command: [ -f /data/apps/myautobrain/shared/config/database.yml ]
DEBUG [0a11405e] Finished in 1.575 seconds with exit status 0 (successful).
DEBUG [2c1a88cc] Running /usr/bin/env [ $(which nodejs || which node ) ] on 107.170.168.224
DEBUG [2c1a88cc] Command: [ $(which nodejs || which node ) ]
DEBUG [2c1a88cc] Finished in 1.560 seconds with exit status 0 (successful).
INFO Javascript runtime nodejs is available on 107.170.168.224
DEBUG [5c2090dd] Running /usr/bin/env [ $(which identify) ] on 107.170.168.224
DEBUG [5c2090dd] Command: [ $(which identify) ]
DEBUG [5c2090dd] Finished in 1.643 seconds with exit status 0 (successful).
INFO Javascript runtime nodejs is available on 107.170.168.224
DEBUG [51feab0b] Running /usr/bin/env [ -f /data/apps/myautobrain/repo/HEAD ] on 107.170.168.224
DEBUG [51feab0b] Command: [ -f /data/apps/myautobrain/repo/HEAD ]
DEBUG [51feab0b] Finished in 1.620 seconds with exit status 0 (successful).
INFO The repository mirror is at /data/apps/myautobrain/repo
DEBUG [60a484d1] Running /usr/bin/env if test ! -d /data/apps/myautobrain/repo; then echo "Directory does not exist '/data/apps/myautobrain/repo'" 1>&2; false; fi on 107.170.168.224
DEBUG [60a484d1] Command: if test ! -d /data/apps/myautobrain/repo; then echo "Directory does not exist '/data/apps/myautobrain/repo'" 1>&2; false; fi
DEBUG [60a484d1] Finished in 1.592 seconds with exit status 0 (successful).
DEBUG [be3246e2] Running /usr/bin/env cd /data/apps/myautobrain/repo && git rev-parse --short HEAD on 107.170.168.224
DEBUG [be3246e2] Command: cd /data/apps/myautobrain/repo && git rev-parse --short HEAD
DEBUG [be3246e2] 3dbe0cd
DEBUG [be3246e2]
DEBUG [be3246e2] Finished in 0.194 seconds with exit status 0 (successful).
INFO [375571f4] Running /usr/bin/env git remote update on 107.170.168.224
DEBUG [375571f4] Command: cd /data/apps/myautobrain/repo && ( RAILS_ENV=staging RBENV_ROOT=/data/rbenv RBENV_VERSION=2.1.1 GIT_ASKPASS=/bin/echo GIT_SSH=/data/tmp/myautobrain/git-ssh.sh /usr/bin/env git remote update )
DEBUG [375571f4] Fetching origin
DEBUG [375571f4]
DEBUG [375571f4] ERROR: Repository not found.
DEBUG [375571f4]
DEBUG [375571f4] fatal: The remote end hung up unexpectedly
DEBUG [375571f4]
DEBUG [375571f4] error: Could not fetch origin
DEBUG [375571f4]
cap aborted!
git exit status: 1
git stdout: Nothing written
git stderr: Nothing written
Tasks: TOP => git:create_release => git:update
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Command::Failed: git exit status: 1
git stdout: Nothing written
git stderr: Nothing written
>
Here's deploy.rb:
set :rbenv_type, :user # or :system, depends on your rbenv setup
set :rbenv_ruby, '2.1.1'
#TODO: Check the application name
set :application, 'myautobrain'
#TODO: Replace with valid github url
set :repo_url, 'git#github.com:swjg-ventures/myautobrain.git'
ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
set :deploy_to, "/data/apps/#{fetch(:application)}"
set :scm, :git
set :format, :pretty
set :log_level, :debug
set :pty, true
set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{log tmp vendor/bundle db/backups config/settings}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
set :keep_releases, 5
set :bundle_without, %w{development test utils}.join(' ')
set :git_tag_name, proc { Time.now.to_s.gsub(/[-\s\:\+]+/, '-') }
before 'deploy:migrate', 'db:backup'
after 'deploy:finishing', 'deploy:restart'
after 'deploy:finishing', 'deploy:cleanup'
From server:
deployer#myautobrain-staging:~$ ls -l ~/.ssh
total 20
-rw------- 1 deployer deployer 4815 May 28 17:57 authorized_keys
-rw------- 1 deployer deployer 1675 May 28 17:29 id_rsa
-rw-r--r-- 1 deployer deployer 404 May 28 17:29 id_rsa.pub
-rw-r--r-- 1 deployer deployer 2210 May 28 13:17 known_hosts
The most frustrating part of this process is that this process works on my coworkers computer.
Any idea? If you need more info, let me know.
I had this error when trying to deploy my app, all I needed to do was:
remove ${deploy_dir}/repo and successfully deployed.
In my case I had changed from https://github.com to https://bitbucket.org
and all the configurations from github was still in the ${deploy_dir}/repo.
You have to make sure the remote server has access to the private keys to access the repository. Log in to the server and verify the private keys are accessible:
ls -l ~/.ssh
Make sure they have to correct permissions too (600), including the directory.
Also try:
set :repository, "git#github.com:name/project.git"
instead of :repo_url. (I think this is for version 2. Version 3 does seem to use :repo_url.)