Skip to content

Commit 65cffcb

Browse files
GottZclaude
andcommitted
fix(backend): chown the firmware blob volume to 65534 before the writers start (A20)
A fresh named `fwblobs` volume is created root-owned (0:0, 0755), but ingest and admin run as 65534 (nobody) — so the admin firmware register could not write the blob (CreateTemp -> permission denied -> the crash-safe path left a row pointing at a missing blob, a 500). The Go e2e gate missed this: RegisterFirmware wrote to a root-owned t.TempDir(); only the LIVE deploy surfaced it (empirie-vor-behauptung). Fix: a `fwblobs-init` one-shot (alpine, root) chowns the volume to 65534 before ingest/admin start (depends_on: service_completed_successfully), mirroring the `migrate` one-shot pattern. Idempotent + fast on restart; reproducible on any host / fresh volume (a one-off host chown would silently break on volume recreation). Verified on the live deploy: admin firmware register -> 200, the content-addressed blob lands on the volume, duplicate -> 409, sha-mismatch -> 422. Serving stays dark (OTA_SERVE_ENABLED=false). Follow-up to the A20 merge (5dfa677). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5dfa677 commit 65cffcb

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

backend/docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ services:
6363
networks: [internal]
6464
restart: "no"
6565

66+
# one-shot: a fresh named volume is created root-owned (0:0, 0755), but ingest/admin run as 65534
67+
# (nobody) — without this the admin firmware register cannot write the blob. chown the volume to
68+
# 65534 before the writers start; idempotent + fast on restart. A20 §4.7.
69+
fwblobs-init:
70+
image: alpine:3
71+
command: ["chown", "-R", "65534:65534", "/fwblobs"]
72+
volumes:
73+
- fwblobs:/fwblobs
74+
networks: [internal]
75+
restart: "no"
76+
6677
grafana:
6778
image: grafana/grafana:11.3.0
6879
depends_on:
@@ -90,6 +101,8 @@ services:
90101
condition: service_healthy
91102
migrate:
92103
condition: service_completed_successfully
104+
fwblobs-init:
105+
condition: service_completed_successfully
93106
environment:
94107
POSTGRES_DB: ${POSTGRES_DB:-picpak}
95108
POSTGRES_USER: ${POSTGRES_USER:-picpak}
@@ -128,6 +141,8 @@ services:
128141
condition: service_healthy
129142
migrate:
130143
condition: service_completed_successfully
144+
fwblobs-init:
145+
condition: service_completed_successfully
131146
environment:
132147
POSTGRES_DB: ${POSTGRES_DB:-picpak}
133148
POSTGRES_USER: ${POSTGRES_USER:-picpak}

0 commit comments

Comments
 (0)