Troubleshooting the Database

If you encounter errors or issues while working with the database for your WHMCS installation, see the sections below to start troubleshooting and resolve the issue.

General Issues

You may encounter the following common issues:


Error or IssueCauseNext Steps
TypeError: Argument 1 passed to Illuminate\Database\Connection::prepared() must be an instance of PDOStatement, bool given or TypeError: Argument 1 passed to WHMCS\Database\MysqlCompat::setLastStatement() must be an instance of PDOStatement or null, boolThesystem is logging a large amount of data to the MySQL® database or the wait_timeout and interactive_timeout variables in the MySQL server configuration are too low to complete the request.Argument PDOStatement Errors
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'table_whmcs7.tbldomainpricing_premium' doesn't exist or Unable to complete incremental updatesA required table is missing from the WHMCS MySQL® database.Base Table or View Not Found Errors
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'group_id' cannot be null (SQL: insert into tblproducts_slugs (group_id, group_slug, slug, active, product_id, updated_at, created_at) values (?, ?, , 1, 1, 2021-09-30 10:24:30, 2021-09-30 10:24:30))There are orphaned products in the database (products which are not in a valid product group).Column group_id Null Errors
Unable to complete incremental updatesThe MySQL® user has insufficient privileges.Command Denied Errors
Could not connect to databaseThe cron.php script cannot access your MySQL® database.Could Not Connect Errors
During the daily automation cron run, the script takes a long time to complete, especially during the Executing System Queue step.Processing times have increased due to the size of your WHMCS database.Cron System Queue Timeout
InvalidArgumentException: Dataset must be an array in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/TableQuery.php:0 Stack trace: #0 /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/TableModel.php(0): WHMCS\TableQuery->setData(NULL)The $mysql_charset value is incorrect in the configuration.php file.Dataset Must Be Array Errors
Oops! ERROR: WHMCS\Exception\InvalidDomain: The domain is invalid. in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/Domains/Idna.php:0The tbldomains.domain field in your MySQL® database contains an invalid character.Domain Management Oops! Errors
Down for Maintenance (Err2)There is a mismatch between the database version and WHMCS version or PHP version.Down for Maintenance Errors
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' in /path/to/whmcs/vendor/illuminate/database/Connection.phpThe primary key and auto_increment attributes are absent from one or more tables in the WHMCS database.Duplicate Entry Errors
Oops! Something went wrong and we couldn't process your request. or SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'tblconfiguration.PRIMARY'You have initiated the installation process twice simultaneously.Duplicate tblconfiguration Errors
Field xxx doesn't have a default valueYou attempted to install WHMCS with MySQL Strict Mode enabled.Field Default Value Errors
MySQL server has gone awayThe MySQL® server is closing the connection that WHMCS is using for the current task.MySQL Server Gone Away Errors
Order Not Found...Exiting...WHMCS cannot write to the MySQL® database.Order Not Found Errors
Error: SQLSTATE[HY000]: General error: 3988 Conversion from collation utf8mb3_unicode_ci into latin1_swedish_ci impossible for parameter (SQL: insert into tblticketmaillog...MySQL® cannot convert the table in the error message into the indicated character set.POP3 General Error 3988 Errors
Critical Error - Unable to connect to the databaseThe system cannot connect to your database.Unable to Connect Errors

Database Backups

For more information, see Database Backups.

You may encounter the following common issues:


Error or IssueCauseNext Steps
(S)FTP Backup - Uploading FailedThe connection to the FTP server succeeded but the system could not navigate to the destination directory or did not have write permissions.(S)FTP Backup Upload Errors
(S)FTP: Unable to open for writingWHMCS cannot open a test file in the PHP system directory.(S)FTP Unable to Open Errors
(S)FTP: Unable to write to temp fileWHMCS cannot write to a test file in the PHP system directory.(S)FTP Unable to Write Errors
SFTP Backup - Login FailedThe system reached the FTP server but it rejected the login details.SFTP Backup Login Errors

Last modified: 2025 February 6