4

When I trying to deploy my app via capistrano, on ts:stop command there is infinity freeze, so deploy proccess can't finish well. Any ideas?

enter image description here

Here is a trace log:

** Invoke ts:stop (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute ts:stop
Meliborn
  • 6,495
  • 6
  • 34
  • 53
  • Does it work if you log in to the server and run the command directly? – pat Jun 29 '13 at 15:42
  • Yes, I did it via ssh on my server – Meliborn Jun 29 '13 at 16:19
  • And it's the same user that's running the command via ssh and via capistrano? What version of Thinking Sphinx are you using? – pat Jun 30 '13 at 01:34
  • Yes, the same user. TS version is the last from git. – Meliborn Jun 30 '13 at 18:16
  • I'm afraid I've no idea why this is happening. Perhaps you could run the task via cap, then SSH in and see if there's any clues as to what's causing it to hang (is the daemon still running? Is the rake task still running?). You could try killing the appropriate process, see if a stack trace is returned via cap? – pat Jul 05 '13 at 14:09
  • Can this be a problem with rake? – Meliborn Jul 05 '13 at 21:53
  • I would be surprised if that's the case, given rake's generally running fine... (ie, when you run it directly, not through capistrano) – pat Jul 05 '13 at 23:40

2 Answers2

1

The problem comes, in my mind, from the pid_file which is not found I think. This file must be external to the Capistrano versionning.

As describe on the documentation, you should have something like that in your thinking_sphinx.yml:

production:
  mysql41: 9312
  enable_star: true
  min_prefix_len: 3
  utf8: true
  pid_file: /my_project/sphinx/production.searchd.pid
  indices_location: /my_project/pinchix/shared/sphinx

If you don't, as Capistrano is creating versioning folders, Thinking Sphinx won't be able to find pids on the the deployment folder (it's searching on the current one by default) an then will block because it can't start a new one if another one is already started (port not free).

brcebn
  • 1,571
  • 1
  • 23
  • 46
  • This answer is spot on. Also, the next version of Riddle will have a fix for the endless stopping (it's in the develop branch if you want to use that via a git reference). – pat Jun 22 '14 at 09:10
0

Make sure you're starting sphinx and running after deploy hooks with the same ruby version. In my case versions was different and setting rvm default and specifying ruby version and correct gemset in deploy.rb solved the problem.

iRet
  • 31
  • 3