diegosouzapw/OmniRoute · error

database optimization settings did not take effect (auto_vac

Error message

database optimization settings did not take effect (auto_vacuum expected ${targetAutoVacuum}, got ${newAutoVacuum}; page_size expected ${targetPageSize}, got ${newPageSize})

What it means

Error "database optimization settings did not take effect (auto_vacuum expected ${targetAutoVacuum}, got ${newAutoVacuum}; page_size expected ${targetPageSize}, got ${newPageSize})" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/db/optimizationSettings.ts:216

    if (shouldRestoreWal) db.pragma("journal_mode = DELETE");
    db.pragma(`auto_vacuum = ${targetAutoVacuum}`);
    db.pragma(`page_size = ${targetPageSize}`);
    db.exec("VACUUM");
  } finally {
    if (shouldRestoreWal) {
      try {
        db.pragma("journal_mode = WAL");
      } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        console.warn(`[DB] Failed to restore WAL mode after optimization settings: ${message}`);
      }
    }
  }

  const newAutoVacuum = db.pragma("auto_vacuum", { simple: true }) as number;
  const newPageSize = db.pragma("page_size", { simple: true }) as number;
  if (newAutoVacuum !== targetAutoVacuum || newPageSize !== targetPageSize) {
    throw new Error(
      `database optimization settings did not take effect ` +
        `(auto_vacuum expected ${targetAutoVacuum}, got ${newAutoVacuum}; ` +
        `page_size expected ${targetPageSize}, got ${newPageSize})`
    );
  }
}

export function applyDatabaseOptimizationSettingsForDb(
  db: SqliteDatabase,
  settings: DatabaseOptimizationSettings,
  options: { applyPersistent: boolean }
): void {
  if (options.applyPersistent) applyPersistentOptimizationPragmas(db, settings);
  setCacheSizeForDb(
    db,
    normalizeStoredCacheSizeKb(settings.cacheSize, DEFAULT_DATABASE_SETTINGS.optimization.cacheSize)
  );
}

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/db/optimizationSettings.ts:216 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/41348b946c2bed2c. Report an issue: GitHub.