-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] "Trying to access array offset on value of type bool" warning with RedisAdapter
#46384
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
I can't find any array access on this line. Looks like my lines aren't yours. What's this line like for you? |
https://github.com/symfony/cache/blob/v5.4.8/Traits/RedisTrait.php#L562 |
FYI, same issue here (on symfony 5.4 but it looks the code is exactly the same even on 6.x)
When using A potential solution would be something along these lines:
|
… bool (João Nogueira) This PR was merged into the 5.4 branch. Discussion ---------- [Cache] Fix dealing with ext-redis' multi/exec returning a bool | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #46384 | License | MIT When using `phpredis` client, the execution of `multi/exec` might return a boolean instead of an array, leading to an error when yielding the result. Commits ------- 4d2b176 [Cache] Fix dealing with ext-redis' multi/exec returning a bool
Symfony version(s) affected
5.4.8
Description
Quite routinely in our Sentry logs, we're getting the noted warning being captured when trying to write the result of a query to Redis for caching. I'm only including the part of the stack trace from our repository's call to
Doctrine\ORM\AbstractQuery::getResult()
as the rest isn't really relevant:ORM 2.12.2 and DBAL 3.3.6 are in use here, with
ext/redis
at 5.3.6 and Redis 6.x servers.How to reproduce
I'm not able to recreate it in any environment but our production system, but the calling code in our app isn't anything crazy repository class:
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: