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

replication option: predis/predis v2 doesn't allow true #692

Closed
Gregoire-M opened this issue Jan 6, 2023 · 2 comments · Fixed by #693
Closed

replication option: predis/predis v2 doesn't allow true #692

Gregoire-M opened this issue Jan 6, 2023 · 2 comments · Fixed by #693
Labels
bug Not working as intended predis Specific to Predis

Comments

@Gregoire-M
Copy link

Gregoire-M commented Jan 6, 2023

I'm updating a project that uses predis and SncRedisBundle with this config:

  - Upgrading predis/predis (v1.1.10 => v2.0.3)
  - Upgrading snc/redis-bundle (4.4.1 => 4.5.0)
snc_redis:
    clients:
        default:
            type: predis
            alias: default
            dsn:
                - "%env(REDIS_URL)%?alias=master"
                - "%env(REDIS_URL_READ_ONLY)%"
            logging: '%kernel.debug%'
            options:
                replication: true

But I get this error when I try to connect to Redis:

In Replication.php line 40:

  [InvalidArgumentException]
  Predis\Configuration\Option\Replication expects either a string or a callable value, boolean given


Exception trace:
  at /srv/app/vendor/predis/predis/src/Configuration/Option/Replication.php:40
 Predis\Configuration\Option\Replication->filter() at /srv/app/vendor/predis/predis/src/Configuration/Options.php:103
 Predis\Configuration\Options->__get() at /srv/app/vendor/predis/predis/src/Client.php:125
 Predis\Client::createConnection() at /srv/app/vendor/predis/predis/src/Client.php:61
 ...

Indeed, in predis code, I can see that the value is supposed to be a string (predis, sentinel or redis-sentinel) or a callable.

But SncRedisBundle forces me to set true or 'sentinel'.

Am I missing something? Or is there a problem between predis v2 and SncRedisBundle v4.5?

@ostrolucky
Copy link
Collaborator

ostrolucky commented Jan 6, 2023

Yes. predis 2 support is quite new. Thanks for reporting

cc @franmomu

@ostrolucky ostrolucky added bug Not working as intended predis Specific to Predis labels Jan 6, 2023
@franmomu
Copy link
Contributor

franmomu commented Jan 6, 2023

I'll try to take a look later today, I guess we should allow predis and redis-sentinel, treat true as predis, and deprecate true.

ostrolucky pushed a commit that referenced this issue Jan 8, 2023
Co-authored-by: Gabriel Ostrolucký <gabriel.ostrolucky@gmail.com>
Fixes #692
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended predis Specific to Predis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants