Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remind the developer to use absolute path if Unicorn sockets is been used. #66

Open
chengguangnan opened this issue Aug 9, 2013 · 0 comments

Comments

@chengguangnan
Copy link

I was having issue to have cap deploy to restart unicorn for a preload_app. The duplicated unicorn will fail do bind the socket.

I found that the problem is gone if I used absolute path in config/unicorn.rb.

app_path = "/u/apps/radiant_land/current"
listen "unix:#{app_path}/tmp/sockets/unicorn.sock"

It think it's due to how capistrano re-create the app folder and symbol links. Please make a note of this on the config file.

Bellow is the error if using relative socket path and try to cap deploy when unicorn is already running. Note that it only happens with cap deploy not cap unicorn:restart as only the former would recreate the folders and links.

I, [2013-08-09T06:31:57.554755 #12707]  INFO -- : listening on addr=/u/apps/radiant_land/releases/20130809132821/tmp/sockets/unicorn.sock fd=11
I, [2013-08-09T06:31:57.564837 #12707]  INFO -- : master process ready
I, [2013-08-09T06:31:57.567537 #12728]  INFO -- : worker=0 ready
I, [2013-08-09T06:31:57.568356 #12731]  INFO -- : worker=1 ready
I, [2013-08-09T06:33:49.251529 #15352]  INFO -- : executing ["/u/apps/radiant_land/shared/bundle/ruby/2.0.0/bin/unicorn", "-c", "/u/apps/radian
t_land/current/config/unicorn.rb", "-E", "production", "-D", {11=>#<Kgio::UNIXServer:/u/apps/radiant_land/releases/20130809132821/tmp/sockets/u
nicorn.sock>}] (in /u/apps/radiant_land/releases/20130809133015)
I, [2013-08-09T06:33:49.251727 #15352]  INFO -- : forked child re-executing...
I, [2013-08-09T06:33:49.535625 #15352]  INFO -- : inherited addr=/u/apps/radiant_land/releases/20130809132821/tmp/sockets/unicorn.sock fd=11
I, [2013-08-09T06:33:49.535997 #15352]  INFO -- : Refreshing Gem list
E, [2013-08-09T06:33:51.078553 #15352] ERROR -- : adding listener failed addr=/u/apps/radiant_land/releases/20130809133015/tmp/sockets/unicorn.
sock (in use)
E, [2013-08-09T06:33:51.078635 #15352] ERROR -- : retrying in 5 seconds (4 tries left)
I, [2013-08-09T06:33:54.347957 #12707]  INFO -- : reaped #<Process::Status: pid 12728 exit 0> worker=0
I, [2013-08-09T06:33:54.348174 #12707]  INFO -- : reaped #<Process::Status: pid 12731 exit 0> worker=1
I, [2013-08-09T06:33:54.348223 #12707]  INFO -- : master complete
E, [2013-08-09T06:33:56.079288 #15352] ERROR -- : adding listener failed addr=/u/apps/radiant_land/releases/20130809133015/tmp/sockets/unicorn.
sock (in use)
E, [2013-08-09T06:33:56.079403 #15352] ERROR -- : retrying in 5 seconds (3 tries left)
E, [2013-08-09T06:34:01.080030 #15352] ERROR -- : adding listener failed addr=/u/apps/radiant_land/releases/20130809133015/tmp/sockets/unicorn.
sock (in use)
E, [2013-08-09T06:34:01.080134 #15352] ERROR -- : retrying in 5 seconds (2 tries left)
E, [2013-08-09T06:34:06.080857 #15352] ERROR -- : adding listener failed addr=/u/apps/radiant_land/releases/20130809133015/tmp/sockets/unicorn.
sock (in use)
E, [2013-08-09T06:34:06.080965 #15352] ERROR -- : retrying in 5 seconds (1 tries left)
E, [2013-08-09T06:34:11.081692 #15352] ERROR -- : adding listener failed addr=/u/apps/radiant_land/releases/20130809133015/tmp/sockets/unicorn.
sock (in use)
E, [2013-08-09T06:34:11.081791 #15352] ERROR -- : retrying in 5 seconds (0 tries left)
E, [2013-08-09T06:34:16.082448 #15352] ERROR -- : adding listener failed addr=/u/apps/radiant_land/releases/20130809133015/tmp/sockets/unicorn.
sock (in use)
/u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:140:in `initialize': Address already in use - "/u
/apps/radiant_land/releases/20130809133015/tmp/sockets/unicorn.sock" (Errno::EADDRINUSE)
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:140:in `new'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/socket_helper.rb:140:in `bind_listen'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:229:in `listen'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in `block in bind_new_listeners!'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in `each'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:773:in `bind_new_listeners!'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:141:in `start'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn:126:in `<top (required)>'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
        from /u/apps/radiant_land/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `<main>'
I, [2013-08-09T06:38:12.150644 #21693]  INFO -- : Refreshing Gem list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant