fix deploy.yml #404

Closed
opened 2026-06-04 04:23:00 +00:00 by guettli · 1 comment
guettli commented 2026-06-04 04:23:00 +00:00 (Migrated from codeberg.org)

The last runs of deploy.yml failed.

Fix that, if possible, or set NeedSupervisor

The last runs of deploy.yml failed. Fix that, if possible, or set NeedSupervisor
guettlibot commented 2026-06-04 04:45:02 +00:00 (Migrated from codeberg.org)

The PR is open at https://codeberg.org/guettli/sharedinbox/pulls/406.


Here's a summary of what I found and fixed:

Root cause (diagnosed from CI run #1516 logs):

The deploy-apk and deploy-linux jobs fail every run with Load key "/root/.ssh/id_ed25519": error in libcrypto. Two problems compound each other:

  1. Stale Dagger cache — The tr -d '\r' key-normalisation step (from PR #369) shows as CACHED in every run. Dagger caches based on input-content hash; if the first-ever execution of that step produced a broken key file, the cached result is replayed forever and the live SOPS secret is never re-read.

  2. .ssh/ directory permissions — Dagger creates parent directories for secret mounts with 755. Mounting the raw key directly into /root/.ssh/ may let Dagger override that directory's permissions, potentially making them too permissive for OpenSSH.

Fix (ci/main.goDeployer function):

  • Added an explicit mkdir -p /root/.ssh && chmod 700 /root/.ssh step before any secret mounts.
  • Moved the raw-key secret mount to /tmp/id_ed25519.raw (outside .ssh/).
  • Replaced tr -d '\r' with a Python3 normalisation script that handles CRLF, bare-CR, and ensures a trailing newline. Changing the command changes Dagger's cache key, forcing a fresh read of the current live secret.

PR: https://codeberg.org/guettli/sharedinbox/pulls/406

The PR is open at https://codeberg.org/guettli/sharedinbox/pulls/406. --- Here's a summary of what I found and fixed: **Root cause** (diagnosed from CI run #1516 logs): The `deploy-apk` and `deploy-linux` jobs fail every run with `Load key "/root/.ssh/id_ed25519": error in libcrypto`. Two problems compound each other: 1. **Stale Dagger cache** — The `tr -d '\r'` key-normalisation step (from PR #369) shows as `CACHED` in every run. Dagger caches based on input-content hash; if the first-ever execution of that step produced a broken key file, the cached result is replayed forever and the live SOPS secret is never re-read. 2. **`.ssh/` directory permissions** — Dagger creates parent directories for secret mounts with 755. Mounting the raw key directly into `/root/.ssh/` may let Dagger override that directory's permissions, potentially making them too permissive for OpenSSH. **Fix** (`ci/main.go` — `Deployer` function): - Added an explicit `mkdir -p /root/.ssh && chmod 700 /root/.ssh` step before any secret mounts. - Moved the raw-key secret mount to `/tmp/id_ed25519.raw` (outside `.ssh/`). - Replaced `tr -d '\r'` with a Python3 normalisation script that handles CRLF, bare-CR, and ensures a trailing newline. Changing the command changes Dagger's cache key, forcing a fresh read of the current live secret. PR: https://codeberg.org/guettli/sharedinbox/pulls/406
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: guettli/sharedinbox#404