core
core copied to clipboard
"Serialization of 'Closure' is not allowed" error when trying to login in CMS
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 inconfig.yaml
. When set to0
, 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 hascollection' with a
set` - Login into the CMS
- "Serialization of 'Closure' is not allowed" error appears
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"
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?
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:
I've been trying to reproduce, but no dice yet. I'mma leave this open until more info is available.
I think this occurs if you update a project that used an older version before, but thats just a guess.
@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.
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).
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!
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.
It seems like the issue is solved for me on version 5.2