Exception: Serialization of 'Closure' is not allowed in serialize() (line 157 in /core/lib/Drupal/Core/Batch/BatchStorage.php).

Created on 5 December 2019, over 4 years ago
Updated 6 February 2024, 5 months ago

When I try to delete a user from the user form I get this error:

Exception: Serialization of 'Closure' is not allowed i serialize() (linje 157 i /srv/bindings/362fb88bf5d9456da23fb16c961361ed/code/core/lib/Drupal/Core/Batch/BatchStorage.php).

However when I try to delete user from user overview page (to mark them and bulk mark) everything seems to work fine. I've tried to check my logs, but I don't really find any more debugging info than this.

🐛 Bug report
Status

Postponed: needs info

Version

9.5

Component
Batch 

Last updated 9 days ago

Created by

🇳🇴Norway matsbla

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone New Zealand

    @matsbla, thanks for reporting this. Did you ever find the cause and a resolution?

    There have been no other reports of this problem. This is also reported on a now unsupported version of Drupal. Is anyone having this problem on a supported version?

    Since we need more information to move forward with this issue, I am setting the status to Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • 🇩🇰Denmark abdirisak

    Updating from 9.5.11 to 10.0.11 gives me a very similar error.

    drush updatedb
    Module Update ID Type Description
    -------- ----------- --------------- -----------------------------------------

    user 10000 hook_update_n 10000 - Remove non-existent permissions created by migrations.
    -------- ----------- --------------- -----------------------------------------

    Do you wish to run the specified pending updates?: yes

    FAILED! drush updatedb -y
    "non-zero return code", "rc": 1,
    In BatchStorage.php line 157: Serialization of 'Closure' is not allowed.

  • 🇺🇸United States dcam

    @abdirisak I just ran into this issue too. After a lot of debugging and research I came across a GitHub issue comment. From that comment:

    make sure you update to Composer 2.5.1 and then composer dump-autoload or install to ensure the new ClassLoader is present in your vendor dir.

    Long version:
    In my case, I updated Drush from 12.1.2 to 12.4.3. The new version contains a new Drupal finder class, which loads environment variables. That included the Composer ClassLoader, which contains a Closure property. That property was patched to be serializable. But even though I had the latest versions of everything, including the Composer ClassLoader, it seems that the older version was cached. Running the composer dump-autoload command allowed everything to work again.

  • 🇮🇷Iran amir jamshidi

    Thanks #10 worked for me

Production build 0.69.0 2024