stablyai/orca · error · Error
Chromium cookies database does not exist
Error message
Chromium cookies database does not exist
What it means
Thrown by copyStableAttempt() in chromium-cookie-snapshot.ts when readFileState(sourcePath) returns null, meaning statSync failed with ENOENT on the live Chromium Cookies database path. The function refuses to proceed because there is no source database to copy. This is distinct from a transient lock: the file genuinely does not exist at the expected path.
Source
Thrown at src/main/browser/chromium-cookie-snapshot.ts:83
)
}
function removeAttemptFiles(databasePath: string): void {
for (const suffix of ['', '-wal', '-shm'] as const) {
try {
unlinkSync(databasePath + suffix)
} catch {
/* best-effort between snapshot attempts */
}
}
}
function copyStableAttempt(sourcePath: string, databasePath: string): boolean {
const sourceWalPath = `${sourcePath}-wal`
const databaseBefore = readFileState(sourcePath)
const walBefore = readFileState(sourceWalPath)
if (!databaseBefore) {
throw new Error('Chromium cookies database does not exist')
}
removeAttemptFiles(databasePath)
// Why: #9355 — AV/EDR briefly opens a file literally named "Cookies" with FILE_SHARE_NONE,
// so an otherwise-fine copy throws EBUSY. The attempt loop below only handles a false
// return, so a throw here would escape it entirely.
copyFileWithWindowsRetry(sourcePath, databasePath)
if (walBefore) {
try {
// Why: SQLite only discovers a WAL whose basename exactly matches the DB.
copyFileWithWindowsRetry(sourceWalPath, `${databasePath}-wal`)
} catch (error) {
if (isMissingFileError(error)) {
return false
}
throw error
}View on GitHub (pinned to 1136503c6a)
Solutions
- Verify the sourcePath exists with fs.existsSync before calling createChromiumCookieSnapshot.
- Confirm the Chromium profile directory and the 'Cookies' SQLite filename are correct (case-sensitive on Linux).
- Launch the target browser once so Chromium creates the cookie database before snapshotting.
- Treat a missing database as 'no cookies to import' (empty result) rather than a hard failure at the call site.
Example fix
// before
const databaseBefore = readFileState(sourcePath)
if (!databaseBefore) {
throw new Error('Chromium cookies database does not exist')
}
// after — caller-side guard
if (!existsSync(sourcePath)) {
return { databasePath: '', cleanup: () => {} }
} Defensive patterns
Strategy: validation
Validate before calling
import { existsSync } from 'node:fs'
if (!existsSync(sourcePath)) {
return { databasePath: '', cleanup: () => {} } // treat as empty
} Try / catch
try {
return createChromiumCookieSnapshot(sourcePath)
} catch (error) {
if (error instanceof Error && error.message.includes('does not exist')) {
return { databasePath: '', cleanup: () => {} }
}
throw error
} Prevention
- Stat the Cookies path before snapshotting.
- Launch the source browser once so Chromium creates the cookie DB.
- Resolve the profile dir from Chromium's Local State to pick the right Cookies path.
- Treat a missing DB as 'no cookies' at the call site, not a hard error.
When it happens
Trigger: Calling createChromiumCookieSnapshot() with a sourcePath that points to a non-existent Cookies file (wrong user-data dir, browser never ran and created a cookie store, profile dir was deleted between discovery and copy).
Common situations: Migrating cookies from a fresh profile that never visited any site. Pointing at the wrong Chromium user-data-dir (Default vs Profile 1). The browser was uninstalled/cleaned while Orca held a stale path. Snapshots taken after the user cleared browsing data and the DB was removed.
Related errors
- Chromium cookies database changed while creating a snapshot
- Spritesheet file not found.
- [plain-node-entry-guard] could not smoke-load daemon-entry.j
- Missing packaged resources directory: ${resourcesDir}
- Packaged node-pty is missing ${conptyRoot}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/1c2d95bd483994e7.
Report an issue: GitHub.