From 0c72234127d0c106b9ff38b149b2db5dc834d72d Mon Sep 17 00:00:00 2001 From: Lance Walters Date: Fri, 27 Nov 2026 00:52:46 -0500 Subject: [PATCH] fix(f6): re-own the actions cache (.cache/act) for the uid-1000 runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The runner clones action repos into /data/.cache/act. Those files were created by the root runner and a job now dies with `open /data/.cache/act/actions-checkout@v4/.git/objects/pack/...pack: permission denied` (run 123, deploy-site). fix-data-perms now walks the top level of the data PVC and chowns everything except `docker` (the dind data-root, deliberately root-owned) when the entry is still root-owned — so a restart is cheap and future dirs are covered. --- apps/base/forgejo/runner-amd64.yaml | 15 +++++++++++++-- apps/base/forgejo/runner-arm64.yaml | 15 +++++++++++++-- apps/base/forgejo/runner-deploy-arm64.yaml | 15 +++++++++++++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/apps/base/forgejo/runner-amd64.yaml b/apps/base/forgejo/runner-amd64.yaml index d149d87..82f3ec4 100644 --- a/apps/base/forgejo/runner-amd64.yaml +++ b/apps/base/forgejo/runner-amd64.yaml @@ -87,8 +87,19 @@ spec: - | set -e chown 1000:1000 /data - [ -f /data/runner.ini ] && chown 1000:1000 /data/runner.ini - [ -d /data/cache ] && chown -R 1000:1000 /data/cache + # Re-own every entry the runner writes as uid 1000 — runner.ini, + # cache/ and the actions cache .cache/act/ where it clones the + # action repos (a stale root-owned pack file there fails the job + # with "permission denied"). Skip `docker`, the dind data-root, + # which stays root-owned: a recursive chown of that tree is tens + # of GB on the Pi. The owner check makes repeat starts cheap. + for d in /data/* /data/.[!.]*; do + if [ ! -e "$d" ]; then continue; fi + if [ "$d" = /data/docker ]; then continue; fi + if [ "$(stat -c %u "$d")" != 1000 ]; then + chown -R 1000:1000 "$d" + fi + done true volumeMounts: - name: data diff --git a/apps/base/forgejo/runner-arm64.yaml b/apps/base/forgejo/runner-arm64.yaml index 1449767..4b16820 100644 --- a/apps/base/forgejo/runner-arm64.yaml +++ b/apps/base/forgejo/runner-arm64.yaml @@ -53,8 +53,19 @@ spec: - | set -e chown 1000:1000 /data - [ -f /data/runner.ini ] && chown 1000:1000 /data/runner.ini - [ -d /data/cache ] && chown -R 1000:1000 /data/cache + # Re-own every entry the runner writes as uid 1000 — runner.ini, + # cache/ and the actions cache .cache/act/ where it clones the + # action repos (a stale root-owned pack file there fails the job + # with "permission denied"). Skip `docker`, the dind data-root, + # which stays root-owned: a recursive chown of that tree is tens + # of GB on the Pi. The owner check makes repeat starts cheap. + for d in /data/* /data/.[!.]*; do + if [ ! -e "$d" ]; then continue; fi + if [ "$d" = /data/docker ]; then continue; fi + if [ "$(stat -c %u "$d")" != 1000 ]; then + chown -R 1000:1000 "$d" + fi + done true volumeMounts: - name: data diff --git a/apps/base/forgejo/runner-deploy-arm64.yaml b/apps/base/forgejo/runner-deploy-arm64.yaml index f067bec..dc759cc 100644 --- a/apps/base/forgejo/runner-deploy-arm64.yaml +++ b/apps/base/forgejo/runner-deploy-arm64.yaml @@ -92,8 +92,19 @@ spec: - | set -e chown 1000:1000 /data - [ -f /data/runner.ini ] && chown 1000:1000 /data/runner.ini - [ -d /data/cache ] && chown -R 1000:1000 /data/cache + # Re-own every entry the runner writes as uid 1000 — runner.ini, + # cache/ and the actions cache .cache/act/ where it clones the + # action repos (a stale root-owned pack file there fails the job + # with "permission denied"). Skip `docker`, the dind data-root, + # which stays root-owned: a recursive chown of that tree is tens + # of GB on the Pi. The owner check makes repeat starts cheap. + for d in /data/* /data/.[!.]*; do + if [ ! -e "$d" ]; then continue; fi + if [ "$d" = /data/docker ]; then continue; fi + if [ "$(stat -c %u "$d")" != 1000 ]; then + chown -R 1000:1000 "$d" + fi + done true volumeMounts: - name: data -- 2.52.0