Articles in this section

Plesk is not available: Unknown database 'apsc'

Plesk for Linux kb: technical ext: migrator ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • Plesk shows one of the following errors:

    PLESK_ERROR: ERR [panel] Exception: ODBC error #HY000: [unixODBC][MySQL][ODBC 5.3(w) Driver]Unknown database 'apsc'
    file: /usr/share/aps_php/aps_php.php
    line: 11933
    code: 0


    PLESK_ERROR: New files of configuration for Apache web server were not built due to errors in configuration templates:
    Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = [unixODBC][MySQL][ODBC 3.51 Driver]Unknown database 'apsc'.

  • Provisioning subscription from OBAS to Plesk may fail with the following error on OBAS side:

    CONFIG_TEXT: Process provisioning for document; Error occurred while fetching components list and network settings from Plesk node: Failed to get Site Applications from Plesk Node.

  • Migration may fail with the following error message:

    PLESK_ERROR: An error occurred during importing package: ODBC error #HY000: [unixODBC][MySQL][ODBC 5.1 Driver]Access denied for user 'psaadm'@'localhost' (using password: NO)

  • Tools & Settings > Diagnose & Repair shows:

    CONFIG_TEXT: Connection to APSC DB is not possible: ODBC error #42S02: [ma-3.0.8][10.1.44-MariaDB-0ubuntu0.18.04.1]Table 'apsc.aps_package' doesn't exist

  • The backup operations finish with the same error.

Cause

The APS Controller database apsc does not exist on the server.

Resolution

There are 3 ways to restore apsc database:

Solution #1

Find the latest apsc database backup and restore it as described in the article here. For example:

  1. Find the latest backup:

    # ls -lt /var/lib/psa/dumps/ | grep apsc | head -1
    -rw------- 1 root root 4118 Mar 6 02:02 mysql.preupgrade.apsc.17.8.11-17.8.11.20181210-052236.dump.gz

  2. Unpack the archive with the backup:

    # gunzip /var/lib/psa/dumps/mysql.preupgrade.apsc.17.8.11-17.8.11.20181210-052236.dump.gz \

  3. Restore the database from the backup:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -f -uadmin apsc < /var/lib/psa/dumps/mysql.preupgrade.apsc.17.8.11-17.8.11.20181210-052236.dump

Solution #2

If there are no backups of the database found in /var/lib/psa/dumps/, repair database with bootstrapper.sh script:

# /usr/local/psa/bootstrapper/ppXX.X.XX-bootstrapper/bootstrapper.sh repair

Note: Change XX.X.XX to comply with the current Plesk version installed.

Solution #3

In case the above solution does not work, create an empty apsc database and register it in Plesk using secure password:

  1. Create the database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin -e"CREATE DATABASE apsc"

  2. Upload the default data from scheme:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin apsc < /usr/local/psa/bootstrapper/ppXX.X.XX-bootstrapper/db/apsc_mysql_db.sql \

    Note: Change XX.X.XX to comply with the current Plesk version installed.

  3. Register the database:

    # /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/scripts/register_apsc_database.php --register -host localhost -port 3306 -database apsc -login apsc -password "****"

 
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.