Troubleshooting¶
Executor Not Finding Issues¶
Symptom: Executor runs but issue_json='' in logs, never picks up agent-ready issues.
Cause: LaunchAgent using /bin/zsh instead of /bin/bash. Zsh doesn't support BASH_SOURCE, which silently breaks the repo search query.
Fix:
# Check what shell the plist uses
grep -A2 ProgramArguments ~/Library/LaunchAgents/ai.invotek.mac-executor.plist
# Must show /bin/bash, NOT /bin/zsh
# If wrong, edit the plist and restart
Duplicate PRs¶
Symptom: Two identical PRs for the same issue.
Cause: gh pr create returned an error but the PR was actually created. Executor marked as agent-failed and retried.
Fix: Fixed in mac-executor PR #12. The executor now:
- Checks if PR exists before reporting failure
- Excludes
agent-failedissues from search query
gh pr create Fails But PR Exists¶
Symptom: Log shows WARN: gh pr create returned error but PR exists.
Cause: GitHub API returns non-zero exit code despite successfully creating the PR. Root cause unknown — possibly a rate limit warning or redirect.
Impact: None — the executor recovers and reports success.
Token Expired (401 Errors)¶
Symptom: Claude Code returns authentication errors.
Fix:
1. Check token: grep CLAUDE_CODE_OAUTH_TOKEN ~/Library/LaunchAgents/ai.invotek.mac-executor.plist
2. Verify in Bitwarden: "Claude Code OAuth Token (1-Year, Mac Mini)"
3. If expired, renew with claude setup-token (see Authentication)
Executor Not Starting¶
Symptom: launchctl bootstrap fails with "Input/output error".
Fix:
# Check if already running
launchctl list | grep mac-executor
# Force stop
launchctl bootout gui/$(id -u)/ai.invotek.mac-executor 2>/dev/null
# Wait and restart
sleep 3
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.invotek.mac-executor.plist
Build Fails (Xcode Not Found)¶
Symptom: Log shows Xcode: unknown and builds fail.
Fix:
# Check Xcode
xcode-select -p
# If wrong path
sudo xcode-select --switch /Applications/Xcode.app
sudo xcodebuild -license accept
Checking Overall Health¶
# Quick health check
curl -s http://100.92.170.124:8090/health | python3 -m json.tool
# Full status
ssh -i ~/.ssh/mac-executor claude@100.92.170.124 "
echo '=== Executor ==='
launchctl list | grep executor
echo '=== Last 5 log entries ==='
tail -5 ~/.claude/executor-logs/executor.log
echo '=== OpenClaw (iClaw-E) ==='
curl -s http://localhost:18789/health
"