8000 Password not working with an unix socket for Messenger redis transport · Issue #47393 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Password not working with an unix socket for Messenger redis transport #47393

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

Closed
Arakmar opened this issue Aug 26, 2022 · 4 comments · Fixed by #48959
Closed

Password not working with an unix socket for Messenger redis transport #47393

Arakmar opened this issue Aug 26, 2022 · 4 comments · Fixed by #48959

Comments

@Arakmar
Copy link
Arakmar commented Aug 26, 2022

Symfony version(s) affected

6.1.3, 5.4.11

Description

When a messenger async transport is configured with Redis (unix socket with a password), it gives DSN parsing errors.
After looking at the code, the password is properly parsed only when a host is used.
It's also the same for the password option, it's not used in case of a socket.

The redis cache adapter doesn't seem to be affected by this problem. It allows DSN like that :
redis[s]://[pass@][ip|host|socket[:port]][/db-index]

How to reproduce

Use a DSN like that for an async messenger queue :
redis://password@/var/run/redis.sock

It gives the following error :

The given Redis DSN is invalid

Possible Solution

Add support for passwords with redis socket in the same way the redis cache adapter does.

I can propose a PR for that.

Additional Context

No response

@xabbuh
Copy link
Member
xabbuh commented Aug 26, 2022

If you want to, please give it a try. 👍

@PhilETaylor
Copy link
Contributor

Does this work for you @Arakmar

#47475

@Arakmar
Copy link
Author
Arakmar commented Sep 3, 2022

I tested it with different scenarios (socket, host, user / password or not) and it works just fine. Thanks for taking care of that !

@nico89700

This comment was marked as spam.

nicolas-grekas added a commit that referenced this issue Jan 13, 2023
…kets (PhilETaylor)

This PR was squashed before being merged into the 6.3 branch.

Discussion
----------

[Messenger] Allow password in redis dsn when using sockets

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #47393 `@Arakmar`
| License       | MIT
| Doc PR        |

When a messenger async transport is configured with Redis (unix socket with a password), it gives DSN parsing errors.

Using a Bunch of copy and pasted code blocks from the Redis cache adapter, this PR fixes the bug that doesn't parse a DSN such as

`redis://password@/var/run/redis.sock`

Replaces bad rebased #47475

Commits
-------

9af8ccf [Messenger] Allow password in redis dsn when using sockets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
0