"SQLSTATE[HY093]: Invalid parameter number: no parameters were bound"

Created:

2016-11-16 12:55:26 UTC

Modified:

2017-06-05 06:13:24 UTC

0

Was this article helpful?


Have more questions?

Submit a request

"SQLSTATE[HY093]: Invalid parameter number: no parameters were bound"

Applicable to:

  • Plesk for Linux

Symptoms

You see the following error message on the Parallel Plesk Panel homepage:

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.

When you check this information in the Parallel Plesk Panel database, you see the following:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Nse"select * from Configurations where status='error' \\G"

id: <some id>
name: domainVhost
file:
version: <some.version>
objectType: domain
objectId: <needed ID>
status: error
description: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = SQLSTATE[HY093]: Invalid parameter number: no parameters were bound

Resolution

Note: Plesk Panel has domains and subdomains; the resolution depends on these.

For domain:

  1. Get the objectID of the issuing domain:

    mysql> select objectId from Configurations where status='error';
    +----------+
    | objectId |
    +----------+
    | 129 |
    +----------+
  2. Find the domain's name ( parentDomainId should be "0"):

    mysql> select id,name,parentDomainId from domains where id=129;
    +-----+----------------+----------------+
    | id | name | parentDomainId |
    +-----+----------------+----------------+
    | 129 | example.com | 0 |
    +-----+----------------+----------------+
    1 row in set (0.00 sec)
  3. Use domains.id (129) as the Subscriptions.object_id . Get the subscription ID for the specified domain:

    mysql> select id, object_id from Subscriptions where object_id=129 and object_type='domain';
    +----+-----------+
    | id | object_id |
    +----+-----------+
    | 45 | 129|
    +----+-----------+
    1 row in set (0.00 sec)
  4. Check whether this subscription has entries in the apsContext table:

    mysql> SELECT `apsContexts`.* FROM `apsContexts` AS `apsContexts` WHERE (`pleskType` = 'hosting' AND `pleskId` = 129);
    +----+-----------+-----------+-------+----------------+
    | id | pleskType | pleskId | ssl | subscriptionId |
    +----+-----------+-----------+-------+----------------+
    | 11 | hosting |129 | false | 0 |
    +----+-----------+-----------+-------+----------------+
  5. Finally, add the correct subscription ID to the aspContexts table:

    mysql> update apsContexts set subscriptionId=45 where pleskId=129;

For subdomain:

  1. Get the objectID of the issuing domain:

    mysql> select objectId from Configurations where status='error';
    +----------+
    | objectId |
    +----------+
    | 131 |
    +----------+
  2. Find the domain's name ( parentDomainId should NOT be "0"):

    mysql> select id,name,parentDomainId from domains where id=131;
    +-----+-----------------------+----------------+
    | id | name | parentDomainId |
    +-----+-----------------------+----------------+
    | 131 | subdomain.example.com | 59 |
    +-----+-----------------------+----------------+
    1 row in set (0.00 sec)
  3. Use domains.parentDomainId (59) as the Subscriptions.object_id . Get the subscription ID for the specified domain:

    mysql> select id, object_id from Subscriptions where object_id=59 and object_type='domain';
    +----+-----------+
    | id | object_id |
    +----+-----------+
    | 46 | 59 |
    +----+-----------+
    1 row in set (0.00 sec)
  4. Check whether this subscription has entries in the apsContext table:

    mysql> SELECT `apsContexts`.* FROM `apsContexts` AS `apsContexts` WHERE (`pleskType` = 'hosting' AND `pleskId` = 131);
    +----+-----------+-----------+-------+----------------+
    | id | pleskType | pleskId | ssl | subscriptionId |
    +----+-----------+-----------+-------+----------------+
    | 12 | hosting |131 | false | 0 |
    +----+-----------+-----------+-------+----------------+
  5. Finally, add the correct subscription ID to the aspContexts table:

    mysql> update apsContexts set subscriptionId=46 where pleskId=131;

Then you will need to create a new Apache configuration using the hyperlink in the Parallel Plesk Panel error message.

Have more questions? Submit a request
Please sign in to leave a comment.