Cannot build Apache web server configuration: Invalid parameter number: no parameters were bound

Created:

2016-11-16 13:19:09 UTC

Modified:

2017-08-16 18:29:04 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Cannot build Apache web server configuration: Invalid parameter number: no parameters were bound

Applicable to:

  • Plesk 10.x for Linux
  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

The symptoms vary:

  1. The following warning is shown by the Plesk Pre-Upgrade Checker:

    WARNING: Reference between several subscriptions and APS applications has been broken.
  2. The following error is displayed while making changes to the configuration of Plesk objects that assume Apache web server reconfiguration:

    Error: New files of configuration for Apache web server were not built due to errors in configuration templates. The detailed error message was e-mailed to you, so please check the e-mail, fix the errors, and click here to retry generating configuration.
  3. Backup creation fails with an error:

    Unable to get APS instances on webspace id 123 (ErrorCode: 255, STDOUT:).

Resolution

Fix the broken database references:

  1. Create a psa database dump:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin psa > /var/lib/psa/dumps/psadump.kb112815.`date "+%Y-%m-%d_%H:%M"`.sql

    Then, log in to the Plesk database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa
  2. List configuration errors in Plesk database:

        mysql> select id,objectId,status,description from Configurations where status="error";
    +-----+----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | id | objectId | status | description |
    +-----+----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | 5 | 1 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
    | 195 | 96 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
    | 205 | 101 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
    | 835 | 434 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
    | 837 | 435 | error | Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound |
    +-----+----------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  3. List broken contexts of APS applications ( subscriptionId should be the same as MainSubscriptionId or AdditionalSubscriptionId ):

    mysql> select aps.id, pleskId, subscriptionId, s.id as MainSubscriptionId, su.id as AddSubscriptionId from apsContexts aps left join domains d on d.id=aps.pleskId left join domains w on w.id = d.webspace_id left join Subscriptions s on s.object_id=d.id left join Subscriptions su on su.object_id = w.id where (subscriptionId!=s.id and su.id is null) or (subscriptionId!=su.id and s.id is null) or aps.subscriptionId is null;

    +----+---------+----------------+--------------------+-------------------+
    | id | pleskId | subscriptionId | MainSubscriptionId | AddSubscriptionId |
    +----+---------+----------------+--------------------+-------------------+
    | 2 | 1 | 0 | 1 | NULL |
    | 3 | 96 | 96 | 75 | NULL |
    | 4 | 101 | 101 | 79 | NULL |
    | 5 | 434 | 0 | NULL | 75 |
    | 6 | 435 | NULL | NULL | 75 |
    +----+---------+----------------+--------------------+-------------------+
    5 rows in set (0.00 sec)
  4. Modify the broken contexts:

    mysql> update apsContexts set subscriptionId=1 where pleskId=1;
    Query OK, 1 row affected (0.01 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    mysql> update apsContexts set subscriptionId=75 where pleskId=96;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    mysql> update apsContexts set subscriptionId=79 where pleskId=101;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    mysql> update apsContexts set subscriptionId=75 where pleskId=434;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    mysql> update apsContexts set subscriptionId=75 where pleskId=435;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 0
  5. Recreate all Apache configuration files:

    # /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Have more questions? Submit a request
Please sign in to leave a comment.