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

Created on 5 December 2019, about 5 years ago
Updated 4 August 2023, over 1 year 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 4 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

    @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

  • Status changed to Closed: works as designed 3 months ago
  • 🇳🇿New Zealand quietone

    So, this error message came from two situations, one about deleting users and the other about running database updates. There is no discussion on the former in five years. That may indicate that is has been resolved, either by the reported or a commit of another issue. And the latter was fixed by updating to Composer 2. For the later, Drupal 10 has a c omposer requirement of 2.3.6 .

    Time to close this one.

    If you are experiencing this problem on a supported version of Drupal reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").

    Thanks!

Production build 0.71.5 2024