Articles in this section

Unable to create a file or directory under some specific domain folder in Plesk: This directory is read-only: you can not create files or directories in it

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

    • Cannot create a file or directory under some specific domain folder, e.g. error_docs due to the following warning:

      PLESK_ERROR: 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

  • Similar error can be found in the /var/log/plesk/panel.log log file:

    CONFIG_TEXT: 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

  1. Connect to the server via SSH

  2. Execute the following command below to fix permissions and ownership automatically. Mind replacing the example.com domain name in the command below with the affected one:

    # plesk repair fs example.com

It may be required to fix permissions/ownership manually. For this follow the steps below:

Manual solution
  1. Connect to the server via SSH

  2. Execute the command below to obtain the example.com's system user. In the example below it is johndoe:

    # plesk db -N -e "select login from sys_users where home like '%example.com%' and mapped_to is NULL"
    johndoe

  3. Set the correct permissions or/and ownership to the affected folder:

    # chown johndoe:psacln /var/www/vhosts/example.com/error_docs
    # chmod 755 /var/www/vhosts/example.com/error_docs

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.