Site5 Deployment Problems with Capistrano > 1.2

Posted by Matt White, Fri Feb 09 16:46:00 UTC 2007

So, I’ve dutifully upgraded my copy of Capistrano to the latest version, and then updated one of the apps I have running on Site5. The only one, actually, and it will probably stay that way. After feeling the Mongrel love with a little Nginx/Pound/Pen/mod_proxy_balancer sprinkled on top I don’t think I’ll EVER use FastCGI again. Anyway…

Apparently in the latest versions of Capistrano, all permissions on the new releases are set chmod g+w, something that doesn’t fly on most (if not all) shared hosts. The biggest problem, however, is how this problem is manifested on such hosts as Site 5. In this case, the app would simply refuse to spawn ANY FastCGI processes, and would return a completely empty request. No HTTP status code, nothing. Apache would still serve static files, but anything that fell through to the dispatcher would fail.

Of course, there we NO log messages in either the production.log or the fastcgi.crash.log. Nothing. Nada. Nothing to work with. Not even a 500 response in the browser.

After tearing my hair out, I talked to Site5 support and they suggested permissions as the culprit. However, they suggested that I set 755 on the whole app, which failed to rectify the Capistrano-set permissions. At this point I didn’t realize what Capistrano was doing, so I resumed emptying my follicles.

After reading a post by “Josh on Rails” on the RoR message board about the same problem, I found out what Capistrano was doing. Thankfully, in version 1.4.0 of Capistrano, Jamis added a :set_permissions task, allowing you to override the task in your deploy.rb. So, I just did the following:

1
2
3
4

task :set_permissions, :except => { :no_release => true } do
  # do nothing
end

in my deploy.rb, and voila, no more problem. Simple fix, but since there is really zero diagnostic info available it’s almost impossible to figure out what’s going on. (At least for me with my seemingly never-ending shallow knowledge of the UNIX domain… Curse my days as an ASP.Net user! Curse them!)

Hope this saves someone a few hours… I wasted far too many on it.

Filed Under: Rails | Tags:

Comments

  1. Gabe da Silveira 02.17.07 / 20PM

    Ah-ha! I ran into this issue several weeks ago while moving an app from Dreamhost. I set the project aside for a while and in the meantime you posted this. Thanks a lot bro.