diegosouzapw/OmniRoute · error · Error
Unable to inspect existing database at
Error message
Unable to inspect existing database at ${dbPath}: ${message} What it means
Thrown by hasEncryptedCredentials() in the Electron SQLite inspection preflight when better-sqlite3 cannot open or query the provider_connections table at the given dbPath — the underlying open()/prepare() failure (locked database, corrupted file, missing table, permission error) is normalized by formatLoadError and embedded in the message. The caller (startNextServer) uses this result to decide whether encrypted credentials can be migrated, so an unopenable database aborts that decision, not the whole startup.
Solutions
- Verify dbPath points to the real OmniRoute SQLite file (default under ~/.omniroute/) and that the Electron process has read permission
- Ensure no other process holds an exclusive lock; close running OmniRoute server instances or retry after they exit
- If the file is corrupted, restore from backup or delete it so a fresh schema is created on next start
- Update/rebuild better-sqlite3 so its ABI matches the running Electron Node version
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at electron/sqlite-inspection.js:55 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/32d91226dc217099.
Report an issue: GitHub.
Appendix: source
Thrown at electron/sqlite-inspection.js:55
let db = null;
try {
db = openDatabase(dbPath);
const row = db
.prepare(
`SELECT 1
FROM provider_connections
WHERE access_token LIKE 'enc:v1:%'
OR refresh_token LIKE 'enc:v1:%'
OR api_key LIKE 'enc:v1:%'
OR id_token LIKE 'enc:v1:%'
LIMIT 1`
)
.get();
return !!row;
} catch (error) {
const message = formatLoadError(error);
throw new Error(`Unable to inspect existing database at ${dbPath}: ${message}`);
} finally {
if (db) {
db.close();
}
}
}
module.exports = {
hasEncryptedCredentials,
openNodeSqliteReadOnly,
openReadOnlySqliteDatabase,
};
View on GitHub (pinned to a179ffed5b)