nixos-modules: escape % in HYDRA_DATABASE_URL - #1858
Merged
Ericson2314 merged 1 commit intoAug 13, 2026
Conversation
The default database URL reaches Postgres over a Unix socket, so its
"host" is a percent-encoded directory: `%2Frun%2Fpostgresql`. systemd
reads `%` in `Environment=` as the start of a specifier, fails to resolve
`%2`, and drops the whole assignment:
Failed to resolve specifiers in HYDRA_DATABASE_URL=..., ignoring: Invalid slot
The services then fall back to `postgres:///hydra`, which carries no
user, so libpq connects as the service's own Unix user — `hydra-www`,
`hydra-queue-runner` — and peer auth rejects it, since the `hydra-users`
ident map only maps those to the `hydra` role. The `install` test saw
this as a 500 from the web UI.
Double the `%` on the copies bound for systemd; see the comment on
`dbUrlWithAppName`. `environment.variables` is a plain shell environment
and the queue runner reads its URL from TOML, so neither needs it.
Assisted-by: Claude Code (Opus 5)
Ericson2314
enabled auto-merge
August 13, 2026 23:25
Ericson2314
disabled auto-merge
August 13, 2026 23:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default database URL reaches Postgres over a Unix socket, so its "host" is a percent-encoded directory:
%2Frun%2Fpostgresql. systemd reads%inEnvironment=as the start of a specifier, fails to resolve%2, and drops the whole assignment:The services then fall back to
postgres:///hydra, which carries no user, so libpq connects as the service's own Unix user —hydra-www,hydra-queue-runner— and peer auth rejects it, since thehydra-usersident map only maps those to thehydrarole. Theinstalltest saw this as a 500 from the web UI.Double the
%on the copies bound for systemd; see the comment ondbUrlWithAppName.environment.variablesis a plain shell environment and the queue runner reads its URL from TOML, so neither needs it.Assisted-by: Claude Code (Opus 5)