Articles in this section

Plesk backup task finishes with the warning: Cannot stat: Permission denied

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Plesk backup task finishes with one of the following messages in Plesk interface:

    PLESK_ERROR: Failed to pack files example.com_user-data_1307261006 in /var/lib/psa/dumps/domains/example.com
    /bin/tar: httpdocs/components: Cannot open: Permission denied
    /bin/tar: Exiting with failure status due to previous errors


    PLESK_WARN: Not all the data was backed up into /var/lib/psa/dumps/clients/cl_name/domains/example.com successfully.
    Mounted on: /. /bin/tar: .pki/nssdb: Cannot stat: Permission denied
    /bin/tar: Exiting with failure status due to previous errors


    PLESK_WARN: Warning: Extension "Git"
    Unable to back up extension. Error: Failed to exec backup_restore_helper: Exit code: 1: filemng failed: mkdir: cannot create directory ‘/var/www/vhosts/example.com/.ssh’: Permission denied
    filemng: Error occurred during /bin/mkdir command.


    PLESK_WARN: Warning: Subscription "example.com"
    Not all the data from /var/www/vhosts/example.com was backed up successfully:
    .cagefs/opt: Cannot open: Permission denied
    .cagefs/opt/alt: Cannot stat: Permission denied
    .cagefs/opt/alt/php56: Cannot stat: Permission denied
    .cagefs/opt/alt/php56/link: Cannot stat: Permission denied
    .cagefs/opt/alt/php56/link/conf: Cannot stat: Permission denied


    PLESK_WARN: Warning: Subscription "example.com"
    Could not back up all data from the directory '/var/www/vhosts/example.com': 
     example_chat/data/WiredTiger: Cannot open: Permission denied
     example_chat/data/WiredTiger.lock: Cannot open: Permission denied
     example_chat/data/WiredTiger.turtle: Cannot open: Permission denied
     example_chat/data/WiredTiger.wt: Cannot open: Permission denied
     example_chat/data/WiredTigerHS.wt: Cannot open: Permission denied
     example_chat/data/_mdb_catalog.wt: Cannot open: Permission denied
     example_chat/data/collection-0--3581448982217971258.wt: Cannot open: Permission denied
     example_chat/data/collection-0-1680218489838123093.wt: Cannot open: Permission denied
     example_chat/data/collection-10--3581448982217971258.wt: Cannot open: Permission denied
     example_chat/data/collection-11--3581448982217971258.wt: Cannot open: Permission denied
     example_chat/data/collection-120--3581448982217971258.wt: Cannot open: Permission denied
     example_chat/data/collection-13--3581448982217971258.wt: Cannot open: Permission denied
     example_chat/data/collection-137--3581448982217971258.wt: Cannot open: Perm... (truncated)

  • A backup restoration finishes with one of the following messages:

    PLESK_WARN: Warning: Restore hosting "example.com"
    Can not deploy content of domain example.com
    warning:
    Archive error: Unable to extract files from /var/lib/psa/dumps/domains/example.com/backup_user-data_1907081210.tgz to /var/www/vhosts/example.com: /usr/lib/plesk-9.0/sw-tar: example.com/bin/gzip: Cannot open: File exists /usr/lib/plesk-9.0/sw-tar: example.com/bin/unzip


    PLESK_WARN: Warning:
    Archive error: Unable to extract files from /var/lib/psa/dumps/domains/example.com/backup_user-data_1907311520.tgz to /var/www/vhosts/example.com: /bin/tar: httpdocs/some-picture.jpg: Cannot open: File exists /bin/tar: httpdocs/wp-content/uploads/2019/some-picture.jpg: Exiting with failure status due to previous errors

Cause

Incorrect permissions or ownership on the files and directories inside the Subscription directory prevents the Plesk backup service from backing them up or opening them.

Resolution

  1. Connect to the Plesk server via SSH.
  2. Correct the file permissions:

    # plesk repair fs example.com -y

  3. Restore the default ownership and permissions for /var/www/vhosts/example.com: according to the steps from this KB article.

     

    In case more than one domain is affected, run:

    # plesk db -Ne "select login,home from sys_users where mapped_to is null" | while read login home; do chown -R $login $home; done

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.