stablyai/orca · warning · Error

Chromium cookies database changed while creating a snapshot

Error message

Chromium cookies database changed while creating a snapshot

What it means

Thrown by createChromiumCookieSnapshot() after SNAPSHOT_ATTEMPTS (5) consecutive copyStableAttempt() calls returned false. Each attempt re-stats the source database/WAL before and after the copyFile; if the size/inode/mtime changed mid-copy (Chromium is actively writing), the attempt is discarded as inconsistent. Five failures means the browser was too busy to produce a quiescent snapshot.

Source

Thrown at src/main/browser/chromium-cookie-snapshot.ts:138

export function createChromiumCookieSnapshot(
  sourcePath: string,
  options: ChromiumCookieSnapshotOptions = {}
): ChromiumCookieSnapshot {
  const snapshotDir = mkdtempSync(join(options.tempRoot ?? tmpdir(), 'orca-cookie-import-'))
  const databasePath = join(snapshotDir, 'Cookies')
  let keepSnapshot = false

  try {
    for (let attempt = 0; attempt < SNAPSHOT_ATTEMPTS; attempt += 1) {
      if (copyStableAttempt(sourcePath, databasePath)) {
        keepSnapshot = true
        return {
          databasePath,
          cleanup: () => removeSnapshotDirectory(snapshotDir)
        }
      }
    }
    throw new Error('Chromium cookies database changed while creating a snapshot')
  } finally {
    if (!keepSnapshot) {
      removeSnapshotDirectory(snapshotDir)
    }
  }
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Close or pause the source browser so it stops writing to the Cookies DB, then retry.
  2. Increase SNAPSHOT_ATTEMPTS if the environment has a slow or contended disk.
  3. Retry the whole createChromiumCookieSnapshot call with backoff — churn is often transient.
  4. On Windows, ensure AV/EDR is not briefly locking the file (copyFileWithWindowsRetry already mitigates EBUSY but adds latency).
Defensive patterns

Strategy: retry

Try / catch

for (let i = 0; i < 3; i++) {
  try {
    return createChromiumCookieSnapshot(sourcePath)
  } catch (error) {
    if (error instanceof Error && error.message.includes('changed while creating')) {
      await new Promise(r => setTimeout(r, 200 * (i + 1)))
      continue
    }
    throw error
  }
}

Prevention

When it happens

Trigger: The live Chromium process is continuously writing to its Cookies SQLite database (active sync, heavy browsing, download of a large cookie set) so every copy observes a before/after mismatch within the 5-attempt budget.

Common situations: Importing cookies while the browser is actively syncing or the user is logged into many Google services. Snapshotting during a page load that sets many cookies. Disk that is too slow to complete a consistent copy between Chromium write ticks.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/2a13d3223ee397d8. Report an issue: GitHub.