views:

196

answers:

4

I'm having a weird problem. I do a deploy and then the dir that just got uploaded is then deleted by the cleanup task. I haven't deployed to this site in well over a month but I didn't change the deploy recipe. Any ideas?

Here's the output. http://gist.github.com/267850

+1  A: 

Something is breaking during this step:

 ** keeping 5 of 9 deployed releases
  * executing "rm -rf /home/user/public_html/mysite/releases/20100103015806 /home/user/public_html/mysite/releases/20100103000220 /home/user/public_html/mysite/releases/20100103000202 /home/user/public_html/mysite/releases/20100102234212"

because 20100103015806 is the release currently being deployed. I would recommend turning off the

set :keep_releases, 5

code in your config/deploy.rb file until the issue can be fully debugged

John Douthat
I actually don't have "set :keep_releases" in my deploy file. I just call the cleanup task which I guess has 5 as the default. I tried putting :keep releases in the recipe and it seems to have no effect though.
kjs3
Ahh OK. If you remove the cleanup task, that might help. Reading through lib/capistrano/recipes/deploy.rb, which has the source for cleanup may help debugging the issue. Please try `ls -xt #{releases_path}` on your server and see if there is something wrong with the order. Perhaps your server's .profile or something is changing the default order of ls so that it's not the order that capistrano expects.
John Douthat
A: 

It looks to me that this line is the culprit:

 * executing "ln -nfs /home/user/public_html/mysite/shared/content_images /home/user/public_html/mysite/current/public/content_images"

Have you tinkered with this line lately? Any changes to the shared/content_images directory or its permissions? It seems the directory is missing.

allesklar
That's because the target of mysite/current was deleted, so mysite/current/public/content_images could not be found. i.e.ln -s /home/user/public_html/mysite/releases/20100103015806 /home/user/public_html/mysite/current...rm -rf /home/user/public_html/mysite/releases/20100103015806...ln -nfs /home/user/public_html/mysite/shared/content_images /home/user/public_html/mysite/current/public/content_images** failed
John Douthat
John Douthat is right. This is just another task that I put in the recipe. If I leave it out it makes no difference but if I leave out the cleanup task everything is fine.
kjs3
+3  A: 

Capistrano 2.5.11 has a BIG F*CKING BUG.

Timothy Jones
Thank you very much! Rolled back to earlier version and all is well.
kjs3
+1  A: 

This was a problem in 2.5.11 (a mistake on my part, I'm afraid) – rectified in 2.5.12– see capistrano.lighthouseapp.com if you are interested (ticket #88) for the discussion.

Beaks