-
-
Notifications
You must be signed in to change notification settings - Fork 258
Description
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 of REDIS_URL.
This works fine for redis:// URIs, but breaks unix:// URIs, since it is just treated a path separator.
The correct syntax for unix:// URIs would be ?db=<number>.
To Reproduce
- Setup Redis with unix sockets
- Set
REDIS_URLtounix:///run/redis-dawarich/redis.sock - Try to run the migrations
Expected behavior
Dawarich should support both unix:// and redis:// URIs.
Logs
machine # [ 54.538659] dawarich-init-db-start[1001]: Tasks: TOP => data:migrate
machine # [ 54.539811] dawarich-init-db-start[1001]: (See full trace by running task with --trace)
machine # [ 54.541120] dawarich-init-db-start[1001]: Migrating to BindExistingPointsToFirstUser (20240525110530)
machine # [ 54.542560] dawarich-init-db-start[1001]: == 20240525110530 BindExistingPointsToFirstUser: migrating ====================
machine # [ 54.544216] dawarich-init-db-start[1001]: == 20240525110530 BindExistingPointsToFirstUser: migrated (0.0510s) ===========
machine # [ 54.545935] dawarich-init-db-start[1001]: Migrating to RemovePointsWithoutCoordinates (20240610170930)
machine # [ 54.547383] dawarich-init-db-start[1001]: == 20240610170930 RemovePointsWithoutCoordinates: migrating ===================
machine # [ 54.549008] dawarich-init-db-start[1001]: Found 0 points without coordinates...
machine # [ 54.550278] dawarich-init-db-start[1001]: Points without coordinates removed.
machine # [ 54.551477] dawarich-init-db-start[1001]: INFO 2025-07-09T17:31:48.798Z pid=1001 tid=221: Sidekiq 8.0.4 connecting to Redis with options {size: 10, pool_name: "internal", url: "unix:///run/redis-dawarich/redis.sock/1"}
machine # [ 54.554235] dawarich-init-db-start[1001]: Failed enqueuing BulkStatsCalculatingJob to Sidekiq(stats): RedisClient::CannotConnectError (Not a directory - connect(2) for /run/redis-dawarich/redis.sock/1 (unix:///run/redis-dawarich/redis.sock/1))
machine # [ 54.559829] systemd[1]: dawarich-init-db.service: Main process exited, code=exited, status=1/FAILURE
machine # [ 54.561625] systemd[1]: dawarich-init-db.service: Failed with result 'exit-code'.
machine # [ 54.564899] systemd[1]: Failed to start dawarich-init-db.service.
Solution
A possible solution would be to use the built-in db argument instead, since it works with any type of URI.
Additional context
Bug introduced with #1420
I have a working fix and will be making a PR shortly.
Relates to NixOS/nixpkgs#345622