Skip to content

Debug Guide

Terminal window
snippbot doctor

This checks Python version, disk space, port availability, database integrity, API key presence, and server connectivity. Use --fix to attempt automatic resolution:

Terminal window
snippbot doctor --fix

All logs are written to ~/.snippbot/logs/:

FileContents
daemon.logMain daemon — all requests, errors, task lifecycle
executor.logTask execution — agent prompts, tool calls, outputs
scheduler.logScheduler — job triggers, run outcomes
channel.logChannel adapter — webhook events, routing

Follow logs live:

Terminal window
tail -f ~/.snippbot/logs/daemon.log
tail -f ~/.snippbot/logs/executor.log

Increase verbosity:

Terminal window
snippbot config set log_level debug
snippbot stop && snippbot start

Terminal window
snippbot status
# Or directly:
curl http://localhost:18781/health

If the daemon isn’t running:

Terminal window
snippbot start
# If it crashes on start, check:
tail -20 ~/.snippbot/logs/daemon.log

  1. Is the API reachable?

    Terminal window
    curl http://localhost:18781/health
    # Expected: {"status": "ok", ...}
  2. Is auth working?

    Terminal window
    curl http://localhost:18781/api/auth/validate \
    -H "Authorization: Bearer snip_your_key"
    # Expected: {"valid": true, ...}
  3. Can the AI provider be reached?

    Terminal window
    # Test Anthropic directly
    curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{"model":"claude-haiku-4-5-20251001","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}'
  4. Is the channel adapter running?

    Terminal window
    snippbot channel status
    curl http://localhost:18790/health

All databases are standard SQLite files. Inspect them with any SQLite client:

Terminal window
# Install sqlite3 if needed (usually pre-installed)
sqlite3 ~/.snippbot/snippbot.db
# Useful queries:
.tables # list all tables
SELECT * FROM projects LIMIT 5; # recent projects
SELECT * FROM tasks WHERE status='failed'; # failed tasks
.quit

Check database integrity:

Terminal window
sqlite3 ~/.snippbot/snippbot.db "PRAGMA integrity_check;"
# Expected: ok

All events are written to ~/.snippbot/events.jsonl:

Terminal window
# Watch events in real time
tail -f ~/.snippbot/events.jsonl | python3 -m json.tool
# Filter for specific event types
grep '"task.completed"' ~/.snippbot/events.jsonl | tail -10
# Count events by type
cat ~/.snippbot/events.jsonl | python3 -c "
import sys, json, collections
counts = collections.Counter()
for line in sys.stdin:
try: counts[json.loads(line)['type']] += 1
except: pass
for t, c in counts.most_common(20): print(f'{c:5d} {t}')
"

If nothing else works, reset to a clean state (a backup is always created first):

Terminal window
# List available backups
snippbot reset --list-backups
# Soft reset — re-run setup wizard, keep all data
snippbot reset --soft
# Full reset
snippbot reset
# Restore from backup
snippbot reset --restore pre-install-20260301-120000