Support » Plugin: Jetpack - WP Security, Backup, Speed, & Growth » Fatal error: Uncaught Exception: Serialization of ‘Closure’ is not allowed

  • Hello,
    I have the following error showing in the WordPress admin. WooCommerce is active.

    Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed in /wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php:56 Stack trace: #0 /wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php(56): serialize(Array) #1 /wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-listener.php(335): Automattic\Jetpack\Sync\Queue->add(Array) #2 /wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-listener.php(199): Automattic\Jetpack\Sync\Listener->enqueue_action('jetpack_sync_ca...', Array, Object(Automattic\Jetpack\Sync\Queue)) #3 /wp-includes/class-wp-hook.php(287): Automattic\Jetpack\Sync\Listener->action_handler('theme_support' in /wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 56

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support MadHatter (a11n)

    (@madhattersez)

    Hello, Jochen.

    Would you be able to try disabling all other plugins except for Jetpack and the core WooCommerce plugin to see if the issue continues? If everything looks normal while doing so, then you can switch on each other plugin one by one until you see the problem happen again.

    If you still see the issue even with all other plugins disabled, could you also try switching out your theme for a more minimalistic one (such as Twenty Nineteen) to make sure this isn’t some sort of theme conflict?

    Please let us know the results of the above troubleshooting and we can go from there – please include the site you’re working with if you’re comfortable with sharing that here. Thanks!

    Thread Starter Jochen Gererstorfer

    (@gmmedia)

    Hello,
    I can’t do that.
    The error only occurs from time to time. That would take ages.

    Jochen

    Plugin Contributor Dan (a11n)

    (@drawmyface)

    Hi Jochen

    Could you please post your site URL here so that we can have a look?

    If you want it to remain private, you can also contact us via this contact form. If you choose to reach out directly, please include a link to this thread.

    Thanks!

    Thread Starter Jochen Gererstorfer

    (@gmmedia)

    Hello,
    I have used the contact from. Thank you!

    Jochen

    /closed

    Hello Jochen,

    The error only occurs from time to time. That would take ages.

    That means this error only happens sometimes and you do not know the exact steps to replicate it?

    Actually, we had a similar report a few years ago but we need to close it as we were not able to replicate it. https://github.com/Automattic/jetpack/issues/7252

    Also, it’s important to run the test mentioned by MadHatter above? We’d like to rule out any conflict with other plugins. In case, your site is a production site, you can use this plugin to create a staging site, and run tests on this staging site https://wordpress.org/plugins/wp-staging/

    Thread Starter Jochen Gererstorfer

    (@gmmedia)

    Hello Dat,
    yes I can’t replicate it.

    It is a cheap shared hosting from my client.
    Could it be a restriction from the hoster?

    Jochen

    It is a cheap shared hosting from my client.
    Could it be a restriction from the hoster?

    Based on the error itself, it’s not an issue with limited resources (memory, CPU, etc).

    Instead, the error happens because of the unexpected data type.

    I am facing the same issue with https://www.needle.my. Was this ever resolved? The problem happens from time to time. I cannot replicate it.

    I am seeing this too. It sure seems like there is a miss on data type checking or something.

    
    [04-Feb-2021 01:52:17 UTC] PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php:56
    Stack trace:
    #0 wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php(56): serialize(Array)
    #1 wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-listener.php(335): Automattic\Jetpack\Sync\Queue->add(Array)
    #2 wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-listener.php(199): Automattic\Jetpack\Sync\Listener->enqueue_action('jetpack_sync_ca...', Array, Object(Automattic\Jetpack\Sync\Queue))
    #3 wp-includes/class-wp-hook.php(287): Automattic\Jetpack\Sync\Listener->action_handler('theme_support', Array)
    #4 wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #5 wp-includes/plugin.php(478): WP_Hook->do_actio in wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 56
    

    Something I wonder about is if this is being caused by the WP-CLI. I have that running from a server-side cron job in order to run WP Cron.

    Now my other site https://zhouruopeng.com is also having this problem. Again, it’s impossible to replicate. It happens randomly. Just a block of error message suddenly appear below. It also seem to only happen in WP Admin

    Plugin Contributor Dan (a11n)

    (@drawmyface)

    Thanks for the reports. I have reopened the Github issue, but until we know how to replicate the issue it’s going to be difficult to fix. If anyone is able to replicate it consistently, please let us know.

    https://github.com/Automattic/jetpack/issues/7252

    @drawmyface have you tried testing with the WP-CLI running the WPCron? From what I see in my logs it seems to be related to the WPCron in some form.

    Plugin Contributor Matthew Denton

    (@mdbitz)

    Hi everyone, this issue is stemming from a theme/plugin using an anonymous function on a hook’s value which Jetpack’s sync process tries to capture.

    @tnolte, @gmmedia -> the hook in question is theme_support although this has happened for other actions in the past. You should be able to do a search for add_action( 'theme_support' in your plugins/themes to find which is using the anonymous function. ex: $callback = function ()

    https://github.com/Automattic/jetpack/issues/7252 is re-opened and we’ll either add defensive steps (catch error) or look into using a serialization method that works for anonymous functions.

    The reason this is an occasional error is that Jetpack only attempts to send callables periodically when values change.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Fatal error: Uncaught Exception: Serialization of ‘Closure’ is not allowed’ is closed to new replies.