Troubleshooting an Argument 1 passed ... must be an instance of PDOStatement Error
When performing MySQL®-intensive actions, you may see the following errors:
TypeError: Argument 1 passed to Illuminate\Database\Connection::prepared() must be an instance of PDOStatement, bool given
TypeError: Argument 1 passed to WHMCS\Database\MysqlCompat::setLastStatement() must be an instance of PDOStatement or null, bool
These generally occur during the daily automation cron tasks, when importing TLDs and pricing, or when syncing accounts into WHMCS from a server.
This may be due to the following causes:
- The Module Log is enabled and the system is logging a large amount of data to the MySQL database.
interactive_timeoutvariables in the MySQL server configuration are too low to complete the request.
We recommend disabling the Module Log unless you are actively troubleshooting a module-related issue. We also recommend using the the default values for the
interactive_timeout variables in the MySQL server configuration.
To disable the Module Log:
1. Go to Configuration > System Logs.
2. Click Module Log in the left-side menu.
3. Click Disable Debug Logging.
For assistance with this change, contact your hosting provider or system administrator.
To update the
interactive_timeout values to use their defaults:
1. Open your MySQL server's
2. Find the
[mysqld] wait_timeout=28800 interactive_timeout=28800
4. Save the changes to the file.
5. Restart your MySQL server by running the following command:
service mysql restart