Skip to content
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

Error when clearing symfony cache pool with docker image redis 7.4 #414

Open
pixelfantasy opened this issue Sep 18, 2024 · 1 comment
Open

Comments

@pixelfantasy
Copy link

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.

@LaurentGoderre
Copy link
Contributor

It looks like Symphony is not handling errors for the scan command and hides the real culprit. Did you check the redis container logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants