Skip to content

[aw-failures] [aw-fix] Rootless chroot hosts-file EACCES crashes awf sandbox config generation (blocks Smoke CI) #46172

Description

@github-actions

Fix the rootless chroot hosts-file write in awf sandbox config generation — it fatally EACCES-crashes every network-isolated agent run

Parent: #46170

Problem statement

In network-isolation mode, awf config generation (writeConfigs, awf-bundle.js:805) aborts with a fatal EACCES while writing the chroot hosts file, killing the agent job before any work runs (token usage 0). This is 100% reproducible on GitHub-hosted rootless runners and is currently failing all Smoke CI agent jobs.

Affected workflows & run IDs

Probable root cause

  1. Uid-remap permission mismatch: chroot dirs are created mode=0600/0700 owned by uid=1001, but under the rootless container remap the effective writer's uid differs from the owner, so the 0700 dir is not traversable/writable → the initial EACCES warning.
  2. Broken fallback: the fallback is supposed to write into hostsRootDir (/tmp/awf-<id>) but instead targets a different, never-created path /tmp/awf-chroot-<y>/hosts — so the "recovery" write is guaranteed to fail fatally.

Proposed remediation

  • Create the chroot hosts directory with group/other-traversable perms appropriate for the rootless remap (e.g. 0711 on parents, 0644 on the hosts file) instead of 0700/0600, or create it under the uid that actually performs the write.
  • Fix the fallback to write into the actual hostsRootDir it just logged, not a newly-constructed /tmp/awf-chroot-* path; reuse the existing verified directory handle.
  • Make the fallback non-fatal: on EACCES, retry via the already-created writable dir and only abort if all candidates fail, with a diagnostic listing attempted paths + stat perms.
  • Add a rootless-runner regression test that exercises writeConfigs under a remapped uid.

Success criteria / verification

Generated by 🔍 [aw] Failure Investigator (6h) · 129.8 AIC · ⌖ 40.7 AIC · ⊞ 5.2K ·

  • expires on Jul 23, 2026, 11:41 PM UTC-08:00

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions