Troubleshooting
This guide helps you resolve common issues with kasl.
Common Issues
Section titled “Common Issues”Activity Monitoring
Section titled “Activity Monitoring”Problem: Monitoring not starting
Section titled “Problem: Monitoring not starting”Symptoms:
kasl watchfails to start- No work sessions detected
- Error messages about permissions
Solutions:
-
Check permissions:
Terminal window # Linux/macOSls -la ~/.local/share/lacodda/kasl/# Windowsdir "%LOCALAPPDATA%\lacodda\kasl" -
Run in foreground for debugging:
Terminal window kasl watch --foreground -
Check for existing processes:
Terminal window # Linux/macOSps aux | grep kasl# Windowstasklist | findstr kasl -
Stop existing processes:
Terminal window kasl watch --stop
Problem: False activity detection
Section titled “Problem: False activity detection”Symptoms:
- Work sessions start unexpectedly
- Pauses not detected properly
- Inconsistent timing
Solutions:
-
Adjust configuration:
Terminal window kasl init # Reconfigure monitor settings -
Increase thresholds:
{"monitor": {"activity_threshold": 60, // Increase from 30"pause_threshold": 120, // Increase from 60"min_pause_duration": 30 // Increase from 20}} -
Check for background processes:
Terminal window # Linux/macOSps aux | grep -E "(mouse|keyboard|input)"
Database Issues
Section titled “Database Issues”Problem: Database locked
Section titled “Problem: Database locked”Symptoms:
- “database is locked” errors
- Cannot access data
- Application crashes
Solutions:
-
Stop all kasl processes:
Terminal window kasl watch --stop -
Check file permissions:
Terminal window # Linux/macOSls -la ~/.local/share/lacodda/kasl/kasl.db# Windowsdir "%LOCALAPPDATA%\lacodda\kasl\kasl.db" -
Fix permissions:
Terminal window # Linux/macOSchmod 600 ~/.local/share/lacodda/kasl/kasl.dbchmod 700 ~/.local/share/lacodda/kasl/ -
Check for corruption:
Terminal window sqlite3 ~/.local/share/lacodda/kasl/kasl.db "PRAGMA integrity_check;"
Problem: Migration failures
Section titled “Problem: Migration failures”Symptoms:
- “migration failed” errors
- Database schema issues
- Application won’t start
Solutions:
-
Check migration status:
Terminal window kasl migrations status -
View migration history:
Terminal window kasl migrations history -
Backup and reset:
Terminal window # Backup current databasecp ~/.local/share/lacodda/kasl/kasl.db kasl_backup.db# Remove database (will be recreated)rm ~/.local/share/lacodda/kasl/kasl.db# Restart kaslkasl watch
Configuration Issues
Section titled “Configuration Issues”Problem: Configuration not found
Section titled “Problem: Configuration not found”Symptoms:
- “configuration not found” errors
- Default settings used
- Cannot save configuration
Solutions:
-
Check configuration location:
Terminal window # Linux/macOSls -la ~/.local/share/lacodda/kasl/config.json# Windowsdir "%LOCALAPPDATA%\lacodda\kasl\config.json" -
Recreate configuration:
Terminal window kasl init -
Create directory manually:
Terminal window # Linux/macOSmkdir -p ~/.local/share/lacodda/kasl# Windowsmkdir "%LOCALAPPDATA%\lacodda\kasl"
Problem: Invalid configuration
Section titled “Problem: Invalid configuration”Symptoms:
- “invalid configuration” errors
- Application crashes on startup
- Settings not applied
Solutions:
-
Validate JSON syntax:
Terminal window # Using Pythonpython -m json.tool ~/.local/share/lacodda/kasl/config.json# Using jqjq . ~/.local/share/lacodda/kasl/config.json -
Reset configuration:
Terminal window kasl init --deletekasl init -
Check for syntax errors:
Terminal window # Common issues:# - Missing commas# - Extra commas# - Unquoted strings# - Invalid JSON types
API Integration Issues
Section titled “API Integration Issues”Problem: Authentication failures
Section titled “Problem: Authentication failures”Symptoms:
- “authentication failed” errors
- Cannot connect to APIs
- Session expired messages
Solutions:
-
Clear cached sessions:
Terminal window # Remove session filesrm ~/.local/share/lacodda/kasl/.gitlab_sessionrm ~/.local/share/lacodda/kasl/.jira_sessionrm ~/.local/share/lacodda/kasl/.si_session -
Reconfigure integration:
Terminal window kasl init -
Check credentials:
- Verify API tokens are valid
- Check username/password
- Confirm API URLs
-
Test connectivity:
Terminal window # Test GitLabcurl -H "Authorization: Bearer YOUR_TOKEN" https://gitlab.com/api/v4/user# Test Jiracurl -u "username:password" https://jira.company.com/rest/api/2/myself
Problem: Network connectivity
Section titled “Problem: Network connectivity”Symptoms:
- “connection failed” errors
- Timeout errors
- Cannot reach APIs
Solutions:
-
Check network connectivity:
Terminal window # Test basic connectivityping gitlab.comping jira.company.com# Test HTTPScurl -I https://gitlab.com -
Check proxy settings:
Terminal window # Set proxy environment variablesexport HTTP_PROXY=http://proxy.company.com:8080export HTTPS_PROXY=http://proxy.company.com:8080 -
Check firewall settings:
- Ensure outbound HTTPS (443) is allowed
- Check corporate firewall rules
- Verify VPN connection if required
Task Management Issues
Section titled “Task Management Issues”Problem: Tasks not found
Section titled “Problem: Tasks not found”Symptoms:
- Empty task lists
- “task not found” errors
- Tasks not saving
Solutions:
-
Check database:
Terminal window sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM tasks;" -
Verify task creation:
Terminal window # Create test taskkasl task add --name "Test task" --completeness 0# List taskskasl task list -
Check for database issues:
Terminal window sqlite3 ~/.local/share/lacodda/kasl/kasl.db "PRAGMA integrity_check;"
Problem: Tag issues
Section titled “Problem: Tag issues”Symptoms:
- Tags not saving
- Tag associations lost
- Tag filtering not working
Solutions:
-
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;" -
Recreate tags:
Terminal window kasl tag add "test" --color "red"kasl tag list -
Check foreign key constraints:
Terminal window sqlite3 ~/.local/share/lacodda/kasl/kasl.db "PRAGMA foreign_keys = ON;"
Report Issues
Section titled “Report Issues”Problem: Reports not generating
Section titled “Problem: Reports not generating”Symptoms:
- Empty reports
- Missing data
- Report generation errors
Solutions:
-
Check workday data:
Terminal window sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM workdays ORDER BY date DESC LIMIT 5;" -
Check pause data:
Terminal window sqlite3 ~/.local/share/lacodda/kasl/kasl.db "SELECT * FROM pauses ORDER BY start DESC LIMIT 5;" -
Generate report manually:
Terminal window kasl report --last
Problem: Report submission failures
Section titled “Problem: Report submission failures”Symptoms:
- “report send failed” errors
- Reports not reaching server
- Authentication issues
Solutions:
-
Check API configuration:
Terminal window # Verify SiServer configurationcat ~/.local/share/lacodda/kasl/config.json | jq .si -
Test API connectivity:
Terminal window # Test SiServer connectioncurl -X POST https://api.company.com/health -
Check authentication:
Terminal window # Clear session and retryrm ~/.local/share/lacodda/kasl/.si_sessionkasl report --send
Debug Mode
Section titled “Debug Mode”Enable Debug Logging
Section titled “Enable Debug Logging”# Enable debug modeRUST_LOG=kasl=debug kasl watch --foreground
# Enable trace loggingRUST_LOG=kasl=trace kasl watch --foreground
# Enable SQLite loggingRUST_LOG=kasl=debug kasl reportDebug Information
Section titled “Debug Information”Debug mode shows:
- Configuration loading
- Database operations
- API requests/responses
- Error details
- Performance metrics
Common Debug Commands
Section titled “Common Debug Commands”# Check configurationRUST_LOG=kasl=debug kasl init
# Debug task operationsRUST_LOG=kasl=debug kasl task list
# Debug report generationRUST_LOG=kasl=debug kasl report
# Debug API operationsRUST_LOG=kasl=debug kasl task findPerformance Issues
Section titled “Performance Issues”High CPU Usage
Section titled “High CPU Usage”Symptoms:
- High CPU usage
- System slowdown
- Battery drain
Solutions:
-
Increase poll interval:
{"monitor": {"poll_interval": 1000 // Increase from 500}} -
Check for multiple instances:
Terminal window ps aux | grep kaslkasl watch --stop -
Profile performance:
Terminal window # Linuxperf record --call-graph=dwarf ./target/release/kasl watchperf report
High Memory Usage
Section titled “High Memory Usage”Symptoms:
- High memory consumption
- Memory leaks
- Application crashes
Solutions:
-
Check memory usage:
Terminal window # Linux/macOSps aux | grep kasl# Windowstasklist | findstr kasl -
Restart application:
Terminal window kasl watch --stopkasl watch -
Check for memory leaks:
Terminal window # Use valgrind (Linux)valgrind --leak-check=full ./target/release/kasl watch
Platform-Specific Issues
Section titled “Platform-Specific Issues”Windows Issues
Section titled “Windows Issues”Problem: Autostart not working
Section titled “Problem: Autostart not working”Solutions:
-
Check Task Scheduler:
- Open Task Scheduler
- Look for kasl tasks
- Verify task is enabled
-
Check Registry:
Terminal window reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v kasl -
Run as Administrator:
Terminal window kasl autostart enable
Problem: Permission denied
Section titled “Problem: Permission denied”Solutions:
-
Run as Administrator:
- Right-click Command Prompt
- “Run as administrator”
-
Check file permissions:
Terminal window icacls "%LOCALAPPDATA%\lacodda\kasl"
macOS Issues
Section titled “macOS Issues”Problem: Input monitoring permissions
Section titled “Problem: Input monitoring permissions”Solutions:
-
Grant Accessibility permissions:
- System Preferences → Security & Privacy → Privacy → Accessibility
- Add kasl to the list
-
Grant Input Monitoring permissions:
- System Preferences → Security & Privacy → Privacy → Input Monitoring
- Add kasl to the list
Problem: Autostart not working
Section titled “Problem: Autostart not working”Solutions:
-
Check LaunchAgents:
Terminal window ls -la ~/Library/LaunchAgents/ -
Load LaunchAgent manually:
Terminal window launchctl load ~/Library/LaunchAgents/com.lacodda.kasl.plist
Linux Issues
Section titled “Linux Issues”Problem: Input device access
Section titled “Problem: Input device access”Solutions:
-
Check user groups:
Terminal window groups $USER -
Add user to input group:
Terminal window sudo usermod -a -G input $USER -
Check device permissions:
Terminal window ls -la /dev/input/
Problem: systemd service issues
Section titled “Problem: systemd service issues”Solutions:
-
Check service status:
Terminal window systemctl --user status kasl -
Enable service:
Terminal window systemctl --user enable kaslsystemctl --user start kasl
Getting Help
Section titled “Getting Help”Before Asking for Help
Section titled “Before Asking for Help”- Check this guide for your specific issue
- Enable debug logging and check output
- Try the solutions provided above
- Gather information about your system
Information to Provide
Section titled “Information to Provide”When reporting issues, include:
- Operating system and version
- kasl version (
kasl --version) - Error messages (with debug logging)
- Steps to reproduce
- System configuration
Support Channels
Section titled “Support Channels”- GitHub Issues: https://github.com/lacodda/kasl/issues
- Email: lahtachev@gmail.com
- Documentation: https://kasl.lacodda.com