Docs/Troubleshooting

Troubleshooting

Common issues and how to fix them

Troubleshooting

Solutions to common issues you might encounter with Clotion.

Connection Issues

Can't Connect to Notion

Symptoms:

  • Error: "Could not find database"
  • Error: "Invalid API key"
  • No tasks being picked up

Solutions:

  1. Check API key:

    # Verify it starts with secret_
    echo $NOTION_API_KEY
    
  2. Verify database ID:

    • Open your database in Notion
    • Check the URL for the 32-character ID
    • Ensure no extra characters or hyphens
  3. Check integration access:

    • Open your database
    • Click ...Add connections
    • Verify your integration is listed
  4. Test the connection:

    clotion test-connection
    

Tasks Not Being Picked Up

Symptoms:

  • Moving cards to Todo does nothing
  • No activity in Clotion logs

Solutions:

  1. Verify status names match:

    # In .env, must match Notion exactly
    NOTION_STATUS_TODO=Todo  # Case-sensitive!
    
  2. Check polling is running:

    • Look for [INFO] Polling... in logs
    • Increase log level: LOG_LEVEL=DEBUG
  3. Verify the card:

    • Has a title (required)
    • Status is exactly "Todo"
    • Is in the correct database

Task Execution Issues

Claude Not Starting

Symptoms:

  • Task stays in PENDING state
  • No Claude Code output

Solutions:

  1. Check Claude Code CLI:

    claude --version
    claude whoami
    
  2. Verify authentication:

    claude auth status
    
  3. Check worktree creation:

    ls -la /path/to/repo/.worktrees/
    

Tasks Keep Failing

Symptoms:

  • Tasks immediately fail
  • Blocked checkbox gets checked with error

Solutions:

  1. Check the error in the Current Status property

  2. Review logs:

    LOG_LEVEL=DEBUG clotion
    
  3. Common causes:

    • Missing dependencies in target repo
    • Git configuration issues
    • Insufficient permissions

Worktree Creation Fails

Symptoms:

  • Error: "Failed to create worktree"
  • Git errors in logs

Solutions:

  1. Check git status:

    cd /path/to/repo
    git status
    git worktree list
    
  2. Clean up stale worktrees:

    git worktree prune
    
  3. Check disk space:

    df -h
    

Notion Integration Issues

Properties Not Updating

Symptoms:

  • Status changes but other properties stay empty
  • Current Status not updating

Solutions:

  1. Verify properties exist:

    • Open database settings
    • Check for: Blocked, Current Status, Clotion ID, Branch, PR URL
  2. Re-run Clotion:

    • Stop and restart
    • Properties are verified/created on startup
  3. Check property types:

    • Blocked must be Checkbox
    • Others must be Text or URL

Comments Not Detected

Symptoms:

  • Blocked tasks don't resume
  • Your comments are ignored

Solutions:

  1. Check comment polling:

    COMMENT_POLL_INTERVAL=10  # More frequent polling
    
  2. Verify comment location:

    • Comments must be on the card itself
    • Not in the description
  3. Manual unblock:

    clotion unblock CLO-123
    

Wrong Status Values

Symptoms:

  • Cards not detected at correct status
  • State changes not working

Solutions:

  1. Check exact status names:

    • Open your database
    • Click the Status property
    • Copy exact names (including capitalization)
  2. Update .env:

    NOTION_STATUS_TODO=To Do  # If yours has a space
    

Performance Issues

High Memory Usage

Solutions:

  1. Reduce concurrent tasks:

    MAX_CONCURRENT_TASKS=2
    
  2. Check for stuck processes:

    ps aux | grep claude
    

Slow Polling

Solutions:

  1. Adjust poll interval:

    POLL_INTERVAL=5  # Faster polling
    
  2. Note: Notion API has rate limits (3 requests/second)

Slow Task Startup

Solutions:

  1. Pre-fetch base branch:

    cd /path/to/repo
    git fetch origin main
    
  2. Use local base branch:

    • Ensure main is up to date locally

Database Issues

Corrupted Database

Symptoms:

  • SQLite errors in logs
  • Tasks not persisting

Solutions:

  1. Backup and recreate:

    mv clotion.db clotion.db.backup
    clotion  # Creates fresh database
    
  2. Check file permissions:

    ls -la clotion.db
    

Getting Help

If none of these solutions work:

  1. Enable debug logging:

    LOG_LEVEL=DEBUG clotion 2>&1 | tee debug.log
    
  2. Check GitHub Issues: github.com/ianborders/clotion/issues

  3. Open a new issue with:

    • Debug logs (sanitized)
    • Steps to reproduce
    • Environment info (OS, Python version)