Repository navigation
Document B36 for setup-uv paths under RUNNER_TEMP - #9793
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
B36 misses Python-install-only lookup failures and contains inaccurate probe guidance.
4 open findings
What changed in this PR
Adds B36 diagnostics for setup-uv paths under $RUNNER_TEMP forwarded by --env-all.
Changes:
- Adds the canonical B36 finding and rendered diagnostics.
- Updates runner-doctor guidance and portable agent.
- Adds synchronization coverage and refreshes the workflow lock.
| File | Description |
|---|---|
scripts/ci/self-hosted-runner-doctor-workflow.test.ts |
Tests B36 documentation alignment. |
docs/diagnostics/README.md |
Adds B36 to generated indexes. |
docs/diagnostics/findings/runner/B36.json |
Defines the canonical finding. |
.github/workflows/shared/self-hosted-failure-modes.md |
Adds B36 catalog and lookup entries. |
.github/workflows/shared/diagnosis-findings.md |
Adds rendered B36 diagnostics. |
.github/workflows/self-hosted-runner-doctor.md |
Adds doctor guidance and matching. |
.github/workflows/self-hosted-runner-doctor.lock.yml |
Refreshes generated workflow metadata. |
.github/agents/self-hosted-runner-doctor.md |
Mirrors B36 in the portable agent. |
.github/agents/diagnose-awf.md |
Adds B36 to the generated diagnostic agent. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "The first uv command fails with Permission denied under UV_CACHE_DIR", | ||
| "The agent repeatedly chooses its own uv cache directory" |
| | B32 | A repeated/persistent-runner workflow intermittently blocks allowlisted `api.github.com`/`github.com` traffic with `403` or DNS `SERVFAIL`, recurring across otherwise-healthy runs | Squid's default `negative_dns_ttl` is 1 minute, so one transient upstream `SERVFAIL` is negatively cached and replayed for up to 60 seconds even after DNS recovers | **Fixed in AWF (PR github/gh-aw-firewall#8171, merged 2026-09-05):** `generateDnsSection()` emits `negative_dns_ttl 1 seconds`, `dns_retransmit_interval 1 seconds`, and `dns_timeout 10 seconds`. Upgrade AWF to include github/gh-aw-firewall#8171. | Inspect generated `squid.conf` for `negative_dns_ttl 1 seconds`, `dns_retransmit_interval 1 seconds`, `dns_timeout 10 seconds`, and `dns_nameservers`; correlate Squid `TCP_DENIED`/SERVFAIL bursts with concurrent startup or resolver load on unpatched AWF | github/gh-aw-firewall#8168, github/gh-aw-firewall#8171 | | ||
| | B33 | `[DEBUG] Could not check Squid logs: EACCES ... access.log` during diagnostics, or `[DEBUG] Could not preserve squid logs: chmod ... Operation not permitted` during artifact preservation, although logs are intact | Squid writes logs as UID 13; the previous shutdown-time repair only changed mode bits, ran after mid-run diagnostics, and never transferred ownership to the runner before artifact preservation | **Fixed in AWF (PR github/gh-aw-firewall#8251, merged 2026-09-07):** reusable `fixSquidLogPermissions()` now `chown`s to the runner UID/GID via `docker exec -e` and `chmod`s; `runAgentCommand()` repairs permissions before `checkSquidLogs()`, and preserved-log `chmod` is reported separately after rename. **Additional fix (PR github/gh-aw-firewall#8624, merged 2026-09-16):** topology startup can recreate Squid mid-run (for example, for new `extra_hosts`); startup preflight repairs ownership of the explicit top-level `access.log`, `audit.jsonl`, and `cache.log` before Squid drops to the `proxy` user. The scoped, best-effort repair avoids both stale unwritable logs and a new startup-abort path. Upgrade AWF to include github/gh-aw-firewall#8624. | Trigger a blocked-domain or upstream-error diagnostic and confirm `access.log` is readable; after the run, `ls -la <preserved-squid-logs-dir>` should show runner-UID ownership and no `Could not check Squid logs`/`Could not preserve squid logs` messages; recreate Squid through topology startup and confirm `docker compose up -d` succeeds with pre-existing log files | github/gh-aw-firewall#8249, github/gh-aw-firewall#8251, github/gh-aw-firewall#8615, github/gh-aw-firewall#8624 | | ||
| | B34 | `host.docker.internal` or `(host.docker.internal/redacted)` appears in `network.allowDomains`, but an Ollama or other host-side service remains unreachable from inside AWF even when its host port is allowlisted | Host-gateway trigger detection did not recognize the canonical `host.docker.internal` keyword or its redacted audit form, so AWF omitted the host-gateway mapping needed to route the request to the runner host | **Fixed in AWF (PR github/gh-aw-firewall#8172, merged 2026-09-05):** host-gateway detection recognizes `host.docker.internal` and `(host.docker.internal/redacted)` forms and emits the required host mapping. Upgrade AWF to include github/gh-aw-firewall#8172. | Inspect generated `docker-compose.yml` for the `host.docker.internal:host-gateway` mapping and verify `getent hosts host.docker.internal` plus a request to the allowlisted host service from inside the agent | github/gh-aw-firewall#8172 | | ||
| | B36 | With `runtimes: uv` and `--env-all`, the first `uv` command fails with `Permission denied` under `UV_CACHE_DIR` and the agent may spend turns selecting its own cache directory | `--env-all` forwarded setup-uv's `$RUNNER_TEMP/setup-uv-cache` and `$RUNNER_TEMP/uv-python-dir`, but only the read-only `$RUNNER_TEMP/gh-aw` subtree is mounted | **Fixed in AWF (PR github/gh-aw-firewall#9705, merged 2026-10-08; fixes github/gh-aw-firewall#9701):** unmounted absolute paths beneath `$RUNNER_TEMP` are dropped from `--env-all`; explicit `--env` still overrides the filter. Keep those cache directories unwritable so setup-uv cannot save agent-written files into the repository-wide Actions cache. Disabling setup-uv caching is tracked on the gh-aw compiler side. Upgrade AWF to include github/gh-aw-firewall#9705. | `printf '%s\\n' \"${UV_CACHE_DIR:-unset}\" \"${UV_PYTHON_INSTALL_DIR:-unset}\"` — unpatched AWF shows paths under `$RUNNER_TEMP` outside `gh-aw`; patched AWF unsets them unless explicitly overridden, and `uv` falls back to `~/.cache/uv`. This probe writes no files. | github/gh-aw-firewall#9701, github/gh-aw-firewall#9705 | |
| | B33 | `[DEBUG] Could not check Squid logs: EACCES ... access.log` during diagnostics, or `[DEBUG] Could not preserve squid logs: chmod ... Operation not permitted` during artifact preservation, although logs are intact | Squid writes logs as UID 13; the previous shutdown-time repair only changed mode bits, ran after mid-run diagnostics, and never transferred ownership to the runner before artifact preservation | **Fixed in AWF (PR github/gh-aw-firewall#8251, merged 2026-09-07):** reusable `fixSquidLogPermissions()` now `chown`s to the runner UID/GID via `docker exec -e` and `chmod`s; `runAgentCommand()` repairs permissions before `checkSquidLogs()`, and preserved-log `chmod` is reported separately after rename. **Additional fix (PR github/gh-aw-firewall#8624, merged 2026-09-16):** topology startup can recreate Squid mid-run (for example, for new `extra_hosts`); startup preflight repairs ownership of the explicit top-level `access.log`, `audit.jsonl`, and `cache.log` before Squid drops to the `proxy` user. The scoped, best-effort repair avoids both stale unwritable logs and a new startup-abort path. Upgrade AWF to include github/gh-aw-firewall#8624. | Trigger a blocked-domain or upstream-error diagnostic and confirm `access.log` is readable; after the run, `ls -la <preserved-squid-logs-dir>` should show runner-UID ownership and no `Could not check Squid logs`/`Could not preserve squid logs` messages; recreate Squid through topology startup and confirm `docker compose up -d` succeeds with pre-existing log files | github/gh-aw-firewall#8249, github/gh-aw-firewall#8251, github/gh-aw-firewall#8615, github/gh-aw-firewall#8624 | | ||
| | B34 | `host.docker.internal` or `(host.docker.internal/redacted)` appears in `network.allowDomains`, but an Ollama or other host-side service remains unreachable from inside AWF even when its host port is allowlisted | Host-gateway trigger detection did not recognize the canonical `host.docker.internal` keyword or its redacted audit form, so AWF omitted the host-gateway mapping needed to route the request to the runner host | **Fixed in AWF (PR github/gh-aw-firewall#8172, merged 2026-09-05):** host-gateway detection recognizes `host.docker.internal` and `(host.docker.internal/redacted)` forms and emits the required host mapping. Upgrade AWF to include github/gh-aw-firewall#8172. | Inspect generated `docker-compose.yml` for the `host.docker.internal:host-gateway` mapping and verify `getent hosts host.docker.internal` plus a request to the allowlisted host service from inside the agent | github/gh-aw-firewall#8172 | | ||
| | B35 | After a workflow using `tools.cache-memory` completes inside AWF, the host-side `validateMemoryStep` (gh-aw ≥ v0.89.21) fails with `EACCES: permission denied` writing `/tmp/gh-aw/memory-validation/cache-default.ok` | AWF remaps the agent UID/GID before running the command, while `/tmp` is bind-mounted read-write into the chroot. Files and directories created under `/tmp/gh-aw` can therefore have ownership and modes that prevent the original host runner identity from writing there after the container exits | **Fixed in AWF (PR github/gh-aw-firewall#9029, merged 2026-09-26; closes github/gh-aw-firewall#9028):** the agent entrypoint sets `umask 0002` for the user command and runs root-owned `relax_gh_aw_shared_permissions()` after normal or signal-driven command exit to `chmod -R g+w` the `/tmp/gh-aw` tree without making it world-writable. Upgrade AWF to include github/gh-aw-firewall#9029; prefer `sudo awf` over invoking AWF as native root so the UID/GID remap matches the host runner user. | After a `cache-memory`-enabled AWF run, inspect `ls -la /tmp/gh-aw/memory-validation` (or another host-side-touched `/tmp/gh-aw` path); on affected builds, differing owner and no group-write bit reproduce the mode. On patched builds, entries show `g+w` with a group matching the runner user's GID and `validateMemoryStep` succeeds | github/gh-aw#63472, github/gh-aw-firewall#9028, github/gh-aw-firewall#9029 | | ||
| | B36 | The first `uv` command fails with `Permission denied` under `UV_CACHE_DIR` when `runtimes: uv` is used with `--env-all`; the agent may then repeatedly choose its own cache directory | `--env-all` forwarded `UV_CACHE_DIR=$RUNNER_TEMP/setup-uv-cache` and `UV_PYTHON_INSTALL_DIR=$RUNNER_TEMP/uv-python-dir`, but only `$RUNNER_TEMP/gh-aw` is mounted and it is read-only | **Fixed in AWF (PR github/gh-aw-firewall#9705, merged 2026-10-08; fixes github/gh-aw-firewall#9701):** unmounted absolute paths under `$RUNNER_TEMP` are dropped from `--env-all`; explicit `--env` values still override the filter. Keep these cache directories unwritable so setup-uv cannot save agent-written files into the repository-wide Actions cache. Disabling setup-uv caching is tracked on the gh-aw compiler side. Upgrade AWF to include github/gh-aw-firewall#9705. | Read only the two variables: `printf '%s\\n' \"${UV_CACHE_DIR:-unset}\" \"${UV_PYTHON_INSTALL_DIR:-unset}\"`. On unpatched AWF they point under `$RUNNER_TEMP` outside `gh-aw`; on patched AWF they are unset unless explicitly overridden, and `uv` falls back to `~/.cache/uv`. | github/gh-aw-firewall#9701, github/gh-aw-firewall#9705 | |
| "rootCause": "--env-all forwarded setup-uv cache and Python-install paths beneath RUNNER_TEMP into the agent, but only RUNNER_TEMP/gh-aw is mounted and that mount is read-only, leaving those paths unwritable.", | ||
| "probe": { | ||
| "command": "printf '%s\\n' \"${UV_CACHE_DIR:-unset}\" \"${UV_PYTHON_INSTALL_DIR:-unset}\"", | ||
| "expect": "On unpatched AWF, the variables point beneath RUNNER_TEMP outside the mounted gh-aw subtree; on patched AWF they are unset unless explicitly overridden, and uv uses its default under ~/.cache/uv. No files are written.", |
|
@copilot merge main and address review feedback |
…r-doctor-update Co-authored-by: lpcox <[email protected]>
Merged |
|
@copilot merge main and resolve conflicts |
…r-doctor-update # Conflicts: # .github/workflows/self-hosted-runner-doctor.lock.yml Co-authored-by: lpcox <[email protected]>
Merged the latest |
|
@copilot merge main and resolve conflicts |
…r-doctor-update Co-authored-by: lpcox <[email protected]>
Merged the latest |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 0ddacf1 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |


With
runtimes: uvand--env-all, setup-uv can pass cache and Python-install paths under$RUNNER_TEMPinto the agent, where those unmounted paths are unwritable. AWF drops those paths unless explicitly overridden with--env.$RUNNER_TEMPpermission-error guidance to the shared catalog, workflow prompt, and portable agent.