redis icon indicating copy to clipboard operation
redis copied to clipboard

Error when clearing symfony cache pool with docker image redis 7.4

Open pixelfantasy opened this issue 5 months ago • 1 comments

Hello,

I am not totally sure if this is the right place to address this issue. If not let me know and I will close this issue.

In my local dev environment I have the current setup running:

OS: PHP 8.3.10 Symfony 6.4.10 LTS Setup based on docker and docker-compose.yml

PHP Packages: predis/predis: 2.2.2 snc/redis-bundle: 4.7.2

When I am using the redis docker image in version 7.2 everything is running fine. No complains and all caches can be cleared without any errors:

bin/console cache:pool:clear doctrine_redis_cache application_redis_cache
bin/console cache:clear --env=dev

When I change the docker image to version 7.4 I get the following errors produced by predis/predis bundle:

// Clearing cache pool: doctrine_redis_cache                                                                           

In RedisTrait.php line 512:
                                                            
Cannot use object of type Predis\Response\Error as array  

cache:pool:clear [--all] [--exclude EXCLUDE] [--] [<pools>...]

Configuration from docker-compose.yml

  redis:
    image: redis:7.2
    container_name: application_redis
    ports:
      - "6379:6379"
    volumes:
      - ./docker/redis/data:/data:cached
    command: redis-server --appendonly yes --requirepass secret

I tried a lot with up- and downgrading the PHP packages, but at the end the only trick that worked was to limit the docker image to version 7.2. Version 7.4. will always bring back that weird error which is related to the SCAN command and an invalid cursor.

pixelfantasy avatar Sep 18 '24 14:09 pixelfantasy