Can't connect to Redis through a unix socket #1706
Replies: 5 comments 1 reply
-
|
Would like to use this too. Are socket connection possible for Postgres? |
Beta Was this translation helpful? Give feedback.
-
|
@Morethanevil Yes, socket connections seem to be working for PostgreSQL: Just set |
Beta Was this translation helpful? Give feedback.
-
|
Good to know, thanks 😊 I only tried the standard compose for testing and looking around a bit. I will wait for your PR being merged, so I can move this to my production environment |
Beta Was this translation helpful? Give feedback.
-
|
This would be very helpful. I ran into the same issue when trying to setup dawarich. Thanks @diogotcorreia for the analytics and PR to allow a redis socket and @Freika for the software in the first place. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks you @Freika for adding the changes to the 0.36.0-rc.1 With the main application I still get the same issue, where the Redis database is added directly to the URL part of the connection. If there are any additional information needed then I'm happy to help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I'm packaging Dawarich for Nixpkgs, and we usually use Unix sockets for connecting to Redis and Postgres.
It appears that the way Dawarich constructs only works for host/port URLs and not for
unix://URIs.OS & Hardware
NixOS 25.11 (unstable, master branch)
Hardware is irrelevant for this issue
Version
0.29.1
Describe the bug
Code in Dawarich adds
/<number>to the value ofREDIS_URL.This works fine for
redis://URIs, but breaksunix://URIs, since it is just treated a path separator.The correct syntax for
unix://URIs would be?db=<number>.See https://github.com/redis-rb/redis-client/blob/98a51a42c9952f76238da7f6390315e7d1edb6b3/lib/redis_client/url_config.rb#L30-L42
To Reproduce
REDIS_URLtounix:///run/redis-dawarich/redis.sockExpected behavior
Dawarich should support both
unix://andredis://URIs.Logs
Solution
A possible solution would be to use the built-in
dbargument instead, since it works with any type of URI.See https://github.com/redis-rb/redis-client/blob/98a51a42c9952f76238da7f6390315e7d1edb6b3/lib/redis_client/config.rb#L198-L201
Additional context
Bug introduced with #1420
I have a working fix and will be making a PR shortly.
Relates to NixOS/nixpkgs#345622
Beta Was this translation helpful? Give feedback.
All reactions