Troubleshooting
Common issues and solutions when running OpenSpider.
Installation Issues
Node.js Version Too Low
Error: Error: OpenSpider requires Node.js version 22 or higher.
Fix: Upgrade Node.js to v22+:
# Using NVM (recommended)
nvm install 22
nvm use 22
nvm alias default 22
# Verify
node --versionopenspider Command Not Found
Error: zsh: command not found: openspider
Fix: Re-link the CLI:
cd /path/to/OpenSpider
npm run build:backend
npm linkIf using NVM, ensure the correct Node version is active before linking.
Build Errors
Error: TypeScript compilation fails during npm run build:backend
Fix:
# Clear old build artifacts
rm -rf dist/
# Reinstall dependencies
rm -rf node_modules
npm install
# Rebuild
npm run build:backendWhatsApp Issues
QR Code Not Appearing
Possible causes:
- Gateway not running — Start it with
openspider gatewayoropenspider start - Already authenticated — Check
baileys_auth_info/exists (means you're already connected) - Session expired — Delete
baileys_auth_info/and restart to get a fresh QR code
# Force re-authentication
rm -rf baileys_auth_info/
openspider gatewayWhatsApp Disconnects Frequently
Possible causes:
- Phone has poor internet connectivity
- WhatsApp Web session was closed from the phone
- Multiple WhatsApp Web sessions conflicting
Fix:
- Ensure your phone has a stable internet connection
- On your phone: WhatsApp → Settings → Linked Devices → verify the session is active
- Delete
baileys_auth_info/and re-scan the QR code
Agent Not Responding in Groups
Check these settings in workspace/whatsapp_config.json:
- Is the group in
allowedGroups? - Is
groupPolicyset to"allowlist"(default)? - Is the group's mode set to
"mention"? If so, you must @mention the agent - For
"listen"mode, ensure the agent is active and the gateway is running
# Check current config
cat workspace/whatsapp_config.jsonBad MAC Error (Encryption Issues)
Error: Bad MAC or Error: Unsupported state or unable to authenticate data in logs
This occurs when WhatsApp's end-to-end encryption session becomes stale or corrupted after a restart.
OpenSpider v2.0.0 handles this automatically:
- Stale session files are cleared on startup
makeCacheableSignalKeyStoreenables proper session renegotiation- Sent messages are cached for Baileys retry re-relay
If the problem persists:
# Force full session reset
rm -rf baileys_auth_info/session-*.json
pm2 restart allTIP
You do NOT need to delete creds.json — only the session-*.json files. Your WhatsApp pairing is preserved.
Messages Being Dropped Intermittently
Symptom: The first message after restart fails, or messages are silently dropped.
Possible causes:
- Processing lock not properly released — Fixed in v2.0.0 with lock cleanup on all early-return paths
- Stale encryption sessions — Fixed with automatic session cleanup on startup
Fix: Upgrade to v2.0.0 and rebuild:
npm run build:backend
pm2 restart allVoice Notes Not Working
Symptom: Agent doesn't respond with voice, or voice transcription fails.
Fix:
- Verify dependencies are installed:
which ffmpeg # Required for audio conversion
which whisper # Required for transcriptionCheck ElevenLabs API key in
voice_config.jsonor dashboard (Channels → WhatsApp → Voice Settings)Check server logs for errors:
pm2 logs openspider-gateway --lines 50See Voice Messages for full setup instructions.
Server Issues
Port 4001 Already in Use
Error: EADDRINUSE: address already in use :::4001
Fix:
# Find what's using the port
lsof -i :4001
# Kill the process
kill -9 <PID>
# Or stop existing OpenSpider daemon
openspider stopPM2 Issues
Problem: openspider start fails or daemon won't start
Fix:
# Check PM2 status
npx pm2 list
# Kill all PM2 processes
npx pm2 kill
# Restart fresh
openspider startDashboard Not Loading
Possible causes:
- Dashboard not built — Run
cd dashboard && npm run build - Gateway not running — The server serves the dashboard
- Wrong URL — Ensure you're visiting
http://localhost:4001
# Build the dashboard
cd dashboard && npm install && npm run build
# Restart the server
openspider stop && openspider startLLM Provider Issues
API Key Invalid
Error: Authentication failed or Invalid API key
Fix:
- Check your
.envfile for the correct key variable - Verify the key is valid on the provider's website
- Ensure no extra whitespace or quotes around the key
# View current model config
openspider models listModel Not Found
Error: Model not found or Invalid model
Fix: Update GEMINI_MODEL (or the relevant model variable) in .env to a valid model name.
Common valid models:
| Provider | Example Models |
|---|---|
| Google Gemini | gemini-2.5-pro, gemini-2.5-flash |
| Anthropic | claude-opus-4, claude-sonnet-4 |
| OpenAI | gpt-4o, gpt-4-turbo |
| Ollama | llama3, mistral, codellama |
Ollama Not Connecting
Error: Cannot connect to Ollama
Fix:
- Ensure Ollama is running:
ollama serve - Check it's on the default port:
http://localhost:11434 - Verify model is downloaded:
ollama list
Email Issues
OAuth Setup Fails
Error: OAuth Authentication failed
Fix:
- Ensure you downloaded the correct JSON (OAuth Client ID, Desktop application type)
- Verify the Gmail API is enabled in your Google Cloud project
- Try the setup again:
openspider tools email setupTest Email Not Sending
Error: Test email failed with exit code 1
Fix:
- Ensure setup was completed:
openspider tools email setup - Verify
workspace/gmail_token.jsonexists - Check Python 3 is available:
python3 --version - Try resending:
openspider tools email test --to your@email.comDebugging Tips
View Live Logs
# From background daemon
openspider logs
# Or PM2 directly
npx pm2 logs openspider-gateway --lines 200Check System State
# Daemon status
npx pm2 list
# Current config
openspider models list
# WhatsApp config
cat workspace/whatsapp_config.json
# Cron jobs
cat workspace/cron_jobs.jsonReset Everything
If all else fails, perform a clean reset:
# Stop daemon
openspider stop
# Remove generated state (keeps config)
rm -rf baileys_auth_info/
rm -rf dist/
# Rebuild
npm install
npm run build
# Reconfigure
openspider onboard
# Start fresh
openspider startNeed Help?
Check the GitHub Issues page or file a new issue with your error logs.