On a new site in development, I am getting 500 Errors when trying to view the logs. The Watchdog table logs:

a:6:{s:5:"%type";s:9:"TypeError";s:8:"!message";s:149:"t(): Argument #2 ($args) must be of type array, int given, called in /var/www/clients/client1/web1/web/core/modules/dblog/dblog.admin.inc on line 311";s:9:"%function";s:3:"t()";s:5:"%file";s:61:"/var/www/clients/client1/web1/web/core/includes/bootstrap.inc";s:5:"%line";i:1949;s:14:"severity_level";i:3;}

 

Accepted answer

Hi Onyx.

This may have been caused by a number of situations, but I suspect it's a faulty entry produced by a contrib module.

In order to debug, you first need to get rid of the error. To do so, you will need to manually edit the watchdog table. 

The easiest way to get rid of the error is to truncate the watchdog table (meaning you'll lose your log of errors), OR you can inspect its rows visually to find an entry in the variables column that's either empty, or malformed.

The variables column of watchdog should either "look" like a serialized array (see "a:1:{s:7..."):

or like an empty serialized array (see "a:0:{}"):

or it can contain the character "N;" in uppercase:

If you find an entry with an empty variables column or something that doesn't look like the above, remove it manually (or you can do that with automatically with a SQL query).

Once these are removed, you should be able to see the log again. Then you can troubleshoot the problem. 

It will be helpful if you posted a list of enabled contrib modules...

 

Comments

This is on both the development machine running Archlinux, PHP8.2-fpm, nginx, and on the staging server Ubuntu 22.04, nginx, php8.0-fpm.

Hi Onyx.

This may have been caused by a number of situations, but I suspect it's a faulty entry produced by a contrib module.

In order to debug, you first need to get rid of the error. To do so, you will need to manually edit the watchdog table. 

The easiest way to get rid of the error is to truncate the watchdog table (meaning you'll lose your log of errors), OR you can inspect its rows visually to find an entry in the variables column that's either empty, or malformed.

The variables column of watchdog should either "look" like a serialized array (see "a:1:{s:7..."):

or like an empty serialized array (see "a:0:{}"):

or it can contain the character "N;" in uppercase:

If you find an entry with an empty variables column or something that doesn't look like the above, remove it manually (or you can do that with automatically with a SQL query).

Once these are removed, you should be able to see the log again. Then you can troubleshoot the problem. 

It will be helpful if you posted a list of enabled contrib modules...

 

BTW, take note of the "type", "message" and "location" columns for any entry in watchdog that you remove manually. That may provide clues. 

Thanks, truncating the log means I can get to the recent log messages.

Will see if I can figure out the contrib causing the issue.

It was Ubercart Stripe fighting with Stripe

DELETE FROM `watchdog` WHERE `type`='stripe';

Cleans it up, and of course disabling Ubercart Stripe

Great. You may want to file an issue in Ubercart Stripe.