Articles in this section

Unable to manage, create ZIP or back up files uploaded by PHP scripts in Plesk: Unable to get the object security info: (5) Access is denied

kb: bug Plesk for Windows kb: fixed ABT: Group A

Applicable to:

  • Plesk for Windows

Symptoms

  • It is not possible to upload / edit / change permissions to files or rename them in Plesk at Domainsexample.com > File Manager or download file by FTP under the user account. The following error appears:

    PLESK_ERROR: Internal error: filemng failed: Unable to get the object (C:\Inetpub\vhosts\example.com\httpdocs\test.html) security info: (5) Access is denied. at execute "C:\Program Files (x86)\Plesk\admin\bin\filemng.exe" user --permissions --list-common "--file=C:\Inetpub\vhosts\example.com\httpdocs\test.html" "--accounts=tmp54B2.tmp"(RunTime::RunAsUser::run line 221) (Error code 1)

  • A backup of a website based on WordPress finishes with the warning:

    CONFIG_TEXT: Warning: domain "example.com"
    Unable to get attributes of the file C:\Inetpub\vhosts\example.com\httpdocs\wp-content\uploads\2018\07\12.png: Access is denied. The file will not be archived. [:121566464]

  • When trying to Add Files to Archive from Domains > example.com > File Manager, the following error is shown making reference to all the files that were uploaded via PHP:

    PLESK_ERROR: Unable to create the archive:
    7-zip 18.05 (x86): Copyright (c) 1999-2018 Igor Pavlov: 2018-04-30
    Scanning the drive: 1913 folders, 10397 files, 258441467 bytes (247 MiB) Creating archive:
    C:\Inetpub\vhosts\example.com\httpdocs\backup.zip Add new data to archive: 1913 folders, 10397 files, 258441467 bytes (247 MiB)
    WARNING: Access is denied. wp-content\uploads\2019\04\01.png: Access is denied.
    ...

Cause

Product issues:

  • #PPP-49179 "The outdated PHP handlers (versions 5.6 and 7.0) no longer contain custom upload_tmp_dir as their values."
    Fixed in:
  • #PPPM-4539 "Files uploaded via WordPress are now assigned the correct file system permissions."
    Fixed in:

Resolution

Upgrade the Plesk server to the next release, make sure that FastCGI Settings are enabled in the domain PHP Settings:

Note: Check how to enable the FastCGI settings per Service Plan

  1. Log in to Plesk GUI

  2. Go to Domains > example.com > PHP Settings > Select a PHP version handled by FastCGI > Scroll down to FastCGI Settings > Set the option Enable FastCGI Settings to On > Click OK to apply the changes

Workaround

 

Fixing permissions in order to access files via Plesk File Manager / FTP

 

  1. Connect to the server via RDP

  2. Start a command prompt as an Administrator

  3. Run the command:

    C:\> plesk bin repair --repair-webspace-security -webspace-name example.com -all-filesystem-objects

 

Fixing permissions before creating a manual server Plesk backup

 

  1. Connect to the server via RDP

  2. Start a command prompt as an Administrator

  3. Fix file permissions:

    • For one domain

      C:\> plesk bin repair --repair-webspace-security -webspace-name example.com -all-filesystem-objects

    • For all domains

      C:\> for /f %i in ('plesk bin subscription -l') do plesk bin repair --repair-webspace-security -webspace-name %i -all-filesystem-objects

  4. Create a full Plesk backup.

 

Fixing permissions before creating scheduled server Plesk backups

 

Warning: The following workaround must be applied every time after applying the changes at Tools & Settings > Backup Manager > Schedule, because the task is overwritten.

  1. Log in to Plesk GUI and schedule a full server backup:

    1.1. Go to at Tools & Settings > Backup Manager > Schedule >

    1.2. Enable Activate this backup task.

    1.3. Disable Use incremental backup.

    1.4. Click OK.


    Screenshot_2019-11-02_Scheduled_Backup_Settings_-_Plesk_Onyx_17_8_11.png

  2. Connect to the server via RDP

  3. Start a command prompt as an Administrator

  4. Run the following command to create a script that will automatically fix file permissions:

    C:\> echo for /f %%i in ('plesk bin subscription -l') do plesk bin repair --repair-webspace-security -webspace-name %%i -all-filesystem-objects > C:\pleskrepair.cmd

  5. Create a new task:

    5.1. Start Task Scheduler.

    5.2. Expand Task Scheduler Library and select the task Plesk Scheduler Task #Domain Backup Scheduler 1.

    5.3. Click Properties on the right.


    1.PNG

  6. On the General tab, set Configure for to the latest task type available:


    2.PNG

  7. Switch to the Actions tab and click New....


    3.PNG

  8. Configure the task:

    8.1. Set Action as Start a program.

    8.2. In the Program/script field, specify the location of the script created on step 4 - C:\pleskrepair.cmd.

    8.3. Click OK.


    4.PNG

  9. Increase the priority of the script task, so it will run before server backup task:

    9.1. Select the new action.

    9.2. Click the 6.png button.

    9.3. Click OK.


    5.PNG

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.