Header

Permission Denied

You may see an error code such as 550, 553 or similar when trying to upload a particular file to your server which normally means that the file/folder you're trying to deploy isn't owned by the correct user or user group, or if the folder is currently in use by another process

This error can also sometimes be caused by other server problems such as running out of disk space or an invalid symlink.

Checking permissions

You can check the permissions on the file or folder by running the following command and checking the user and group are correct, if they are not then you'll need to change them before your deployments will succeed.

$ ls -l /path/to/file/or/folder
total 70712
drwx------   3 user group  102 23 May 12:55 app
drwxr-----+  5 user group  170 28 Jul 12:06 config
drwx------+ 19 user group  646 14 Jul 08:37 config.ru
drwx------+ 18 user group  612 28 Jul 14:06 db
drwx------@ 21 user group  714 25 Jul 12:59 public

Resolving permissions issues

You'll normally find that you either have to change the owner of the file/folder that is causing problems, or change the permission level. You can run the following to update the owner and group, ensuring your deployment user can write to it:

chown -R deployuser:deployuser /path/to/file/or/folder

If you just need to modify the actual permissions, you can run the following:

chmod 755 deployuser /var/www/my-site

That'll give full read, write and execute access to the directory owner, but only read and execute access to the user group and anyone else.

Please note that when running these commands, the user you execute them as will need permission to do so. If you run into any errors such as "operation not permitted", you may need to prefix the command with sudo and enter your root password.

More information about file permissions can be found in this article.

You may also see a variation of the 553 error that looks like this:

Error communicating with your server: 553 Can't open that file: Too many levels of symbolic links

It could be that a symlink is pointing to an absolute path, or maybe there is a circular reference, where a link is pointing to itself.