capistrano-plugins / capistrano-unicorn-nginx

Capistrano tasks for automatic and sensible unicorn + nginx configuration
MIT License
175 stars 81 forks source link

Can't start unicorn #53

Closed Awea closed 8 years ago

Awea commented 9 years ago

I'm trying to deploy my application on a vm for testing. The cap setup run without any troubles :

DEBUG [180db0d8] Running /usr/bin/env [ -d ~/.rbenv/versions/2.1.1 ] as awea@192.168.0.16
DEBUG [180db0d8] Command: [ -d ~/.rbenv/versions/2.1.1 ]
DEBUG [180db0d8] Finished in 0.214 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/sample_rails_app_production 0.0%
INFO Uploading /tmp/sample_rails_app_production 100.0%
INFO [19a478cf] Running /usr/bin/env sudo mv /tmp/sample_rails_app_production /etc/nginx/sites-available as awea@192.168.0.16
DEBUG [19a478cf] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env sudo mv /tmp/sample_rails_app_production /etc/nginx/sites-available )
INFO [19a478cf] Finished in 0.008 seconds with exit status 0 (successful).
INFO [69f40ba8] Running /usr/bin/env sudo ln -fs /etc/nginx/sites-available/sample_rails_app_production /etc/nginx/sites-enabled/sample_rails_app_production as awea@192.168.0.16
DEBUG [69f40ba8] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env sudo ln -fs /etc/nginx/sites-available/sample_rails_app_production /etc/nginx/sites-enabled/sample_rails_app_production )
INFO [69f40ba8] Finished in 0.007 seconds with exit status 0 (successful).
DEBUG [3a5072f7] Running /usr/bin/env id -un as awea@192.168.0.16
DEBUG [3a5072f7] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env id -un )
DEBUG [3a5072f7]    awea
DEBUG [3a5072f7] Finished in 0.005 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/unicorn_sample_rails_app_production 0.0%
INFO Uploading /tmp/unicorn_sample_rails_app_production 100.0%
INFO [c82308e3] Running /usr/bin/env sudo mv /tmp/unicorn_sample_rails_app_production /etc/init.d as awea@192.168.0.16
DEBUG [c82308e3] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env sudo mv /tmp/unicorn_sample_rails_app_production /etc/init.d )
INFO [c82308e3] Finished in 0.008 seconds with exit status 0 (successful).
INFO [90e57931] Running /usr/bin/env chmod +x /etc/init.d/unicorn_sample_rails_app_production as awea@192.168.0.16
DEBUG [90e57931] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env chmod +x /etc/init.d/unicorn_sample_rails_app_production )
INFO [90e57931] Finished in 0.004 seconds with exit status 0 (successful).
INFO [57f13c83] Running /usr/bin/env sudo update-rc.d -f unicorn_sample_rails_app_production defaults as awea@192.168.0.16
DEBUG [57f13c83] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env sudo update-rc.d -f unicorn_sample_rails_app_production defaults )
DEBUG [57f13c83]    update-rc.d: using dependency based boot sequencing
INFO [57f13c83] Finished in 0.043 seconds with exit status 0 (successful).
INFO [3ce825ab] Running /usr/bin/env mkdir -pv /var/www/sample_rails_app/shared/config as awea@192.168.0.16
DEBUG [3ce825ab] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env mkdir -pv /var/www/sample_rails_app/shared/config )
INFO [3ce825ab] Finished in 0.007 seconds with exit status 0 (successful).
DEBUG Uploading /var/www/sample_rails_app/shared/config/unicorn.rb 0.0%
INFO Uploading /var/www/sample_rails_app/shared/config/unicorn.rb 100.0%

But when it come to start unicorn service it doesn't found the binary:

DEBUG [5a1d53e8] Running /usr/bin/env [ -d ~/.rbenv/versions/2.1.1 ] as awea@192.168.0.16
DEBUG [5a1d53e8] Command: [ -d ~/.rbenv/versions/2.1.1 ]
DEBUG [5a1d53e8] Finished in 0.102 seconds with exit status 0 (successful).
INFO [fc7a9ab3] Running /usr/bin/env service unicorn_sample_rails_app_production start as awea@192.168.0.16
DEBUG [fc7a9ab3] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.1 /usr/bin/env service unicorn_sample_rails_app_production start )
DEBUG [fc7a9ab3]    /usr/bin/env:
DEBUG [fc7a9ab3]    service
DEBUG [fc7a9ab3]    : Aucun fichier ou dossier de ce type
DEBUG [fc7a9ab3]
lancedikson commented 9 years ago

+1

lancedikson commented 9 years ago

But i have different error message:

~/Projects/shemberg-rails (master) cap staging unicorn:start
INFO [b13d534b] Running /usr/bin/env service unicorn_shemberg_staging start as vsefasadi.ru@shemberg.ru
DEBUG [b13d534b] Command: /usr/bin/env service unicorn_shemberg_staging start
DEBUG [b13d534b]    /etc/init.d/unicorn_shemberg_staging: line 26: kill: (5663) - No such process
DEBUG [b13d534b]    master failed to start, check stderr log for details
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as vsefasadi.ru@shemberg.ru: service exit status: 1
service stdout: Nothing written
service stderr: /etc/init.d/unicorn_shemberg_staging: line 26: kill: (5663) - No such process
master failed to start, check stderr log for details

SSHKit::Command::Failed: service exit status: 1
service stdout: Nothing written
service stderr: /etc/init.d/unicorn_shemberg_staging: line 26: kill: (5663) - No such process
master failed to start, check stderr log for details

Tasks: TOP => unicorn:start
(See full trace by running task with --trace)
Awea commented 9 years ago

I didn't get any trouble when I log myself on the server and manually start the service. But well it's not very smooth ^^

lancedikson commented 9 years ago

Sorry, my message is not actual: unicorn is not started for my issue on code.

Awea commented 9 years ago

The service command is only available for root user on Debian, I don't understand something. @bruno- Am I supposed to add it to my user PATH or something like that ?

hiphapis commented 9 years ago

i have same issue. and @Awea last comment is correct. (used Debian) original capistrano-unicorn-nginx was used sudo https://github.com/kalys/capistrano-nginx-unicorn/blob/master/lib/capistrano/tasks/unicorn.rake#L30 but i understand why changed to execute.

hiphapis commented 9 years ago

FYI:

rhomeister commented 8 years ago

Closing due to lack of activity. I think this might have been resolved with the PRs.

hiphapis commented 8 years ago

@rhomeister sure. thx ;)