Skip to content

Instantly share code, notes, and snippets.

@optimum-dulopin
Created October 22, 2013 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save optimum-dulopin/7109877 to your computer and use it in GitHub Desktop.
Save optimum-dulopin/7109877 to your computer and use it in GitHub Desktop.
problem while deploying with capistrano-unicorn
triggering load callbacks
* 2013-10-23 01:13:56 executing `unicorn:restart'
triggering before callbacks for `unicorn:restart'
/home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:537:in `getpwnam': can't find user for userserver (ArgumentError)
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:537:in `user'
from config/unicorn/production.rb:22:in `reload'
from /tmp/unicorn.rb20131023-5845-18v4edv:7:in `instance_eval'
from /tmp/unicorn.rb20131023-5845-18v4edv:7:in `reload'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:75:in `instance_eval'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:75:in `reload'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/lib/unicorn/configurator.rb:68:in `initialize'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:108:in `new'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:108:in `initialize'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/bin/unicorn:126:in `new'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/gems/unicorn-4.6.3/bin/unicorn:126:in `<top (required)>'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/bin/unicorn:23:in `load'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/bin/unicorn:23:in `<main>'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/bin/ruby_noexec_wrapper:14:in `eval'
from /home/userlocal/.rvm/gems/ruby-2.0.0-p247@monapp/bin/ruby_noexec_wrapper:14:in `<main>'
*** err :: failed to auto-detect pid from config/unicorn/production.rb
*** err :: falling back to default: /home/userserver/current/tmp/pids/unicorn.pid
* executing "if [ -e /home/userserver/current/tmp/pids/unicorn.pid ] && kill -0 `cat /home/userserver/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then\\\n echo \"Duplicating Unicorn...\";\\\n kill -s USR2 `cat /home/userserver/current/tmp/pids/unicorn.pid`;\\\n else\\\n \\\n if [ -e \"/home/userserver/current/config/unicorn.rb\" ]; then\\\n UNICORN_CONFIG_PATH=/home/userserver/current/config/unicorn.rb;\\\n else\\\n if [ -e \"/home/userserver/current/config/unicorn/production.rb\" ]; then\\\n UNICORN_CONFIG_PATH=/home/userserver/current/config/unicorn/production.rb;\\\n else\\\n echo \"Config file for \"production\" environment was not found at either \"/home/userserver/current/config/unicorn.rb\" or \"/home/userserver/current/config/unicorn/production.rb\"\";\\\n exit 1;\\\n fi;\\\n fi;\\\n\\\n if [ -e \"/home/userserver/current/tmp/pids/unicorn.pid\" ]; then\\\n if kill -0 `cat /home/userserver/current/tmp/pids/unicorn.pid` > /dev/null 2>&1; then\\\n echo \"Unicorn is already running!\";\\\n exit 0;\\\n fi;\\\n\\\n rm /home/userserver/current/tmp/pids/unicorn.pid;\\\n fi;\\\n\\\n echo \"Starting Unicorn...\";\\\n cd /home/userserver/current && RAILS_ENV=production BUNDLE_GEMFILE=/home/userserver/current/Gemfile bundle exec unicorn -c $UNICORN_CONFIG_PATH -E deployment -D ;\\\n \\\n fi;\\\n\\\n\\\n sleep 2; # in order to wait for the (old) pidfile to show up\\\n\\\n if [ -e /home/userserver/current/tmp/pids/unicorn.pid.oldbin ] && kill -0 `cat /home/userserver/current/tmp/pids/unicorn.pid.oldbin` > /dev/null 2>&1; then\\\n kill -s QUIT `cat /home/userserver/current/tmp/pids/unicorn.pid.oldbin`;\\\n fi;"
servers: ["xx.xx.xx.xx"]
[xx.xx.xx.xx] executing command
** [out :: xx.xx.xx.xx] Duplicating Unicorn...
command finished in 2583ms
@Batistleman
Copy link

I removed the

user 'xxxx'

from my config/unicorn.rb configuration file and things worked.

@wonook
Copy link

wonook commented Jan 20, 2015

I have the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment