Maximus S
Maximus S

Reputation: 11095

Rails, Deploying With Capistrano to a VPS on Unicorn

I need help debugging the following issue. It's my first time deploying, and I haven't been able to come up with the solution.

  * 2012-12-05 18:37:44 executing `deploy:start'
  * executing "/etc/init.d/unicorn_blog start"
executing command
/etc/init.d/unicorn_blog: 24: kill: No such process
master failed to start, check stderr log for details

Here's the stderr

/.../unicorn/socket_helper.rb:140:in `initialize': Address already in use - /tmp/unicorn.my_app.sock (Errno::EADDRINUSE)

Upvotes: 1

Views: 2125

Answers (4)

sondn
sondn

Reputation: 1

I got same error, and i fixed as below:

  1. SSH to server where your project deploy to, and run these command
    ps -ef | grep unicorn => list pid of unicorn. Find your process id of unocorn master.
    Replace pid on "unicorn.my_app.sock" with above pid.

  2. Try to deploy again with capistrano.

Upvotes: 0

golfadas
golfadas

Reputation: 5521

I had to

sudo rm /tmp/unicorn.my_app.sock

and

sudo /etc/init.d/unicorn_myapp start

Upvotes: 1

Maximus S
Maximus S

Reputation: 11095

Unsure how it works, but the following solution actually worked.

lsof /tmp/unicorn.my_app.socket 

lists the pids

kill -9 pid

(replace 'pid' with one of those listed)

Then cap deploy:start from the local terminal.

source: Unicorn/Nginx process missing, socket open

Upvotes: 2

bloudermilk
bloudermilk

Reputation: 18109

It looks like you have a zombie Unicorn process running with a PID different from the one that was recorded by init.d. I would try running $ ps aux | grep unicorn to find the zombie process, then kill it.

Upvotes: 4

Related Questions