anthropics / anthropics/claude-code-action
Installation fails: stale lock file causes 'another process is currently installing' after timeout
- Ngôn ngữ chính
- TypeScript
- Star
- 8.9k
- Fork
- 2.1k
- Merge trung bình
- 3 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 10
Mô tả
## Description
The Claude Code installation fails due to a stale lock file. When the first installation attempt times out, the lock file is left behind, causing subsequent retry attempts to fail with "another process is currently installing Claude". The action then reports success but the `claude` binary is not available in PATH.
## Environment
- **Action version**: v1.0.21 (`a7e4c51380c42dd89b127f5e5f9be7b54020bc6b`)
- **Claude Code version**: 2.0.50 (as specified in action)
- **Runner**: `ubuntu-latest`
- **Trigger**: `pull_request_target`
## Steps to Reproduce
1. Create a workflow using `anthropics/claude-code-action@v1.0.21`
2. Configure with `claude_code_oauth_token`
3. Trigger the workflow
4. Observe installation timeout on first attempt
5. Observe lock file error on retry attempts
## Expected Behavior
- Installation should complete successfully
- If timeout occurs, lock files should be cleaned up before retry
- `claude` binary should be available in PATH after "Installation complete" message
## Actual Behavior
1. **Attempt 1**: Times out after ~2 minutes
```
Installing Claude Code v2.0.50...
Installation attempt 1...
Setting up Claude Code...
Installation failed, retrying...
```
2. **Attempt 2**: Fails due to stale lock file
```
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
```
3. **Contradictory success**: Reports success despite failure
```
✅ Installation complete!
Claude Code installed successfully
```
4. **Execution failure**: `claude` is not in PATH
```
Full command: claude -p --model sonnet ...
Error spawning Claude process:
error: Executable not found in $PATH: "claude"
```
## Full Workflow Logs
See: https://github.com/sjnims/requirements-expert/actions/runs/19787171331
## Workflow Configuration
```yaml
- name: Run Claude Code Review
uses: anthropics/claude-code-action@a7e4c51380c42dd89b127f5e5f9be7b54020bc6b # v1.0.21
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
prompt: |
# ... review prompt ...
claude_args: '--model sonnet --allowed-tools "Read,Grep,Bash(gh issue view:*),..."'
```
## Suggested Fix
1. Add lock file cleanup before each installation retry attempt
2. Add `--force` flag to retry attempts to override stale locks
3. Validate that `claude` binary is actually in PATH before reporting "Installation complete"
4. Consider increasing the timeout or making it configurable
## Related Issues
- #693 - "Setting up Claude Code" timeouts in workflow
- #694 - chore: add retry loop to Claude Code installation
- #700 - fix: use cross-platform timeout for Claude Code installation
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.