Just to add – I seem to be able to use redis:user:pass@?host[localhost:6379], but only with default redis user.
Hi @brndnl0 ,
thanks for your message.
I think it should work unless there’s a problem with the Symfony cache component itself.
On reading the documentation, you may have to use redis:user:pass@localhost:6379
Can you try with this ?
Can you also try a password without special characters (especially @)?
Just in case, maybe try also redis:user:[email protected]:6379
Do you have an error message somewhere ? (maybe in wp-content/uploads/crowdsec if you activate the debug log mode in the advanced settings of the plugin, or in the admin view when you save settings or try the bouncer)
Thanks
Thanks for getting back.
So as per the previous issue post I have been testing this without any special characters in the username or password. I’m also testing each user with redis-cli auth command and they work fine, as well as with other plugins.
When testing DSN using redis:user:pass@localhost:6379 or redis:user:[email protected]:6379 I get the below message:
There was an error while testing new DSN (redis:test:test@localhost:6379): Error when creating Redis cache adapter:Redis connection failed: php_network_getaddresses: getaddrinfo for localhost:6379 failed: Name or service not known
I’ve also checked logs – debug.log just prints the config without any errors.
prod.log will only show errors if I don’t add a password for the default user (ie. redis://pass@localhost:6379 or redis://defaultuser:pass@localhost:6379) as it seems to accept redis://localhost:6379 as a valid endpoint and will give the impression it is working but will quickly fill the logs with NOAUTH messages – not sure if this is a bug?
I’ve noticed the server I’m working on has a fairly old version of Redis (6.0.16) – is this potentially incompatible with the Symfony adapter?
Thanks again for your help.
-
This reply was modified 1 year, 11 months ago by
brndnl0.
Hi @brndnl0,
I was able to reproduce the bug: Redis connection failed with a user/password pair when the user is not the default one.
I discovered that there was an issue about it in the Symfony repo.
This has been fixed and, for some reason, the version included in this plugin doesn’t have the fix.
I’ll see as soon as possible how to fix this in the plugin code as well.
Thanks again for pointing this out.
P.S: It’s not important but I don’t see your last post in this topic. It’s probably a bug in this WordPress forum. Luckily, I received an email with the content of your last post.
No worries, thanks for your help.
And yes re: last post I edited a typo after posting and it was flagged for moderation, seems to be public now.
Looking forward to the update!
Hi @brndnl0,
I’ve just published release 2.6.4 of the plugin, with the Redis DSN fix.
Now, you should be able to use the following DSN settings:
-
redis:redis_user:redis_password@?host[redis_host:6379]
or
redis://redis_user:redis_password@redis_host:6379
Please let me know if it works for you.
Thanks
Can confirm that is now working perfectly, thanks!