Skip to content

"Serialization of 'Closure' is not allowed" error when trying to login in CMS #3278

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

Open
mcdennem opened this issue Jul 12, 2022 · 9 comments
Labels
🐛 tag: bug This is a bug.

Comments

@mcdennem
Copy link
Member

This error appears after creating a new MySQL db for a project, which has a contenttype including a collectection with a set.

Details

Question Answer
Relevant Bolt Version 5.1.12
PHP version 7.4
MySQL version 8.0.28

Reproduction

Bug summary

  • After debugging, this has to do with the content_array setting in config.yaml. When set to 0, the error is solved.

Steps to reproduce

  • Create a new MySQL database with bin/console bolt:setup
  • Make sure the project contains a contenttype which has collection' with a set`
  • Login into the CMS
  • "Serialization of 'Closure' is not allowed" error appears
@bobdenotter
Copy link
Member

I'm not able to reproduce this, just yet. What CT are you using, exactly?

I'm trying with:

dummies:
    name: Dummies
    singular_name: Dummy
    fields:
        title:
            type: text
        slug:
            type: slug
            uses: title
        collectie:
            type: collection
            fields:
                set:
                    label: My set
                    type: set
                    fields:
                        name:
                            type: text
                            label: My name
                        multiselect:
                            label: My turtle
                            type: select
                            values: [ A-tuin, Donatello, Rafael, Leonardo, Michelangelo, Koopa, Squirtle ]
                            multiple: true
    icon_many: "fa:viruses"
    icon_one: "fa:virus"

Schermafbeelding 2022-07-12 om 19 29 21

I've tried both MySQL and SQLite and both with and without Fixtures added to the newly created DB.

Do you have more details on how to reproduce this?

@bobdenotter bobdenotter added the 🐛 tag: bug This is a bug. label Jul 12, 2022
@Spomsoree
Copy link
Contributor

Spomsoree commented Jul 13, 2022

This happens to me too since the last update.

Sometimes it works, most of the times I get the error, I cannot reproduce it regularly.

This is the Data it wants to serialize:
image

@bobdenotter
Copy link
Member

I've been trying to reproduce, but no dice yet. I'mma leave this open until more info is available.

@Spomsoree
Copy link
Contributor

I think this occurs if you update a project that used an older version before, but thats just a guess.

@Sander-Hub
Copy link
Member

@bobdenotter when I just tested your update to the 5.2 beta branch and wanted to click on the dashboard I get this error too.

I performed a checkout to your branch. Ran composer install. The composer install ran fine with no issues.

@Sander-Hub
Copy link
Member

I can confirm that changing the value of content_array setting in config.yaml as described by @mcdennem allowed me to access the dashboard again.

I am unsure whether or not to create a new issue for this, as I did not install a new project I just switched branches albeit an internal one.

The only noteworthy thing is that I switched branches from Bolt 5.1.10 to the internal 5.2 beta branch (perhaps upgrading to the latest maintenance release will not cause this issue).

@laurens94
Copy link
Contributor

This just happened to me as well, yesterday the issue didn't occur but today it did.
I created a new bolt 5 project and copied/migrated data from a bolt 3 project over using the Conimex extension.

Setting the value content_array: 0 helped, thanks!

@Steve-MP
Copy link

Steve-MP commented Aug 26, 2022

Can confirm this now happens to me following update to tagged release 5.1.12 - not the beta branch.

Turning off caching for the content_array also allows my dashboard to load.

Not sure whether this is related, but trying to manually refresh the Symfony cache through the cli also produces these warnings:

WARNING [cache] Failed to save key "property_metadata_4ba6ddb7eb691582c68feab91b1d58fb" of type ApiPlatform\Core\Metadata\Property\PropertyMetadata: Cache key "property_metadata_4ba6ddb7eb691582c68feab91b1d58fb" has non-serializable "ApiPlatform\Core\Metadata\Property\PropertyMetadata" value. ["key" => "property_metadata_4ba6ddb7eb691582c68feab91b1d58fb","exception" => Symfony\Component\Cache\Exception\InvalidArgumentException^ { …},"cache-adapter" => "Symfony\Component\Cache\Adapter\PhpFilesAdapter"]

So it seems like there might be something strange afoot with serialization.

@Spomsoree
Copy link
Contributor

It seems like the issue is solved for me on version 5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 tag: bug This is a bug.
Projects
None yet
Development

No branches or pull requests

6 participants