🐛 Create /config/env directory before services write into it 🐛
gitea / release-gitea (push) Failing after 41s

App-breaking bug found during full runtime verification of the act_runner
cache-server feature: `/config/env` was never explicitly created. It only
came into existence as a side effect of `__create_env_file()` copying
`/usr/local/etc/docker/env/default.sample` into it — but that sample file
does not exist in this image's rootfs, so `__create_env_file()` returns
early without creating the directory. `05-dockerd.sh` and
`zz-act_runner.sh` then failed writing `/config/env/docker.local.sh` and
`/config/env/act_runner.local.sh` directly, logging
`No such file or directory` (non-fatal, but a real bug).

- rootfs/usr/local/bin/entrypoint.sh: added
  `mkdir -p "/config/env" 2>/dev/null || true` alongside the other
  `/config/*` directory creation lines
- TODO.AI.md: logged the fix and the upstream-template-sync follow-up

Verified: full end-to-end run with `--privileged --cap-add CHOWN
--cap-add SYS_TIME --cap-add SYS_ADMIN` (per README) shows no more
"No such file or directory" errors, gitea starts on port 80, dockerd
starts, act_runner cache server logs "Cache server has been started and
is listening on 44015", and both configured runners register
successfully ("Runner registered successfully." x2, RUNNERS_START=2).
`runners-cache.yaml` is generated with real (non-REPLACE_) cache config
values.
This commit is contained in:
2026-08-05 01:52:09 -04:00
parent 6ebe62790a
commit fc3e148bb2
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -42,6 +42,20 @@ Needs syncing back to the upstream template per AI.md's runbook.
entirely (`Command error: unknown command: /config/gitea/app.ini`). Fixed by replacing the
`[ -z "$input" ]` check with `[[ "$input" =~ [^[:space:]] ]] || return 0`.
## App-breaking bug fixed — missing /config/env directory (bin/entrypoint.sh)
- `/config/env` directory was never explicitly created. It only came into existence as a side
effect of `__create_env_file()` (functions/entrypoint.sh) copying
`/usr/local/etc/docker/env/default.sample` into it — but that sample file/dir does not exist in
this image's rootfs, so `__create_env_file()` returns early (line 960) without creating the
directory. `05-dockerd.sh`'s `__create_service_env()` then fails writing
`/config/env/docker.local.sh` directly (`cat <<'EOF' >"/config/env/....local.sh"`, no `tee`
suppression) with `No such file or directory`; `zz-act_runner.sh` hits the same error writing
`/config/env/act_runner.local.sh`. Fixed by adding
`mkdir -p "/config/env" 2>/dev/null || true` alongside the other `/config/*` directory creation
lines (~line 241) in `rootfs/usr/local/bin/entrypoint.sh`. Needs syncing to the upstream
template per AI.md's runbook.
## Other observations not yet actioned
- `.gitea/workflows/docker.yaml` uses the same stale/unpinned action pattern (`@v2`-`@v4`, DockerHub-only, `catthehacker/ubuntu:act-latest`) that was removed from the `opengist` repo's duplicate workflow — no `build.yml` counterpart exists here yet.
+1
View File
@@ -240,6 +240,7 @@ mkdir -p "/data/logs" 2>/dev/null || true
mkdir -p "/run/init.d" 2>/dev/null || true
mkdir -p "/config/enable" 2>/dev/null || true
mkdir -p "/config/secure" 2>/dev/null || true
mkdir -p "/config/env" 2>/dev/null || true
mkdir -p "/usr/local/etc/docker/exec" 2>/dev/null || true
# - - - - - - - - - - - - - - - - - - - - - - - - -
# create required files