OpenClaw-Setup/openclaw-setup-max/docs/operations/troubleshooting.md

177 lines
4.1 KiB
Markdown

# OpenClaw + Ollama Troubleshooting (macOS)
This file captures the exact issues we hit on this machine and the fixes that worked.
## Quick Health Check
```bash
openclaw status --deep
openclaw gateway health --json
ollama list
```
## 1) `Operation not permitted` on `/Volumes/Data/openclaw-setups/openclaw-setup-max`
### Symptoms
- `ls: /Volumes/Data/openclaw-setups/openclaw-setup-max: Operation not permitted`
- `bash setup/setup_openclaw_ollama.sh: Operation not permitted`
### Cause
- macOS TCC privacy restrictions for Terminal on external/removable volumes.
### Fix
1. In macOS Settings, grant terminal app access:
- Privacy & Security -> Files and Folders -> Terminal -> Removable Volumes ON
- Privacy & Security -> Full Disk Access -> Terminal ON
2. Restart Terminal.
3. Run script with `bash`:
```bash
bash /Volumes/Data/openclaw-setups/openclaw-setup-max/setup/setup_openclaw_ollama.sh
```
## 2) OpenClaw install failed with `env: npm: No such file or directory`
### Cause
- Broken Homebrew `npm` symlink.
### Fix
```bash
brew reinstall node
node -v
npm -v
```
## 3) Telegram connected but no bot reply
### Symptoms
- Telegram channel shows configured, but bot does not respond to prompts.
- Logs show agent run started but no final answer.
### Checks
```bash
openclaw channels logs --channel telegram
openclaw logs --follow
openclaw pairing list telegram
```
### Common causes and fixes
1. Model lacks tool support (example: `deepseek-coder-v2:16b`):
```bash
openclaw models set ollama/qwen3:14b
```
2. Missing Ollama auth in runtime env:
```bash
export OLLAMA_API_KEY="ollama-local"
openclaw gateway run --force
```
3. Pairing not approved:
```bash
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
```
## 4) Gateway timeout / closed connection errors
### Symptoms
- `gateway timeout after 10000ms`
- `gateway closed (1006 abnormal closure)`
- Port appears in-use but gateway is not responsive.
### Cause
- Stale/suspended OpenClaw process holding lock state.
- LaunchAgent using outdated gateway command.
### Recovery
```bash
# Remove stale local processes
pkill -f openclaw-gateway 2>/dev/null || true
pkill -f 'openclaw gateway' 2>/dev/null || true
# Verify port
lsof -nP -iTCP:18789 -sTCP:LISTEN
# Start clean in foreground
export OLLAMA_API_KEY="ollama-local"
openclaw gateway run --force
```
## 5) LaunchAgent service not staying up
### Symptoms
- `openclaw gateway status` shows loaded but not running.
- Launchd reports exit code `78: EX_CONFIG`.
### Fix that worked
- Ensure LaunchAgent command includes `gateway run`.
- Keep logs in `/tmp` (avoids potential external-volume path issues).
File:
- `~/Library/LaunchAgents/ai.openclaw.gateway.plist`
Expected ProgramArguments section:
```xml
<array>
<string>/opt/homebrew/bin/node</string>
<string>/opt/homebrew/lib/node_modules/openclaw/dist/index.js</string>
<string>gateway</string>
<string>run</string>
<string>--port</string>
<string>18789</string>
</array>
```
Expected log paths:
- `/tmp/openclaw-gateway.launchd.log`
- `/tmp/openclaw-gateway.launchd.err.log`
Reload service:
```bash
launchctl bootout gui/$(id -u)/ai.openclaw.gateway 2>/dev/null || true
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway
```
Verify:
```bash
openclaw status --deep
openclaw gateway health --json
```
## 6) docs/context/BOOT.md hook setup
Workspace boot file:
- `/Volumes/Data/openclaw-setups/openclaw-setup-max/docs/context/BOOT.md`
Hook verify:
```bash
openclaw hooks info boot-md
```
If workspace changes:
```bash
openclaw config set agents.defaults.workspace /Volumes/Data/openclaw-setups/openclaw-setup-max
```
## 7) Recommended local model defaults
Good local defaults for this machine:
- `ollama/qwen3:14b` (fastest stable)
- `ollama/devstral:24b` (better coding quality, slower)
Set default:
```bash
openclaw models set ollama/qwen3:14b
```
## 8) Security cleanup after setup
Rotate secrets if they were ever visible in logs/screens:
1. Telegram bot token (via `@BotFather`)
2. OpenClaw gateway token
Then restart gateway.