Skip to content

Installation fails with lock contention: 'another process is currently installing Claude' #777

@pinkwerks

Description

@pinkwerks

Description

The Claude Code installation in GitHub Actions fails intermittently with a lock contention error, even when there's no obvious concurrent installation happening.

Error Message

Installation attempt 1...
Setting up Claude Code...
[~2 minute hang]
Installation failed, retrying...

Installation attempt 2...
Setting up Claude Code...
✘ Installation failed

Could not install - another process is currently installing Claude. Please try
again in a moment.

Try running with --force to override checks

Environment

  • GitHub-hosted runner (ubuntu-latest)
  • Action version: anthropics/claude-code-action@v1
  • Claude Code version: 2.0.74

Analysis

The first installation attempt appears to hang for ~2 minutes before failing, then subsequent retry attempts hit the lock contention error. This suggests:

  1. The first attempt may leave a stale lock file when it times out/fails
  2. GitHub Actions runners are shared infrastructure, so lock files in global paths can persist across jobs
  3. The retry logic doesn't account for self-inflicted lock contention from the previous failed attempt

Suggested Fixes

  1. Use --force flag on retry attempts after the first failure
  2. Clean up lock files before installation attempts
  3. Use a job-specific or unique installation path to avoid cross-job conflicts
  4. Add better lock file timeout/cleanup logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:installationbugSomething isn't workingduplicateThis issue or pull request already existsinstallationp2Non-showstopper bug or popular feature requestperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions