Skip to content

Working directory may be corrupted when process dies while .git/config.lock exists and checkout will always fail #2117

Open
@thomasjahoda

Description

@thomasjahoda

If the process dies while updating the local Git config file, the working directory for the current runner may be corrupted (.git/config.lock keeps existing) and actions/checkout@v4 will always fail.

We had the following error while running a GitHub action in a Docker container:

Run actions/checkout@v4
[...]
Setting up auth
  [...]
  Error: error: could not lock config file .git/config: File exists

How to reproduce

Create the lockfile in the action-runner working directory: touch .git/config.lock to simulate the corrupted state when the process dies during checkout.
Start some workflow running "actions/checkout@v4".

Expected behavior

actions/checkout@v4 detects the corrupted state and removes the whole repository.

Actual behavior

Error.

Workaround

Manually clean the working directory of the action-runner.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @thomasjahoda

      Issue actions

        Working directory may be corrupted when process dies while .git/config.lock exists and checkout will always fail · Issue #2117 · actions/checkout