Quick Diagnostics
Run the built-in health check:lm doctor checks your config file, database, authentication status, and system requirements.
Debug Logging
Enable detailed logging for any command:Authentication Issues
Not signed in
Not signed in
Error:
Not logged in, Authentication required, or Session expiredSolutions:- Sign in again:
- Verify the session:
- Run diagnostics:
Session expired
Session expired
Error: OAuth tokens expire periodically. The CLI attempts automatic refresh, but if that fails, a fresh login is needed.
Session expired or Token refresh failedSolution: Sign in again:Login browser doesn't open
Login browser doesn't open
Possible causes:
- No default browser configured
- Running in a headless environment (SSH, Docker)
Database Issues
Database locked
Database locked
Error: Or without confirmation:
Database is locked or Could not set lockCause: Another lm process is holding the database lock.Solutions:- Unlock the database:
- If that doesn’t work, check for orphaned processes:
Database corruption
Database corruption
Error: Exported files in
WAL corruption, schema mismatch, or database errors.Solutions:- Repair (preserves data when possible):
- Reset (destructive — drops all tables):
.leadmagic/export/ are not affected by reset.Database too large
Database too large
Solution: Compact the database to reclaim space:This runs
VACUUM, updates statistics, and flushes the write-ahead log.File and Data Issues
File too large
File too large
The CLI enforces row limits for safety:
Solutions:
- Split large files before loading
- Filter rows using SQL after loading a subset
- Use the REST API directly for large-scale batch processing
CSV parsing errors
CSV parsing errors
Common causes:
- Non-standard delimiters (the CLI auto-detects commas, tabs, semicolons, and pipes)
- Encoding issues (the CLI handles UTF-8 and BOM)
- Malformed quotes or escaped characters
- Try analyzing the file first:
- Check the file encoding — the CLI works best with UTF-8.
- If the file uses an unusual delimiter, the CLI auto-detects it in most cases. If detection fails, pre-process the file to use standard CSV formatting.
Columns not detected
Columns not detected
Cause: Column names don’t match expected patterns (e.g.,
email, first_name, company).Solutions:- Specify columns explicitly with
--email-column,--first-name-column, etc. when usinglm enrich - In chat, tell the AI which column contains what: “The email addresses are in column C”
- Run
lm analyzeto see what the CLI detected
Connection Issues
API request failed
API request failed
Possible causes:
- No internet connection
- LeadMagic API is temporarily down
- Your OAuth session is invalid or expired
- Check your internet connection
- Verify your account session:
- Check the API status at leadmagic.io/status
AI chat not responding
AI chat not responding
Cause: The AI Gateway (
ai.leadmagic.io) may be unreachable.Solutions:- Check you’re logged in:
- Re-authenticate:
- Try with debug logging to see the actual error:
Common Error Messages
Reset Everything
If all else fails, you can reset your entire CLI installation:Still Need Help?
Help Center
Contact support for account or billing issues.
API Status
Check if the LeadMagic API is operational.