Skip to content

Troubleshooting

This guide helps you resolve common issues with kasl.

Symptoms:

  • kasl watch fails to start
  • No work sessions detected
  • Error messages about permissions

Solutions:

  1. Check permissions:

    Terminal window
    # Linux/macOS
    ls -la ~/.local/share/lacodda/kasl/
    # Windows
    dir "%LOCALAPPDATA%\lacodda\kasl"
  2. Run in foreground for debugging:

    Terminal window
    kasl watch --foreground
  3. Check for existing processes:

    Terminal window
    # Linux/macOS
    ps aux | grep kasl
    # Windows
    tasklist | findstr kasl
  4. Stop existing processes:

    Terminal window
    kasl watch --stop

Symptoms:

  • Work sessions start unexpectedly
  • Pauses not detected properly
  • Inconsistent timing

Solutions:

  1. Adjust configuration:

    Terminal window
    kasl init # Reconfigure monitor settings
  2. Increase thresholds:

    {
    "monitor": {
    "activity_threshold": 60, // Increase from 30
    "pause_threshold": 120, // Increase from 60
    "min_pause_duration": 30 // Increase from 20
    }
    }
  3. Check for background processes:

    Terminal window
    # Linux/macOS
    ps aux | grep -E "(mouse|keyboard|input)"

Symptoms:

  • “database is locked” errors
  • Cannot access data
  • Application crashes

Solutions:

  1. Stop all kasl processes:

    Terminal window
    kasl watch --stop
  2. Check file permissions:

    Terminal window
    # Linux/macOS
    ls -la ~/.local/share/lacodda/kasl/kasl.db
    # Windows
    dir "%LOCALAPPDATA%\lacodda\kasl\kasl.db"
  3. Fix permissions:

    Terminal window
    # Linux/macOS
    chmod 600 ~/.local/share/lacodda/kasl/kasl.db
    chmod 700 ~/.local/share/lacodda/kasl/
  4. Check for corruption:

    Terminal window
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "PRAGMA integrity_check;"

Symptoms:

  • “migration failed” errors
  • Database schema issues
  • Application won’t start

Solutions:

  1. Check migration status:

    Terminal window
    kasl migrations status
  2. View migration history:

    Terminal window
    kasl migrations history
  3. Backup and reset:

    Terminal window
    # Backup current database
    cp ~/.local/share/lacodda/kasl/kasl.db kasl_backup.db
    # Remove database (will be recreated)
    rm ~/.local/share/lacodda/kasl/kasl.db
    # Restart kasl
    kasl watch

Symptoms:

  • “configuration not found” errors
  • Default settings used
  • Cannot save configuration

Solutions:

  1. Check configuration location:

    Terminal window
    # Linux/macOS
    ls -la ~/.local/share/lacodda/kasl/config.json
    # Windows
    dir "%LOCALAPPDATA%\lacodda\kasl\config.json"
  2. Recreate configuration:

    Terminal window
    kasl init
  3. Create directory manually:

    Terminal window
    # Linux/macOS
    mkdir -p ~/.local/share/lacodda/kasl
    # Windows
    mkdir "%LOCALAPPDATA%\lacodda\kasl"

Symptoms:

  • “invalid configuration” errors
  • Application crashes on startup
  • Settings not applied

Solutions:

  1. Validate JSON syntax:

    Terminal window
    # Using Python
    python -m json.tool ~/.local/share/lacodda/kasl/config.json
    # Using jq
    jq . ~/.local/share/lacodda/kasl/config.json
  2. Reset configuration:

    Terminal window
    kasl init --delete
    kasl init
  3. Check for syntax errors:

    Terminal window
    # Common issues:
    # - Missing commas
    # - Extra commas
    # - Unquoted strings
    # - Invalid JSON types

Symptoms:

  • “authentication failed” errors
  • Cannot connect to APIs
  • Session expired messages

Solutions:

  1. Clear cached sessions:

    Terminal window
    # Remove session files
    rm ~/.local/share/lacodda/kasl/.gitlab_session
    rm ~/.local/share/lacodda/kasl/.jira_session
    rm ~/.local/share/lacodda/kasl/.si_session
  2. Reconfigure integration:

    Terminal window
    kasl init
  3. Check credentials:

    • Verify API tokens are valid
    • Check username/password
    • Confirm API URLs
  4. Test connectivity:

    Terminal window
    # Test GitLab
    curl -H "Authorization: Bearer YOUR_TOKEN" https://gitlab.com/api/v4/user
    # Test Jira
    curl -u "username:password" https://jira.company.com/rest/api/2/myself

Symptoms:

  • “connection failed” errors
  • Timeout errors
  • Cannot reach APIs

Solutions:

  1. Check network connectivity:

    Terminal window
    # Test basic connectivity
    ping gitlab.com
    ping jira.company.com
    # Test HTTPS
    curl -I https://gitlab.com
  2. Check proxy settings:

    Terminal window
    # Set proxy environment variables
    export HTTP_PROXY=http://proxy.company.com:8080
    export HTTPS_PROXY=http://proxy.company.com:8080
  3. Check firewall settings:

    • Ensure outbound HTTPS (443) is allowed
    • Check corporate firewall rules
    • Verify VPN connection if required

Symptoms:

  • Empty task lists
  • “task not found” errors
  • Tasks not saving

Solutions:

  1. Check database:

    Terminal window
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM tasks;"
  2. Verify task creation:

    Terminal window
    # Create test task
    kasl task add --name "Test task" --completeness 0
    # List tasks
    kasl task list
  3. Check for database issues:

    Terminal window
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "PRAGMA integrity_check;"

Symptoms:

  • Tags not saving
  • Tag associations lost
  • Tag filtering not working

Solutions:

  1. Check tag tables:

    Terminal window
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM tags;"
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM task_tags;"
  2. Recreate tags:

    Terminal window
    kasl tag add "test" --color "red"
    kasl tag list
  3. Check foreign key constraints:

    Terminal window
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "PRAGMA foreign_keys = ON;"

Symptoms:

  • Empty reports
  • Missing data
  • Report generation errors

Solutions:

  1. Check workday data:

    Terminal window
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM workdays ORDER BY date DESC LIMIT 5;"
  2. Check pause data:

    Terminal window
    sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM pauses ORDER BY start DESC LIMIT 5;"
  3. Generate report manually:

    Terminal window
    kasl report --last

Symptoms:

  • “report send failed” errors
  • Reports not reaching server
  • Authentication issues

Solutions:

  1. Check API configuration:

    Terminal window
    # Verify SiServer configuration
    cat ~/.local/share/lacodda/kasl/config.json | jq .si
  2. Test API connectivity:

    Terminal window
    # Test SiServer connection
    curl -X POST https://api.company.com/health
  3. Check authentication:

    Terminal window
    # Clear session and retry
    rm ~/.local/share/lacodda/kasl/.si_session
    kasl report --send
Terminal window
# Enable debug mode
RUST_LOG=kasl=debug kasl watch --foreground
# Enable trace logging
RUST_LOG=kasl=trace kasl watch --foreground
# Enable SQLite logging
RUST_LOG=kasl=debug kasl report

Debug mode shows:

  • Configuration loading
  • Database operations
  • API requests/responses
  • Error details
  • Performance metrics
Terminal window
# Check configuration
RUST_LOG=kasl=debug kasl init
# Debug task operations
RUST_LOG=kasl=debug kasl task list
# Debug report generation
RUST_LOG=kasl=debug kasl report
# Debug API operations
RUST_LOG=kasl=debug kasl task find

Symptoms:

  • High CPU usage
  • System slowdown
  • Battery drain

Solutions:

  1. Increase poll interval:

    {
    "monitor": {
    "poll_interval": 1000 // Increase from 500
    }
    }
  2. Check for multiple instances:

    Terminal window
    ps aux | grep kasl
    kasl watch --stop
  3. Profile performance:

    Terminal window
    # Linux
    perf record --call-graph=dwarf ./target/release/kasl watch
    perf report

Symptoms:

  • High memory consumption
  • Memory leaks
  • Application crashes

Solutions:

  1. Check memory usage:

    Terminal window
    # Linux/macOS
    ps aux | grep kasl
    # Windows
    tasklist | findstr kasl
  2. Restart application:

    Terminal window
    kasl watch --stop
    kasl watch
  3. Check for memory leaks:

    Terminal window
    # Use valgrind (Linux)
    valgrind --leak-check=full ./target/release/kasl watch

Solutions:

  1. Check Task Scheduler:

    • Open Task Scheduler
    • Look for kasl tasks
    • Verify task is enabled
  2. Check Registry:

    Terminal window
    reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v kasl
  3. Run as Administrator:

    Terminal window
    kasl autostart enable

Solutions:

  1. Run as Administrator:

    • Right-click Command Prompt
    • “Run as administrator”
  2. Check file permissions:

    Terminal window
    icacls "%LOCALAPPDATA%\lacodda\kasl"

Solutions:

  1. Grant Accessibility permissions:

    • System Preferences → Security & Privacy → Privacy → Accessibility
    • Add kasl to the list
  2. Grant Input Monitoring permissions:

    • System Preferences → Security & Privacy → Privacy → Input Monitoring
    • Add kasl to the list

Solutions:

  1. Check LaunchAgents:

    Terminal window
    ls -la ~/Library/LaunchAgents/
  2. Load LaunchAgent manually:

    Terminal window
    launchctl load ~/Library/LaunchAgents/com.lacodda.kasl.plist

Solutions:

  1. Check user groups:

    Terminal window
    groups $USER
  2. Add user to input group:

    Terminal window
    sudo usermod -a -G input $USER
  3. Check device permissions:

    Terminal window
    ls -la /dev/input/

Solutions:

  1. Check service status:

    Terminal window
    systemctl --user status kasl
  2. Enable service:

    Terminal window
    systemctl --user enable kasl
    systemctl --user start kasl
  1. Check this guide for your specific issue
  2. Enable debug logging and check output
  3. Try the solutions provided above
  4. Gather information about your system

When reporting issues, include:

  • Operating system and version
  • kasl version (kasl --version)
  • Error messages (with debug logging)
  • Steps to reproduce
  • System configuration