web-arm: onecli-db-password oneshot cannot read its sops secret #340

Closed
opened 2026-08-14 19:37:25 +02:00 by dominik.polakovics · 0 comments

First activation of the merged #339 on web-arm failed:

onecli-db-password-start: cat: /run/secrets/onecli-db-password: Permission denied
podman-onecli.service: Job failed with result 'dependency'.

The oneshot runs as User=postgres, but sops-nix installs the secret root-owned 0400. Fix: hand the secret over via systemd LoadCredential (the keycloak module's pattern) instead of reading the sops path directly.

While in there, also order the oneshot after postgresql-setup.service explicitly: ordering on postgresql.target protects a cold boot, but on a live switch the target is already active, so the oneshot can race the role creation that postgresql-setup performs (PR 339 review CONCERN 1's residual case).

First activation of the merged #339 on web-arm failed: onecli-db-password-start: cat: /run/secrets/onecli-db-password: Permission denied podman-onecli.service: Job failed with result 'dependency'. The oneshot runs as User=postgres, but sops-nix installs the secret root-owned 0400. Fix: hand the secret over via systemd LoadCredential (the keycloak module's pattern) instead of reading the sops path directly. While in there, also order the oneshot after postgresql-setup.service explicitly: ordering on postgresql.target protects a cold boot, but on a live switch the target is already active, so the oneshot can race the role creation that postgresql-setup performs (PR 339 review CONCERN 1's residual case).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/nixos#340
No description provided.