Troubleshooting
This guide covers common problems and their solutions. Check your issue below.
MCP Connection Issues
MCP server fails to start
Symptom: Error: Cannot find module or MCP tools unavailable in Claude Code
Solutions:
- Verify Node.js is installed:
node --version # Should be 22+- Check the script path is absolute (not relative):
# ❌ Bad: "args": ["./preqstation-mcp-server.mjs"]# ✅ Good: "args": ["/Users/kendrick/projects/preqstation-skill/scripts/preqstation-mcp-server.mjs"]- Verify the script file exists:
ls -la /path/to/preqstation-skill/scripts/preqstation-mcp-server.mjs- Check environment variables are set:
echo $PREQSTATION_API_URLecho $PREQSTATION_TOKEN- Restart Claude Code or re-add the MCP server:
claude mcp remove preqstationclaude mcp add -s user \ --env='PREQSTATION_API_URL=https://...' \ --env='PREQSTATION_TOKEN=preq_...' \ preqstation -- node /path/to/preqstation-mcp-server.mjsTools appear in MCP but return errors
Symptom: preq_list_tasks or other tools fail with 401 Unauthorized
- Verify token format (should start with
preq_):
echo $PREQSTATION_TOKEN # Should output: preq_xxxxxxxxx- Verify token is not expired:
- Go to projects-manager UI → Settings → API Keys
- Check token creation date and expiration
- Generate a new token if needed
- Test connectivity directly:
curl -H "Authorization: Bearer $PREQSTATION_TOKEN" \ "$PREQSTATION_API_URL/api/health"# Should return: {"status":"ok"}- Verify API URL is correct (must include protocol):
# ❌ Bad: "preqstation-lp.vercel.app"# ✅ Good: "https://preqstation-lp.vercel.app"Token & Authentication Issues
”Invalid token” error on every MCP call
Symptom: Token auth fails even with correct-looking token
Check: In projects-manager UI, go to Settings → API Keys and check expiration date.
Fix: Generate a new token:
- Click “New Token”
- Copy the new token value
- Update
PREQSTATION_TOKENenvironment variable - Re-register MCP server with new token
Check: List tokens in Settings → API Keys to see if token is still there.
Fix: Generate a fresh token (old one may have been revoked).
Check: Environment variable and MCP config have exact token value.
Problem: Token was pasted with extra spaces or quotes.
Fix:
# ❌ Bad:export PREQSTATION_TOKEN=" preq_xxxxx " # spaces!
# ✅ Good:export PREQSTATION_TOKEN="preq_xxxxx" # no extra spacesWorktree & Git Issues
Worktree conflicts or cleanup failures
Symptom: fatal: invalid reference: <branch> or stale worktree directory
Solutions:
- List existing worktrees:
git -C <project_cwd> worktree list- Remove stale worktrees:
git -C <project_cwd> worktree remove <path> --forcegit -C <project_cwd> worktree prune- If worktree is locked:
git -C <project_cwd> worktree unlock <path>git -C <project_cwd> worktree remove <path> --force- Check for corrupted
.git/worktrees/directory:
ls -la <project_cwd>/.git/worktrees/# If corrupted, delete the lock file:rm <project_cwd>/.git/worktrees/<worktree_name>/lockedRemote push verification fails
Symptom: failed: ... - Remote push verification failed
Cause: deploy_commit_on_review=true requires successful push before completing task.
Check:
git -C <project_cwd> branch -r | grep <branch_name># Or:git ls-remote --heads origin <branch_name>Fix:
- Manually push the branch:
git -C <project_cwd> push origin <branch_name>- Then call
preq_complete_taskagain
Cause: Branch created locally but with different name.
Check: Compare local vs. resolved branch name:
git -C <project_cwd> branch# Expected: preqstation/PROJ/feature-nameFix: Push with correct name or use preq_complete_task with branchName parameter.
Build & Compilation Errors
”npm install” fails in worktree
Symptom: npm ERR! 404 Not Found or dependency resolution errors
Check: Use the package manager already configured by the repo.
Fix: Do not delete lockfiles as a first step. Run the repo’s intended install command instead:
# examplespnpm installnpm installyarn installCheck:
node --versioncat <cwd>/.nvmrc # If using nvmFix: Use correct Node version:
nvm use # If .nvmrc existsnode --version # Should match project requirementsCheck: .npmrc credentials or package.json scoped packages.
Fix:
# Ensure .npmrc has auth token for private registry:echo "@scope:registry=https://npm.example.com" >> ~/.npmrcecho "//npm.example.com/:_authToken=YOUR_TOKEN" >> ~/.npmrcProject Mapping Issues
”Project path not found”
Symptom: OpenClaw asks for a project path even though you thought it was already configured.
Solutions:
-
Confirm the mapping exists in OpenClaw agent memory.
-
If you use the sample
MEMORY.mdformat as a reference, check that the row looks like:
| key | cwd | note ||-----|-----|------|| proj | /absolute/path | Description |- Verify the project key matches the task prefix:
PRJ-284should normally map toprj
- Ensure paths are absolute (not relative):
# ✅ Good: /Users/kendrick/projects/exampleOpenClaw Execution Issues
Session never completes or seems stuck
Symptom: Process shows no output for hours, or stuck at same log line
Solutions:
- Check session status:
process action:poll sessionId:<id>- Read last 100 lines of output:
process action:log sessionId:<id> | tail -100- If truly stuck, kill the session:
process action:kill sessionId:<id>- Check for infinite loops or blocking I/O:
# Common causes:# - npm install hung on network# - Interactive prompts waiting for input# - Subprocess blocking on child process“Permission denied” when accessing project files
Symptom: Error: EACCES: permission denied in worktree
Solutions:
- Verify directory permissions:
ls -ld <project_cwd># Should be readable/writable by current user- Check worktree permissions:
ls -ld <cwd>chmod -R u+rw <cwd> # If needed- Ensure Git can write to worktree:
touch <cwd>/.test-writerm <cwd>/.test-writeCommon Mistakes
❌ Forgetting to update OpenClaw project mappings
Issue: OpenClaw can’t resolve project path, requires manual input each time.
Fix: Update the OpenClaw mapping whenever you clone a new project or change paths. If you keep a reference MEMORY.md, keep that in sync too:
| key | cwd | note ||-----|-----|------|| newproj | /absolute/path | Added 2026-03-06 |❌ Using relative paths in project mappings
Issue: Worktree creation fails because path doesn’t expand.
Fix: Always use absolute paths:
# Get absolute path:pwd # from within the project❌ Not cleaning up old worktrees
Issue: Disk fills up, performance degrades.
Fix: Periodic cleanup:
git -C <project_cwd> worktree listgit -C <project_cwd> worktree remove <old_path> --forcegit -C <project_cwd> worktree prune❌ Expecting PREQ tools without MCP
Issue: preq_* tools are unavailable because the MCP server was never registered.
Fix: Ensure the PREQSTATION MCP server is registered:
claude mcp list | grep preqstationGetting Help
If you’ve checked all above:
-
Gather diagnostics:
Terminal window echo "API URL: $PREQSTATION_API_URL"echo "Token format: ${PREQSTATION_TOKEN:0:4}... (masked)"node --versiongit --versionnpm --version -
Test basic connectivity:
Terminal window curl -H "Authorization: Bearer $PREQSTATION_TOKEN" \"$PREQSTATION_API_URL/api/health" | jq . -
Check logs:
- Claude Code: Settings → Logs
- OpenClaw: Session output via
process action:log - projects-manager: Vercel dashboard logs
-
File an issue with:
- System info (OS, Node version)
- Error message (full stack trace)
- Steps to reproduce
- Diagnostics output (without exposing tokens)