Closed
Description
Symfony version(s) affected
7.1.2
Description
I'm trying to flush doctrine metadata using Redis adapter with Valkey 8.0.
The RedisTrait sends the following query to Valkey: SCAN NULL
on the first loop iteration, which leads to error ERR invalid cursor
.
Shouldn't the cursor variable initialized to value 0?
I've patched the file with $cursor = 0;
instead, and bin/console doctrine:cache:clear-metadata
works as expected.
How to reproduce
I'm using the following configuration:
doctrine:
orm:
metadata_cache_driver:
type: pool
pool: doctrine_redis
framework:
cache:
pools:
doctrine_redis:
adapter: cache.adapter.redis
provider: snc_redis.doctrine_metadata_cache
snc_redis:
clients:
doctrine_metadata_cache:
type: predis
alias: doctrine_metadata_cache
dsn: "%env(REDIS_URL)%/3"
options:
connection_timeout: 10
read_write_timeout: 30
And run bin/console doctrine:cache:clear-metadata
to get the error.
You can also use directly valkey-cli SCAN NULL
Possible Solution
Initialize the cursor variable with 0.
Additional Context
No response