This guide covers common issues and their solutions when running Tome.
Symptoms: Error messages about missing or inaccessible Calibre database
Solutions:
-
Verify the path is correct:
# Check your .env file cat .env | grep CALIBRE_DB_PATH # Verify file exists ls -l /path/to/calibre/library/metadata.db
-
Check file permissions:
# Ensure the file is readable chmod 644 /path/to/calibre/library/metadata.db -
Use absolute paths:
- Avoid relative paths in
.env - Use full path:
/home/user/Calibre Library/metadata.db
- Avoid relative paths in
-
Common locations:
- Linux:
~/Calibre Library/metadata.db - macOS:
~/Documents/Calibre Library/metadata.db - Windows:
C:\Users\<username>\Calibre Library\metadata.db
- Linux:
Symptoms: Books don't appear in Tome or changes in Calibre aren't reflected
Solutions:
-
Close Calibre before syncing:
- Calibre locks the database when open
- Close Calibre, then trigger sync in Tome
-
Verify database path:
# Confirm environment variable is set echo $CALIBRE_DB_PATH
-
Check browser console and terminal logs:
- Open browser DevTools (F12)
- Look for error messages in both browser and terminal
- Check for file permission errors
-
Manual sync:
- Go to Library page
- Click the sync button explicitly
- Wait for sync to complete
-
Check file watcher:
- File watcher monitors for changes automatically
- If not working, manual sync is always available
Symptoms: SQLITE_BUSY or SQLITE_LOCKED errors when rating books or managing tags
Background: Calibre 9.0+ uses WAL (Write-Ahead Logging) mode by default, which improves concurrent access but can still cause locks under certain conditions.
Solutions:
-
For Rating Updates (Usually works with Calibre open):
- Tome automatically retries rating updates (5-second timeout)
- If error persists: Close Calibre, wait 5-10 seconds, retry
- Check logs for retry attempts
-
For Tag Operations (Requires Calibre closed):
- Close Calibre completely (not just minimize)
- Wait 5-10 seconds for locks to clear
- Verify Calibre processes are terminated:
# Linux/macOS ps aux | grep calibre # Windows (PowerShell) Get-Process | Where-Object {$_.ProcessName -like "*calibre*"}
- Retry the operation
-
For Stale Locks (Calibre already closed):
- Wait 10-15 seconds and retry
- Check for WAL files:
ls -la /path/to/calibre/library/metadata.db* # Should show: metadata.db, metadata.db-wal, metadata.db-shm
- If issue persists, restart Tome
- Last resort: Restart your system to clear all locks
-
Check WAL Mode:
# Verify Calibre is using WAL mode sqlite3 /path/to/calibre/library/metadata.db "PRAGMA journal_mode;" # Should return: wal
-
Enhanced Error Messages:
- Tome provides context-aware error messages
- Read the error carefully - it includes specific guidance
- Error message indicates if Calibre appears to be open
- Follow the suggested action in the error message
Prevention:
- Close Calibre before bulk tag operations
- Rating updates should work even with Calibre open
- Use manual sync button after making changes in Calibre
Symptoms: Errors about missing tome.db or table not found
Solutions:
-
Run migrations:
npm run db:migrate
-
Check database exists:
ls -la data/tome.db
-
Verify data directory:
# Ensure directory exists and is writable mkdir -p data chmod 755 data -
Reset database (WARNING: loses all data):
rm data/tome.db npm run db:migrate
Symptoms: SQLite errors, corrupted data, or crashes when accessing database
Solutions:
-
Restore from backup:
# List available backups npm run db:list-backups # Restore from backup (interactive) npm run db:restore
-
Check database integrity:
sqlite3 data/tome.db "PRAGMA integrity_check;" -
Try to recover:
# Dump database to SQL sqlite3 data/tome.db .dump > backup.sql # Create new database from dump rm data/tome.db sqlite3 data/tome.db < backup.sql
-
If unrecoverable, reset (loses data):
rm data/tome.db npm run db:migrate
Symptoms: Migration errors during startup or when running manually
Solutions:
-
Lock file exists:
# Wait for current migration to complete (auto-timeout: 5 minutes) # Or remove stale lock file rm data/.migration.lock
-
Permission errors:
# Fix data directory permissions chmod 755 data chmod 644 data/tome.db -
Check disk space:
df -h data/
-
View migration status:
sqlite3 data/tome.db "SELECT * FROM __drizzle_migrations" -
Restore from pre-migration backup:
npm run db:restore
Symptoms: Cannot find Calibre database inside container
Solutions:
-
Verify mount path:
# Check if file exists inside container docker exec tome ls -l /calibre/metadata.db
-
Check docker-compose.yml:
volumes: - /absolute/path/to/calibre/library:/calibre:ro
-
Verify environment variable:
docker exec tome printenv CALIBRE_DB_PATH # Should output: /calibre/metadata.db
-
Check host path exists:
ls -l /absolute/path/to/calibre/library/metadata.db
Symptoms: Container fails to start, migration errors in logs
Solutions:
-
Check container logs:
docker-compose logs tome
-
Verify volume permissions:
docker volume inspect tome-data
-
Check disk space:
df -h
-
Run migration manually:
docker exec -it tome npm run db:migrate -
Restore from backup:
# List backups docker exec tome bun run db:list-backups # Restore docker exec -it tome bun run db:restore # Restart docker-compose restart tome
Symptoms: Container exits immediately or won't start
Solutions:
-
Check logs for errors:
docker-compose logs tome
-
Verify image pulled correctly:
docker-compose pull tome
-
Check environment variables:
docker-compose config
-
Ensure volumes are accessible:
docker volume ls docker volume inspect tome-data
-
Try building from source:
docker-compose build --no-cache tome docker-compose up
Symptoms: bun run build fails with errors
Solutions:
-
Clean and reinstall dependencies:
rm -rf node_modules bun.lock bun install
-
Check Bun version:
bun --version # Should be 1.3.0 or higher -
Clear Next.js cache:
rm -rf .next bun run build
-
Check for TypeScript errors:
bun run type-check
Symptoms: npm test fails
Solutions:
-
Run migrations:
# Tests use in-memory database but need migration files npm run db:migrate -
Check for port conflicts:
# Some tests may use ports lsof -ti:3000 | xargs kill
-
Clear test cache:
rm -rf node_modules/.cache
If none of these solutions work:
- Check existing issues: GitHub Issues
- Review documentation:
- DEPLOYMENT.md for Docker-specific issues
- DATABASE.md for database operations
- ARCHITECTURE.md for understanding the system
- Enable debug logging: Set
DEBUG=*environment variable - Open a new issue: Include logs, configuration, and steps to reproduce
To avoid common issues:
- Regular backups:
npm run db:backup - Keep Bun updated: Check for new versions regularly
- Monitor disk space: Ensure adequate space for database growth
- Use absolute paths: Avoid relative paths in configuration
- Test after updates: Run tests after pulling updates
- Read release notes: Check for breaking changes in new versions