Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync: Fatal Error -- Serialization of Closure is not allowed #7252

Closed
gumgumcode opened this issue May 29, 2017 · 5 comments · Fixed by #18765
Closed

Sync: Fatal Error -- Serialization of Closure is not allowed #7252

gumgumcode opened this issue May 29, 2017 · 5 comments · Fixed by #18765
Assignees
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Package] Sync [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended

Comments

@gumgumcode
Copy link
Contributor

gumgumcode commented May 29, 2017

Fatal error: Uncaught exception 'Exception' with message 'Serialization of
'Closure' is not allowed' in wp-content/plugins/jetpack/sync/class.jetpack-sync-queue.php:53
Stack trace: #0`
`wp-content/plugins/jetpack/sync/class.jetpack-sync-queue.php(53):
serialize(Array) #1`
`wp-content/plugins/jetpack/sync/class.jetpack-sync-listener.php(218):
Jetpack_Sync_Queue->add(Array) #2`
`wp-content/plugins/jetpack/sync/class.jetpack-sync-listener.php(116):
Jetpack_Sync_Listener->enqueue_action('jetpack_sync_ca...', Array,
Object(Jetpack_Sync_Queue)) #3 [internal function]:
Jetpack_Sync_Listener->action_handler('post_types', Array) #4`
`wp-includes/class-wp-hook.php(298):
call_user_func_array(Array, Array) #5`
`wp-includes/class-wp-hook.php(323):
WP_Hook->apply_filters('', Array) #6`
`wp-includes/plugin.php(453): WP_Ho in
wp-content/plugins/jetpack/sync/class.jetpack-sync-queue.php
on line 53

Checking class.jetpack-sync-queue.php shows error at this line:

$rows_added = $wpdb->query( $wpdb->prepare(
'INSERT INTO $wpdb->options (option_name,
option_value, autoload) VALUES (%s, %s,%s)',
$this->get_next_data_row_option_name(),
serialize( $item ),
'no'
) );

Reported in 3231883-t

@jeherve jeherve added [Package] Sync [Pri] Normal [Team] Poseidon [Type] Bug When a feature is broken and / or not performing as intended labels May 29, 2017
@jeherve jeherve changed the title Fatal Error: Serialization of Closure is not allowed Sync: Fatal Error -- Serialization of Closure is not allowed May 29, 2017
@enejb
Copy link
Member

enejb commented May 29, 2017

Any idea how I can replicate this? Googleing WP_Ho doesn't return meaningful php results and from the plugin list I am not able to find the plugin that might be adding that class name.

@jeherve
Copy link
Member

jeherve commented May 29, 2017

@enejb It most likely meant WP_Hook but got cut off.

@enejb
Copy link
Member

enejb commented Apr 5, 2018

@jeherve and @codestor4 Any ideas how to replicate this is this? is it still an issue?
Feel free to reopen this if it has not been addressed.

@enejb enejb closed this as completed Apr 5, 2018
@danjjohnson
Copy link

Reopening this as there are several people still reporting this error here:
https://wordpress.org/support/topic/fatal-error-uncaught-exception-serialization-of-closure-is-not-allowed/

Unfortunately, we still don't know how to replicate it, and it only happens intermittently.

@danjjohnson danjjohnson reopened this Feb 9, 2021
@matticbot matticbot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Feb 9, 2021
@mdbitz
Copy link
Contributor

mdbitz commented Feb 9, 2021

Initial guess is that we are dealing with a plugin/theme conflict In that the plugin/theme is using an anonymous function within a hook added to the callables.

public static $default_callable_whitelist = array(

To resolve

  1. we can wrap the serialize to catch this exception - the caveat being we'll not have the data transmitted to WP.com
  2. we can utilize a serializable library to allow for serializing of closures.
    https://github.com/opis/closure
    https://github.com/jeremeamia/super_closure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Package] Sync [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants