Symptoms
-
Cannot create any file or directory under some specific domain folder, e.g.
error_docs
, due to the following warning:Warning: Add a file to: / error_docs
This directory is read-only: you can not create files or directories in it. -
The following error appears in an attempt to modify files inside the `error_docs` folder:
PLESK_ERROR: Server Error 500 PleskUtilException
filemng failed: file: error occurred during /bin/mkdir command -
The next rows can be found in the
/var/log/plesk/panel.log
file:stdout:
mkdir: cannot create directory ‘/var/www/vhosts/example.com/error_docs/test_folder’: Permission denied
filemng: Error occurred during /bin/mkdir command.
Cause
Incorrect permissions or/and ownership on the affected folder.
Resolution
Warning: the root access to the server is required in order to apply the solution.
-
Connect to the server via SSH.
-
Execute the following command:
Note: change the “example.com” domain in the command below to the correct one.
# plesk repair fs example.com
-
If the issue still occurs, run the next command to get the domain system user:
Note: change the “example.com” domain in the command below to the correct one.
# plesk db -N -e “select login from sys_users where home like ‘%example.com%'”
johndoe -
Set the correct permissions or/and ownership to the affected folder:
Note: change the “johndoe” system user in the command below to the correct one gotten in the output on the previous step.
Change the “example.com” domain in the command below to the correct one.
Change the “error_docs” folder in the command below to the coorect folder.
# chown john.doe:psacln /var/www/vhosts/example.com/error_docs
# chmod 755 /var/www/vhosts/example.com/error_docs