Internal error: Failed to parse metadata, File aps_php.php

Created:

2016-11-16 12:48:07 UTC

Modified:

2017-04-24 11:22:22 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Internal error: Failed to parse metadata, File aps_php.php

Applicable to:

  • Plesk 10.4 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Windows
  • Plesk 11.5 for Linux
  • Plesk

Symptoms

  1. The Domain Control Panel cannot be opened. It fails with the following error:

    Internal error: Failed to parse metadata

    Message Failed to parse metadata
    File aps_php.php
    Line 12559
    Type Exception
  2. APS package settings cannot be checked:

    # /usr/local/psa/bin/aps --get-packages-global-settings
    Failed to parse metadata

    OR

    # /usr/local/psa/bin/aps --get-packages-global-settings
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): Entity: line 7: parser error : Char 0x0 out of allowed range; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ^; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): Entity: line 7: parser error : Char 0x0 out of allowed range; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ^; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): Entity: line 7: parser error : ParsePI: PI php never end ...; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ^; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): Entity: line 7: parser error : Start tag expected, '<' not found; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ; File: /usr/share/aps_php/aps_php.php, Line: 10024
    PHP Warning: aps_registry_packageconfiguration_getglobalsettings(): ^; File: /usr/share/aps_php/aps_php.php, Line: 10024
    Failed to parse metadata
  3. It is not possible to install application

  4. Unable to clear cache at Tools & Settings > Application Vault > Clear Cache on Plesk:

    Internal error: Cannot find package cache directory: '/usr/local/psa/var/apspackages/apscatalog7R2ZJ5.zipb17fa7a9-c64e-c0' 
    Message Cannot find package cache directory: '/usr/local/psa/var/apspackages/apscatalog7R2ZJ5.zipb17fa7a9-c64e-c0'
    File Content.php
    Line 73
    Type CommonPanel_Aps_Cache_Exception

Cause

The issue occurs because the 'metafile_uri' directory (from the apsc.aps_package table) is missing on the server or the APP-META.xml file is corrupted.

Resolution

  1. Clear the Apps cache: Tools & Settings > Application Vault > Clear Cache

  2. Create the reported directory if unable to clear cache and retry:

    # mkdir /usr/local/psa/var/apspackages/apscatalog7R2ZJ5.zipb17fa7a9-c64e-c0
    # chown -R psaadm:psaadm /usr/local/psa/var/apspackages/apscatalog7R2ZJ5.zipb17fa7a9-c64e-c0
  3. Login to the MySQL server:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin apsc
  4. Determine metafile_uri path by using the following sql query:

    mysql> select `id`, `name`, `version`, `release`, `metafile_uri` from apsc.aps_package;
    +-----+-----------+---------+---------+----------------------------------------------------------------------------------+
    | id | name | version | release | metafile_uri |
    +-----+-----------+---------+---------+----------------------------------------------------------------------------------+
    | 66 | WordPress | 2.3.3 | 5 | /usr/local/psa/var/apspackages/556229a0-5008-41b5-83d1-3c0b32649196/APP-META.xml |
    | 77 | WordPress | 3.3.1 | 4 | /usr/local/psa/var/apspackages/2abd12d2-7017-46ee-a80b-ed42599f7c0a/APP-META.xml |
    | 106 | WordPress | 3.5.2 | 2 | /usr/local/psa/var/apspackages/c22666c4-b469-4eb2-a0e7-7c6f3f4f11eb/APP-META.xml |
    +-----+-----------+---------+---------+----------------------------------------------------------------------------------+
    3 rows in set (0.00 sec)
  5. Make sure that the 'metafile_uri' directories exist on the server. Directories should exist as below:

    # ls -la /usr/local/psa/var/apspackages/c22666c4-b469-4eb2-a0e7-7c6f3f4f11eb/APP-META.xml
    -rw-r--r-- 1 psaadm psaadm 50828 Mar 12 21:23 /usr/local/psa/var/apspackages/c22666c4-b469-4eb2-a0e7-7c6f3f4f11eb/APP-META.xml
    # ls -la /usr/local/psa/var/apspackages/556229a0-5008-41b5-83d1-3c0b32649196/APP-META.xml
    -rw-r--r-- 1 psaadm psaadm 21506 Mar 12 21:23 /usr/local/psa/var/apspackages/556229a0-5008-41b5-83d1-3c0b32649196/APP-META.xml
    # ls -la /usr/local/psa/var/apspackages/2abd12d2-7017-46ee-a80b-ed42599f7c0a/APP-META.xml
    -rw-r--r-- 1 psaadm psaadm 21706 Mar 12 21:23 /usr/local/psa/var/apspackages/2abd12d2-7017-46ee-a80b-ed42599f7c0a/APP-META.xml
  6. Make sure that all the APP-META.xml files are readable:

    # head /usr/local/psa/var/apspackages/a1a41e6f-f5ae-4f80-8e30-788a0a418196/APP-META.xml
    <application packaged="2014-12-19T14:05:21" version="1.2" xmlns="http://apstandard.com/ns/1">
    <id>http://wordpress.org/</id>
    <name>WordPress</name>
    <version>4.1</version>
    <release>74</release>
    <homepage>http://wordpress.org/</homepage>

    <vendor>
    <name>WordPress.org</name>
    <homepage>http://wordpress.org/</homepage>

If it is not readable or binary, remove and recreate the package folder as listed below.

  1. If the 'metafile_uri' directory is missing, create it:

    #mkdir /usr/local/psa/var/apspackages/c22666c4-b469-4eb2-a0e7-7c6f3f4f11eb
    #mkdir /usr/local/psa/var/apspackages/556229a0-5008-41b5-83d1-3c0b32649196
    #mkdir /usr/local/psa/var/apspackages/2abd12d2-7017-46ee-a80b-ed42599f7c0a
  2. Download APS packages with the corresponding name and version from dev.apsstandard.org to the directories created in the previous step. If your WordPress version is not present on the above mentioned page, visit apscatalog.com .

  3. Extract the zip file in the same directory. For example:

    ls -la /usr/local/psa/var/apspackages/2abd12d2-7017-46ee-a80b-ed42599f7c0a/

    drwxr-xr-x 5 psaadm psaadm 4096 Jan 17 2013 ./
    drwxr-xr-x 15 psaadm psaadm 4096 Sep 5 04:34 ../
    -rw-r--r-- 1 psaadm psaadm 13434 Jan 17 2013 APP-META.xml
    drwxr-xr-x 2 psaadm psaadm 4096 Jan 17 2013 htdocs/
    drwxr-xr-x 2 psaadm psaadm 4096 Jan 17 2013 images/
    drwxr-xr-x 2 psaadm psaadm 4096 Jan 17 2013 scripts/
  4. Change permissions to psaadm on the package folder recursively:

    # chown -R psaadm:psaadm /usr/local/psa/var/apspackages/2abd12d2-7017-46ee-a80b-ed42599f7c0a/
Have more questions? Submit a request
Please sign in to leave a comment.