Symptoms
Accessing the WP Toolkit User Interface via "WHM / Plugins / WP Toolkit" returns the following error:
Error: Request failed with status code 403
Description
This error is typically an indicator that the WP Toolkit SQLite3 database is corrupt or missing data.
To verify this, you'll need to search the main log for the following error:
[root@server ~]# grep "database disk image is malformed" /usr/local/cpanel/3rdparty/wp-toolkit/var/logs/main*.log | tail -n1
Next Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 11 database disk image is malformed in /usr/local/cpanel/3rdparty/wp-toolkit/lib/zf1/library/Zend/Db/Statement/Pdo.php:61
Workaround
You can ensure that all of the required tables are present, which can be done with the following command:
[root@server ~]# /usr/local/cpanel/3rdparty/bin/sqlite3 /usr/local/cpanel/3rdparty/wp-toolkit/var/wp-toolkit.sqlite3 ".tables"
InstanceProperties PluginVersions SmartUpdateRunStatistics
Instances Plugins StatisticsMeasurements
InstancesDomains PluginsInstances ThemeVersions
JwtRefreshTokens RemoteInstanceLogItems Themes
JwtSignKeys RemoteServers ThemesInstances
LongTaskParams ScheduledTasks UserSettings
LongTaskUser Sets Users
LongTasks SetsPlugins settings
PhinxMigrations SetsThemes version
If no output is available, a table is missing, or the database is corrupt, you'll need to reinstall the WP Toolkit and recreate the database.
To reinstall WP Toolkit, you will need to reinstall the wp-toolkit-cpanel RPM, which can be done with the following command:
- On CloudLinux, AlmaLinux, or Rocky Linux servers:
yum reinstall -y wp-toolkit-cpanel
- On Ubuntu servers:
apt-get install wp-toolkit-cpanel --reinstall
Once the above command is completed the WP Toolkit User Interface will function as expected.