Problem with deploy: fatal: destination path already exists and is not an empty directory.

2,770 views
Skip to first unread message

bsod99

unread,
Mar 4, 2013, 9:38:32 AM3/4/13
to capis...@googlegroups.com
Hi, 

I've run into an issue with deployment to my production server. The same deploy script works fine on my staging server which is configured almost identically to production. Deploy setup is running without error, but then deploy is throwing the following error:

  * executing "git clone --depth 1 g...@codebasehq.com:mysite/mysite/mysite.git /var/www/vhosts/mysite.com/releases/20130304140412 && cd /var/www/vhosts/mysite.com/releases/20130304140412 && git checkout -b deploy a38f9019cae0473e5b7610318f8250499c3d78c9 && git submodule init && git submodule sync && export GIT_RECURSIVE=$([ ! \"`git --version`\" \\< \"git version 1.6.5\" ] && echo --recursive) && git submodule update --init $GIT_RECURSIVE && rm -Rf /var/www/vhosts/mysite.com/releases/20130304140412/.git && (echo a38f9019cae0473e5b7610318f8250499c3d78c9 > /var/www/vhosts/mysite.com/releases/20130304140412/REVISION)"
    servers: ["serverIP", "mysite.com"]
    [serverIP] executing command
    [mysite.com] executing command
 ** [serverIP :: out] Initialized empty Git repository in /var/www/vhosts/mysite.com/releases/20130304140412/.git/
 ** [mysite.com :: err] fatal: destination path '/var/www/vhosts/mysite.com/releases/20130304140412' already exists and is not an empty directory.
 ** [serverIP :: err] Switched to a new branch 'deploy'

If I delete everything with mysite.com folder and start again with setup, then deploy - i get the same issue again. Running ls -a shows nothing in the folder before i run setup.

Any ideas?

My deployment script is here

Lee Hambley

unread,
Mar 4, 2013, 9:45:44 AM3/4/13
to capis...@googlegroups.com
Nicky,

Is it possible you have the same host in more than one role, so that they're racing? For example I mean that you might have the same IP address defined as an :app role host more than once.

When connecting, all hosts in that list try to checkout and create the same releases directory, except by this time, there's already one process faster than the others, and has already installed the code on one of them, and then the other fails?


--
--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
---
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bsod99

unread,
Mar 4, 2013, 12:45:12 PM3/4/13
to capis...@googlegroups.com
Thanks Lee, you were right. I was setting :application, role :web and role: app
Reply all
Reply to author
Forward
0 new messages