johnbillion / query-monitor

The developer tools panel for WordPress
https://querymonitor.com
GNU General Public License v2.0
1.59k stars 208 forks source link

PHP Fatal error: Uncaught TypeError: preg_match() expects parameter 2 to be string #723

Closed floatnz closed 1 year ago

floatnz commented 1 year ago

After upgrading to the latest version at the time (3.11.1) we are seeing the following error in logs:

[06-Feb-2023 09:01:06 UTC] PHP Fatal error:  Uncaught TypeError: preg_match() expects parameter 2 to be string, null given in /var/www/html/wp-content/plugins/query-monitor/collectors/request.php:312
Stack trace:
#0 /var/www/html/wp-content/plugins/query-monitor/collectors/request.php(312): preg_match('#^^wc-auth/v([1...', NULL)
#1 /var/www/html/wp-content/plugins/query-monitor/classes/Collectors.php(84): QM_Collector_Request->process()
#2 /var/www/html/wp-content/plugins/query-monitor/classes/Dispatcher.php(108): QM_Collectors->process()
#3 /var/www/html/wp-content/plugins/query-monitor/dispatchers/Html.php(352): QM_Dispatcher->get_outputters('html')
#4 /var/www/html/wp-content/plugins/query-monitor/dispatchers/Html.php(316): QM_Dispatcher_Html->before_output()
#5 /var/www/html/wp-includes/class-wp-hook.php(287): QM_Dispatcher_Html->dispatch('')
#6 /var/www/html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#7 /var/www/html/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#8 /var/www/html/wp-includes/load.php(1052): do_a in /var/www/html/wp-content/plugins/query-monitor/collectors/request.php on line 312

It seems to occur after logging in as admin, then being redirected; I've seen it once myself but am having trouble replicating it at will. I've searched google and the usual places.

Is this a know issue?

image-20230208-004608

johnbillion commented 1 year ago

Closing as a duplicate of #724