{"record":{"id":"e740afe9122c4072","repo":"diegosouzapw/OmniRoute","slug":"compliance-could-not-initialize-audit-log","errorCode":null,"errorMessage":"[COMPLIANCE] Could not initialize audit log:","messagePattern":"\\[COMPLIANCE\\] Could not initialize audit log:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/instrumentation-node.ts","lineNumber":503,"sourceCode":"  try {\n    const { initAuditLog, cleanupExpiredLogs } = await import(\"@/lib/compliance/index\");\n    initAuditLog();\n    console.log(\"[COMPLIANCE] Audit log table initialized\");\n\n    const cleanup = await cleanupExpiredLogs();\n    if (\n      cleanup.deletedUsage ||\n      cleanup.deletedCallLogs ||\n      cleanup.deletedProxyLogs ||\n      cleanup.deletedRequestDetailLogs ||\n      cleanup.deletedAuditLogs ||\n      cleanup.deletedMcpAuditLogs\n    ) {\n      console.log(\"[COMPLIANCE] Expired log cleanup:\", cleanup);\n    }\n  } catch (err: unknown) {\n    const msg = err instanceof Error ? err.message : String(err);\n    console.warn(\"[COMPLIANCE] Could not initialize audit log:\", msg);\n  }\n\n  // Storage-configured scheduled VACUUM (#4437): registers the timer from\n  // Settings > System & Storage and persists lastVacuumAt for the UI.\n  try {\n    const { initVacuumScheduler } = await import(\"@/lib/db/vacuumScheduler\");\n    initVacuumScheduler();\n    console.log(\"[STARTUP] Scheduled VACUUM initialized (#4437)\");\n  } catch (err: unknown) {\n    const msg = err instanceof Error ? err.message : String(err);\n    console.warn(\"[STARTUP] Could not initialize vacuum scheduler (non-fatal):\", msg);\n  }\n\n  // Retention cleanup scheduler (#4691/#6988, #9624): runs the general retention\n  // cleanup once after startup and then every 6 hours. Previously this was only\n  // wired into the unused src/server-init.ts, so telemetry tables grew unboundedly\n  // even with retention.autoCleanupEnabled=true. Idempotent (guarded internally).\n  try {","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/instrumentation-node.ts#L485-L521","documentation":"Error \"[COMPLIANCE] Could not initialize audit log:\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/instrumentation-node.ts:503 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}