Repository navigation
Description
What needs tracking?
Self-hosted runner workspaces outlive a job, and concurrency.cancel-in-progress: true cancels superseded PR runs, sometimes while actions/checkout is writing repository config. The cancelled Git process leaves a zero-byte .git/config.lock; nothing removes it before the next job. That job then fails inside actions/checkout's credential cleanup with error: could not lock config file .git/config: File exists, even though the fetch and git clean -ffdx / reset --hard had already succeeded. Rerunning does not help while the file remains.
Observed on runner R3E-3 in C:\actions-runner-3\_work\dim\dim:
- The lock was timestamped 2026-11-27 17:59 CST, the same minute in which run 45978129985 was cancelled.
- Run 46018200609 (main push, 2026-11-27): the
webjob failed at checkout. - Run 46113838137 (main push, 2026-11-28): the
windows-clijob failed at checkout. - Run 46108329010 (PR, 2026-11-28): the
windows-clijob failed at checkout.
Manual cleanup (removing the file and scanning all 4 runners / 8 workspaces) unblocked CI, but nothing prevents the next cancelled checkout from recreating the lock.
Every ci.yml job that runs on a self-hosted runner has this exposure: changes, dependencies, static-checks, windows-cli, web, scripts, verify, macos-native, acp-registry. The other runners were unaffected only because no checkout was interrupted in their workspaces.
A checked-in composite action cannot run before the first checkout, because its definition is not on disk yet. The cleanup therefore has to be an inline step before each self-hosted checkout, using shell: powershell on Windows (self-hosted Windows does not necessarily have pwsh) and shell: bash on Linux and macOS. Review on #2303 narrowed it to the known config.lock in the checkout the job owns and required the step to verify that checkout before removing the lock; a wider *.lock sweep cannot prove that no other process owns those files. The acp-registry job also checks its .acp-registry checkout.
References or acceptance criteria
- Every self-hosted checkout in
ci.ymlis preceded by a step that removes that checkout's staleconfig.lock, including the second.acp-registrycheckout inacp-registry. - Before removing a lock, the step verifies the checkout root and origin. A missing, unreadable, or different origin leaves the lock untouched and fails with the path; the nested
.acp-registrycheckout must match its registry origin. - The step removes only
config.lockin the checkout the job owns. Wider*.lockcleanup is out of scope because the workflow cannot prove exclusive ownership; a runner instance has its own work directory and runs one job at a time, and maintenance must not run Git in a workspace that may accept a job. - A missing workspace or
.gitproceeds only after absence is confirmed through the workspace parent orRUNNER_WORKSPACE. An inaccessible workspace, inaccessible.git, or a lock that cannot be removed fails the step with an actionable path. - A workflow comment records the ownership assumption.
- Verified by planting
.git/config.lockin the R3E-3 workspace and dispatching the affected job: checkout succeeds and the lock is gone. The next regular PR exercises the Linux path. - The fix travels with the workflow; no manual runner cleanup or runner-side scheduled task is required.
Activity
eric8810 commentedon Nov 28, 2026
Review on #2303 narrowed the cleanup to the known
.git/config.lockper checkout (including.acp-registry) and asked the preflight to distinguish a fresh workspace from inaccessible metadata. Wider*.lockcleanup is out of scope because the workflow cannot prove that no other process owns those locks. Acceptance updated; the PR now carries commit a1121e1.eric8810 commentedon Nov 28, 2026
Two more occurrences of the same class from today's
mainruns:b829ec6c:windows-clifailed insideactions/checkout, before any job step ran.fcd36017:webfailed inactions/checkoutas well, andwindows-clifailed in its daemon-shutdown step in the same run.The first is the lock-file case this issue describes; there is no step output to read, which is what makes it look like a test failure until the job list is opened. Worth having
ci-okname the job and step it failed on, not only that some job failed.eric8810 commentedon Nov 28, 2026
Second review on #2303 required verifying that the Git metadata belongs to the job's checkout and confirming absence instead of treating every failed lookup as a fresh workspace. The PR now checks the checkout root and origin before removing a lock, and accepts a missing workspace only through its parent or the runner work directory. Acceptance updated.