Skip to content

fix: diagnose ARC/DinD DNS isolation and quiet rootless chmod noise#6328

Merged
lpcox merged 3 commits into
mainfrom
fix/arc-dind-dns-diagnosis-and-chmod-noise
Jul 17, 2026
Merged

fix: diagnose ARC/DinD DNS isolation and quiet rootless chmod noise#6328
lpcox merged 3 commits into
mainfrom
fix/arc-dind-dns-diagnosis-and-chmod-noise

Conversation

@lpcox

@lpcox lpcox commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Addresses two of the four ARC/DinD implementation gaps identified in #6326. Both are self-contained, testable code changes that directly reduce the user confusion reported in gh-aw#40107.

Gap 3 — DinD-spawned containers cannot resolve Kubernetes DNS names

Problem: When AWF components (e.g. the external DIFC proxy) are addressed by a Kubernetes Service name such as awmg-cli-proxy, the cli-proxy fails with getaddrinfo EAI_AGAIN. Containers created by the Docker-in-Docker daemon run on the DinD Docker network, which does not forward DNS to the Kubernetes cluster resolver. The previous error — awf-cli-proxy could not connect to the external DIFC proxy — hid this root cause, leaving operators stuck (see the reproduction in gh-aw#40107).

Fix: Added detectDnsResolutionFailure() in container-startup-diagnostics.ts, which scans the cli-proxy container logs for EAI_AGAIN/ENOTFOUND and extracts the unresolved hostname. When present, createCliProxyStartupError() now appends an actionable explanation of the DNS-isolation root cause and concrete fixes (address the proxy by IP, or configure dockerd --dns <kube-dns-ip>), plus a link to the ARC/DinD guide.

Gap 4 — post-job chmod noise on rootless/non-privileged runners

Problem: The best-effort artifact permission repair emitted an alarming [WARN] Rootless artifact permission repair failed ... when the repair container was denied CHOWN/chmod (Operation not permitted) on restricted runners. Because the agent has already finished and artifacts remain readable by the owning user, this warning is non-actionable and confuses users into thinking something broke.

Fix: In artifact-permissions.ts, benign permission errors (Operation not permitted, Permission denied, EPERM, EACCES) are now logged at debug with a clear "expected on restricted runners" note. Genuine, unexpected failures (e.g. missing image) still surface as WARN.

Testing

  • npm run type-check — passes
  • npm run lint — 0 errors (only pre-existing warnings in untouched lines)
  • npm run test:unit — all tests pass except one pre-existing, environment-dependent failure in compose-generator.test.ts (macOS /tmp/private/tmp symlink; fails on main too, unrelated to this change)
  • Added unit tests:
    • detectDnsResolutionFailure: EAI_AGAIN extraction, ENOTFOUND extraction, no-failure, non-zero exit, exception handling
    • fixArtifactPermissionsForRootless: benign permission error no longer emits WARN

Not included (tracked in #6326)

Closes part of #6326.

Addresses two of the ARC/DinD implementation gaps from #6326.

Gap 3 — DinD-spawned containers cannot resolve Kubernetes DNS names:
When the external DIFC proxy is addressed by a Kubernetes Service name
(e.g. awmg-cli-proxy), the cli-proxy fails with getaddrinfo EAI_AGAIN
because containers on the DinD Docker network do not reach the Kubernetes
cluster DNS resolver. The previous 'could not connect to the external DIFC
proxy' error hid this root cause. Add detectDnsResolutionFailure() which
scans cli-proxy logs for EAI_AGAIN/ENOTFOUND and, when found, augments the
startup error with an actionable DNS-isolation explanation and fix guidance
(address by IP, or configure dockerd --dns).

Gap 4 — post-job chmod noise on rootless/non-privileged runners:
The best-effort artifact permission repair emitted an alarming [WARN] when
the repair container was denied CHOWN/chmod (Operation not permitted) on
restricted runners. The agent has already finished and artifacts remain
readable by the owning user, so downgrade benign permission errors to debug
while keeping WARN for genuine, unexpected failures.

Adds unit tests for both paths. Remaining gaps (#1 topology auto-defaults,
#2 network-isolation smoke-test coverage) are larger and tracked in #6326.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b593fd45-255a-49a2-9d21-fd78108650a2
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 99.02% 99.04% 📈 +0.02%
Statements 98.96% 98.98% 📈 +0.02%
Functions 99.35% 99.35% ➡️ +0.00%
Branches 95.15% 95.14% 📉 -0.01%
📁 Per-file Coverage Changes (4 files)
File Lines (Before → After) Statements (Before → After)
src/container-lifecycle.ts 100.0% → 99.1% (-0.87%) 100.0% → 99.2% (-0.83%)
src/container-startup-diagnostics.ts 98.6% → 98.8% (+0.16%) 98.7% → 98.8% (+0.15%)
src/artifact-permissions.ts 97.0% → 97.3% (+0.33%) 97.0% → 97.3% (+0.33%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

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

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.

Pull request overview

Improves ARC/DinD diagnostics and reduces benign artifact-permission warning noise.

Changes:

  • Detects DNS-resolution failures in CLI proxy logs and provides actionable guidance.
  • Downgrades expected restricted-runner permission errors to debug logging.
  • Adds unit coverage for both behaviors.
Show a summary per file
File Description
src/container-startup-diagnostics.ts Detects unresolved hostnames in container logs.
src/container-startup-diagnostics-coverage.test.ts Tests DNS failure detection.
src/container-lifecycle.ts Adds DNS guidance to CLI proxy startup errors.
src/artifact-permissions.ts Reclassifies expected permission failures.
src/artifact-permissions.test.ts Tests benign permission-error logging.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread src/artifact-permissions.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

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

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 99.02% 99.04% 📈 +0.02%
Statements 98.96% 98.98% 📈 +0.02%
Functions 99.35% 99.35% ➡️ +0.00%
Branches 95.15% 95.14% 📉 -0.01%
📁 Per-file Coverage Changes (4 files)
File Lines (Before → After) Statements (Before → After)
src/container-lifecycle.ts 100.0% → 99.1% (-0.87%) 100.0% → 99.2% (-0.83%)
src/container-startup-diagnostics.ts 98.6% → 98.8% (+0.16%) 98.7% → 98.8% (+0.15%)
src/artifact-permissions.ts 97.0% → 97.3% (+0.33%) 97.0% → 97.3% (+0.33%)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

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

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

Smoke test completed with partial success (File/Bash ✅, Connectivity/MCP ❌). Results posted to PR #6328.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

PR #6328 follows the contribution guidelines in CONTRIBUTING.md: it includes tests, keeps files in src/ and colocated tests, and has a clear description referencing related issues. No comment needed.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

Smoke test comment not posted: add_comment tool errors encountered; tests executed.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Docker Sbx has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude passed

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

PR #6328 appears to satisfy CONTRIBUTING.md: tests are added, the description references related issues, and the changed files are in the right locations; no review comment needed.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot PAT Auth

Test Result
GitHub MCP
GitHub.com HTTP ✅ 200
File Write/Read ⚠️ template vars unexpanded

Overall: PASS (core connectivity verified)
Auth mode: PAT (COPILOT_GITHUB_TOKEN) | PR author: @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 PAT report filed by Smoke Copilot PAT
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Overall result: ✅ PASS

Check Status
API status ✅ PASS
gh check ✅ PASS
File status ✅ PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Smoke Claude for #6328 · 55.6 AIC · ⊞ 3.3K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅ PASS

Test Result
GitHub MCP Connectivity
GitHub.com HTTP 200
File Write/Read
BYOK Inference Path

Status: Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

  • Redis PING: ❌ (host.docker.internal DNS not resolvable; fallback 172.17.0.1 unreachable)
  • PostgreSQL pg_isready: ❌ (no response on port 5432)
  • PostgreSQL SELECT 1: ❌ (connection failed)

Overall: FAIL

host.docker.internal cannot be resolved from this runner; Docker bridge 172.17.0.1 also unreachable. Service containers are not accessible.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result Notes
Module Loading ✅ Pass otel.js loaded; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, and internal helpers
Test Suite ✅ Pass 59 tests passed, 0 failed across 2 suites (otel.test.js, otel-fanout.test.js)
Env Var Forwarding ✅ Pass OTEL_* vars auto-forwarded to api-proxy container (verified in agent-environment-credentials.test.ts)
Token Tracker Integration ✅ Pass onUsage callback present in token-tracker-http.js as OTEL hook point
OTEL Diagnostics ✅ Pass ProxyAwareOtlpExporter and FileSpanExporter tested; all span lifecycle functions operational

All 5 scenarios passed. OTEL tracing integration is working correctly.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor
  • MCP connectivity: ✅
  • GitHub.com connectivity: ✅
  • File write/read: ✅
  • BYOK inference: ✅

Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra
PASS

cc @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

fix: diagnose ARC/DinD DNS isolation and quiet rootless chmod noise

✅ Reviewed: chore: upgrade gh-aw extension to latest pre-release
✅ Reviewed: [Test Coverage] container-lifecycle.ts and compose-generator.ts
✅ Playwright: GitHub title verified
✅ Temp file: /tmp/gh-aw/agent/smoke-test-codex-29603806570.txt
✅ Build: npm ci && npm run build
❌ Discussion comment: unavailable (discussion writes disabled)

Overall: FAIL

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • awmgmcpg
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.18.0 v22.23.1
Go go1.22.12 go1.22.12

Not all runtimes match between host and chroot environment. smoke-chroot label not added.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

Test Result
GitHub MCP connectivity ❌ Unavailable in agent
GitHub.com HTTP (pre-step) ❌ Template vars not expanded
File write/read (pre-step) ❌ Template vars not expanded

Overall: FAIL

Pre-step outputs (steps.smoke-data.outputs.*) were not expanded — data was not passed to the agent.

@lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results: Gemini

  • GitHub MCP Testing: ✅ (Functional, results filtered by policy)
  • GitHub.com Connectivity: ✅ (HTTP 200 via Squid proxy)
  • File Writing Testing: ✅ (PASSED)
  • Bash Tool Testing: ✅ (PASSED)

Overall Status: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox
${{ steps.smoke-data.outputs.SMOKE_PR_DATA }}
GitHub MCP testing ✅
GitHub.com connectivity ✅
File I/O test ✅
Direct BYOK inference ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Overall: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Build Test Suite for #6328 · 28.9 AIC · ⊞ 6.9K ·
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Docker Sbx — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity
File write/read (smoke-test-docker-sbx-29603806511.txt)

Overall: PASS@lpcox

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

@lpcox
lpcox merged commit 80332a6 into main Jul 17, 2026
137 checks passed
@lpcox
lpcox deleted the fix/arc-dind-dns-diagnosis-and-chmod-noise branch July 17, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants