-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Failed to save key of type array #44138
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
Comments
Can you please share a small reproducing app? |
Here is a small reproducer.
|
I mean an app that I could install myself on my local machine please? |
OH I missed the link, let me try it now! |
I'm not able to reproduce the issue, I see no warning here :( |
Could you try with PHP 7.3? php -v
|
Same with this, no issue: |
That was my only lead that could have explained the difference :/ |
You might want to debug/dump the value that fails to be serialized and figure out where it comes from... |
Already tried but couldn't trace why this can't be serialized : PhpFilesAdapter.php on line 229:
array:3 [▼
0 => Doctrine\ORM\Mapping\Column {#468 ▼
+name: "name"
+type: "string"
+length: 50
+precision: null
+scale: null
+unique: false
+nullable: false
+options: []
+columnDefinition: null
}
1 => Symfony\Component\Validator\Constraints\NotBlank {#469 ▼
+message: "This value should not be blank."
+allowNull: false
+normalizer: null
+payload: null
+groups: array:1 [▶]
}
2 => Symfony\Component\Validator\Constraints\Length {#499 ▼
+maxMessage: "partner.name.max_size"
+minMessage: "partner.name.min_size"
+exactMessage: "This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters."
+charsetMessage: "This value does not match the expected {{ charset }} charset."
+max: 50
+min: 2
+charset: "UTF-8"
+normalizer: null
+allowEmptyString: false
+payload: null
}
] |
It somehow seems like this is related to /**
* @var string
*
* @ORM\Column(name="name", type="string", length=50)
*
* @Assert\NotBlank(groups="Default")
* @Assert\Length(groups="Default",
* min=2,
* max=50,
* minMessage="partner.name.min_size",
* maxMessage="partner.name.max_size"
* )
*/ |
@nicolas-grekas just to double-check, you don't have any warnings at all? Because with new Profiler re-design, warning are not displayed on main page: |
@nicolas-grekas could it be related to aa4fb0c#diff-eadef5e494fbfb85346e70992f4b18994df0b999b7d336c9cece5ab9e9a4a18a unsetting the property ? |
Thanks @stof for this lead! |
I confirm I have nothing like that. Anyone else reproducing? @adrienfr can you please debug the situation a bit more, at least show us the details of the previous |
@nicolas-grekas could this be helpful? I'm available on Slack (Symfony Devs), username |
I would really need the "previous" exception. |
"User Notice: serialize(): "groups" returned as member variable from __sleep() but does not exist" |
Found this related issue but you might remember :) #28352 |
OK, I now am able to reproduce. I need to run |
Tagging my stack trace #44182 as it seems to be relevant |
…when __sleep() is implemented (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [VarExporter] fix exporting declared but unset properties when __sleep() is implemented | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44138 Fix #44182 | License | MIT | Doc PR | - Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/44188/files?w=1). Commits ------- a557bdc [VarExporter] fix exporting declared but unset properties when __sleep() is implemented
Thanks for the details. |
Thanks @nicolas-grekas |
Symfony version(s) affected
5.4.0-BETA3
Description
When testing SF 5.4, the following warning occurs on entities with
Assert
annotations andPhpFilesAdapter
cache.Failed to save key "App%5CEntity%5CPartner%24name" of type array: Cache key "App%5CEntity%5CPartner%24name" has non-serializable "array" value.
How to reproduce
Possible Solution
No response
Additional Context
The text was updated successfully, but these errors were encountered: