Search code examples
gitsymfonydoctrine-ormcapistranocapifony

Capistrano deploy fails with sudden permission problems


I've been successfully deploying my symfony2 app for months running 'cap deploy'. I haven't changed anything in deploy.rb or on the server.

Suddenly it is failing due to permissions.

** [←[31mout :: example.com←[0m] rm: cannot remove `/var/www/vhosts/example.com/releases/20140617172613/vendor/doctrine/orm/bin/doctrine.php': Permission denied

It is creating most directories with the correct user (git). In the failed release directory there's a bin directory with the user 'root'.

What's left in the failed /releases/20140617172613 directory is:

/app (user=git)

/bin (user=root)

/vendor (user=git)

/vendor/doctrine/ (user=git)

/vendor/doctrine/orm/ (user=root)

/vendor/...{other dirs with git user}

Is there something special happening with the doctrine directory?

Thanks for your help!


Solution

  • I discovered the issue. I hadn't run composer update, and a new version of one bundle was released. It had many altered parameters causing an error.

    It was a strange place to get an error in the deployment sequence.

    Moral of the story: Run 'composer update' on your dev box before deploying.