You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[awf] CLI: add --diagnostic-logs flag to capture container logs on failure #2011
When AWF containers fail to start (e.g., Squid crashes on startup in DinD environments), there are no diagnostic logs — docker logs output, container exit codes, and mount info are never captured. Debugging requires customers to manually add diagnostic steps to their workflows.
A customer on ARC runners with DinD sidecars hit a Squid container crash (exit code 1) where the Squid access logs were empty (Squid never started). Diagnosing the root cause required multiple back-and-forth rounds.
Root Cause
The current cleanup lifecycle in src/cli.ts and src/docker-manager.ts calls docker compose down -v and removes the work directory, discarding all docker logs output and container state. There is no mechanism to capture container-level operational logs (stdout/stderr from entrypoints) before teardown.
The --keep-containers flag preserves containers but requires the user to know in advance they need it, and doesn't help for automated CI failures.
Proposed Solution
Add a --diagnostic-logs flag (off by default) to src/cli.ts that, when enabled and AWF exits with a non-zero code, collects container-level diagnostics before teardown:
In src/cli.ts: Add --diagnostic-logs option to the Commander program definition.
In src/docker-manager.ts: Add a collectDiagnostics(workDir, auditDir) function that runs:
Both of these describe the same --diagnostic-logs feature for capturing Docker container logs on AWF failure, which closely matches this issue's proposal. If this work was already completed or the approach changed, it may be worth reviewing those issues.
This is an automated message from the issue duplication detector.
Activity
github-actions commentedon Apr 16, 2026
👋 Hello! I noticed this issue might be related to existing issues:
Both of these describe the same
--diagnostic-logsfeature for capturing Docker container logs on AWF failure, which closely matches this issue's proposal. If this work was already completed or the approach changed, it may be worth reviewing those issues.This is an automated message from the issue duplication detector.
lpcox commentedon Apr 16, 2026
Fixed by #1906 and #1941 (--diagnostic-logs flag for container failure diagnostics). Merged to main.