Skip Navigation

[Resolved] Fatal Blocks error in logs

This thread is resolved. Here is a description of the problem and solution.

Problem:

I updated PHP on my server and get the error below:

PHP message: PHP Fatal error: Uncaught TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given in

wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php:274

Solution:

The error you shared indicates one of the caches for the views is stuck in "Invalid" state.

Please go to "WordPress Dashboard > Toolset > Views", and click the "Clear Cache" button next to each view and see if it fixes the issue.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 1 year ago.

Assisted by: Christopher Amirian.

Author
Posts
#2672227

We have recently migrated this site to Kinsta, with PHP8.1

We are now seeing large numbers of instances of this error in the logs:

2023/12/09 17:53:49 [error] 31887#31887: *183716 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given in /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php:274
Stack trace:
#0 /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php(274): array_intersect('', Array)
#1 /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php(217): OTGS\Toolset\Views\Controller\Cache\Views\Invalidator->invalidate_cache_per_domain('posts', Array)
#2 /www/profilebookscom_961/public/wp-includes/class-wp-hook.php(326): OTGS\Toolset\Views\Controller\Cache\Views\Invalidator->should_invalidate_cache('')
#3 /www/profilebookscom_961/public/wp-includes/class-wp-hook.php(350): WP_Hook->apply_filters(NULL, Array)
#4 /www/profilebookscom_961/public/wp-includes/plugin.php(531): WP_Hook->do_action(Array)
#5 /www/profileb" while reading upstream, client: 136.243.228.182, server: profilebooks.com, request: "GET /work/do-parents-matter/ HTTP/2.0", upstream: "hidden link:", host: "profilebooks.com:57528"

This is affecting the work detail template, which is a Content Template e.g.

hidden link
hidden link

I've looked over the CT and the Views it contains but can't see anything problematic. Checking if this is a known issue or if you can give any indication of how we can debug it when it doesn't reference our code directly.

#2672477

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

The error you shared indicates one of the caches for the views is stuck in "Invalid" state.

Please go to "WordPress Dashboard > Toolset > Views", and click the "Clear Cache" button next to each view and see if it fixes the issue.

Thanks.

#2672511

It seems to have done, thanks. I do note that the same file is now returning a lot of PHP warnings:

2023/12/11 08:30:08 [error] 72906#72906: *306789 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $affectedSlugs in /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php on line 276PHP message: PHP Warning: Undefined property: OTGS\Toolset\Views\Controller\Cache\Views\Invalidator::$modifiedObjects in /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php on line 277PHP message: PHP Warning: Trying to access array offset on value of type null in /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php on line 277PHP message: PHP Fatal error: Uncaught TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php:277
Stack trace:
#0 /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php(277): array_intersect_key(NULL, NULL)
#1 /www/profilebookscom_961/public/wp-content/plugins/toolset-blocks/application/controllers/cache/views/invalidator.php(217): OTGS\Toolset\Views\Controller\Cache\Views\Invalidator->invalidate_cache_per_domain('posts', Array)
#2 /www/profilebookscom_961/public/wp-includes/class-wp-hook.php(324): OTGS\Toolset\Views\Controller\Cache\Views\Invalidator->should_invalidate_cache('')
#3 /www/profilebookscom_961/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#4 /www/profilebookscom_961/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /www/p" while reading upstream, client: 52.167.144.20, server: profilebooks.com, request: "GET /product/free-for-all-digital-audio-mp3/ HTTP/2.0", upstream: "hidden link:", host: "profilebooks.com:57528"