Articles in this section

WP Toolkit provides an error: Could not fetch the list of WordPress installations: Can not find domain by id 123

kb: bug Plesk for Windows kb: fixed Plesk for Linux ext: wptk

Applicable to:

  • Plesk for Linux
  • Plesk for Windows 

Symptoms

  • WP Toolkit was updated in Plesk to the 5.12.0-6510 version.

  • WordPress menu in Plesk becomes inaccessible with:

    PLESK_ERROR: Server Error
    500 PleskExt\WpToolkit\Api\Exceptions\InternalServerErrorException
    Could not fetch the list of WordPress installations: Can not find domain by id 123
    Type PleskExt\WpToolkit\Api\Exceptions\InternalServerErrorException
    Message Could not fetch the list of WordPress installations: Can not find domain by id 123
    File InstallationsPrototypeController.php
    Line 136

  • Domain with ID 123 is missing in Plesk GUI and in the psa database:

    # plesk db "select * from domains where id=123"
    Empty Output

Cause

Product issue:

  • #EXTWPTOOLK-9555 "WP Toolkit no longer breaks down with InternalServerError in case of internal database inconsistency."
    Fixed in:

Resolution

Please consider updating your server:

Workaround

Update WP Toolkit to the latest version:

Workaround

For Linux
  1. Connect to the server via SSH.

  2. Create a dump of the psa database:

    CONFIG_TEXT: plesk db dump psa > psa.sql

  3. Remove leftovers from the Plesk database:

    # plesk db "truncate longtasks"
    # plesk db "truncate longtaskparams"

  4. For security reasons, create a backup of the WP Toolkit database:

    # cp -p /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3{,.backup}

  5. Access the WP Toolkit database in SQLite:

    # sqlite3 /usr/local/psa/var/modules/wp-toolkit/wp-toolkit.sqlite3

  6. Enable headers:

    MYSQL_LIN: sqlite> .headers on

  7. Get a WordPress instance ID using the domain ID from the error message. In this example, domainId is 123:

    MYSQL_LIN: sqlite> select id from Instances where domainId=123;
    id
    66

    Note: There might be several instances, make sure to execute the next step for each of them.

  8. Remove all corresponding information:

    • Using the domain ID:

      MYSQL_LIN: sqlite> DELETE FROM Instances where domainId=123;

    • And using the instance ID obtained on step 7:

      MYSQL_LIN: sqlite> DELETE FROM InstanceProperties WHERE instanceId=66;
      sqlite> DELETE FROM InstancesDomains WHERE instanceId=66;
      sqlite> DELETE FROM Instances where id=66;

  9. Exit SQLite:

    MYSQL_LIN: sqlite> .quit

For Windows
  1. Connect to the server via RDP.

  2. Start a command prompt as an Administrator.

  3. Create a dump of the psa database:

    C:\> plesk db dump psa > C:\psa.sql

  4. Remove leftovers from the Plesk database:

    C:\> plesk db "truncate longtasks"
    C:> plesk db "truncate longtaskparams"

  5. Download a bundle of command-line tools for managing SQLite database files and extract the file sqlite3.exe.

  6. Copy the sqlite3.exe file to the %plesk_dir%var\modules\wp-toolkit folder.

  7. Open the %plesk_dir%var\modules\wp-toolkit folder in the File Explorer and create a copy of the WP Toolkit database wp-toolkit.sqlite3.

  8. Start sqlite3.exe located in %plesk_dir%var\modules\wp-toolkit and access the WP Toolkit database using the command:

    C:\> sqlite> .open wp-toolkit.sqlite3

  9. Enable headers:

    C:\> sqlite> .headers on

  10. Get a WordPress instance ID using the domain ID from the error message. In this example, domainId is 123:

    C:\> sqlite> select id from Instances where domainId=123;
    id
    66

    Note: There might be several instances, make sure to execute the next step for each of them.

  11. Remove all corresponding information:

    • Using the domain ID:

      MYSQL_LIN:sqlite> DELETE FROM Instances where domainId=123;

    • And using the instance ID obtained on step 10:

      MYSQL_LIN:sqlite> DELETE FROM InstanceProperties WHERE instanceId=66;
      sqlite> DELETE FROM InstancesDomains WHERE instanceId=66;
      sqlite> DELETE FROM Instances where id=66;

  12. Close the sqlite3.exe window.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.