Skip to content

Document B36 for setup-uv paths under RUNNER_TEMP - #9793

Merged
lpcox merged 6 commits into
mainfrom
copilot/add-b36-runner-doctor-update
Oct 10, 2026
Merged

lpcox merged 6 commits into
mainfrom
copilot/add-b36-runner-doctor-update

Conversation

Copilot AI commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

With runtimes: uv and --env-all, setup-uv can pass cache and Python-install paths under $RUNNER_TEMP into the agent, where those unmounted paths are unwritable. AWF drops those paths unless explicitly overridden with --env.

  • Finding: Add B36 to the canonical runner diagnostics registry, including cause, remediation, and a read-only probe:
    printf '%s\n' "${UV_CACHE_DIR:-unset}" "${UV_PYTHON_INSTALL_DIR:-unset}"
  • Doctor guidance: Add B36 lookup and $RUNNER_TEMP permission-error guidance to the shared catalog, workflow prompt, and portable agent.
  • Generated artifacts: Refresh rendered diagnostic consumers and the runner-doctor workflow lock.

Copilot AI changed the title [WIP] Add B36 runner doctor update for env vars under --env-all Document B36 for setup-uv paths under RUNNER_TEMP Oct 10, 2026
Copilot AI requested a review from lpcox October 10, 2026 20:42
@lpcox
lpcox marked this pull request as ready for review October 10, 2026 20:52
Copilot AI balanced review requested due to automatic review settings October 10, 2026 20:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment on lines +7 to +8
"The first uv command fails with Permission denied under UV_CACHE_DIR",
"The agent repeatedly chooses its own uv cache directory"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

B36

| 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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8156

| 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.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send the code

@lpcox

lpcox commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and address review feedback

Copilot AI commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and address review feedback

Merged main and addressed the B36 review feedback in 6f7d6a9.

@lpcox

lpcox commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

…r-doctor-update

# Conflicts:
#	.github/workflows/self-hosted-runner-doctor.lock.yml

Co-authored-by: lpcox <[email protected]>

Copilot AI commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged the latest main and resolved the runner-doctor lock conflict in 4b16e6b.

@lpcox

lpcox commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

Copilot AI commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged the latest main cleanly; no conflicts needed resolution. Merge commit: fd1f1bd.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-9793 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 0ddacf1

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.11% 93.11% ➡️ +0.00%
Statements 91.65% 91.65% ➡️ +0.00%
Functions 90.34% 90.34% ➡️ +0.00%
Branches 85.41% 85.41% ➡️ +0.00%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-adapter.ts 82.3% → 81.7% (-0.56%) 79.6% → 79.1% (-0.52%)
src/log-directory-setup.ts 96.8% → 100.0% (+3.18%) 96.9% → 100.0% (+3.13%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox
lpcox merged commit 75df01d into main Oct 10, 2026
29 of 31 checks passed
@lpcox
lpcox deleted the copilot/add-b36-runner-doctor-update branch October 10, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🩺 Runner Doctor Update: add B36 (setup-uv RUNNER_TEMP env vars under --env-all)

4 participants