{"record":{"id":"e48fb15a35fe3ccb","repo":"diegosouzapw/OmniRoute","slug":"arena-elo-sync-failed-to-delete-expired-intellig","errorCode":null,"errorMessage":"[ARENA_ELO_SYNC] Failed to delete expired intelligence: ${message}","messagePattern":"\\[ARENA_ELO_SYNC\\] Failed to delete expired intelligence: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/arenaEloSync.ts","lineNumber":390,"sourceCode":"      source: \"arena_elo\",\n      error: \"Sync already in progress\",\n    };\n  }\n  syncInProgress = true;\n  try {\n    // Backup DB before first sync (same pattern as pricingSync)\n    if (!firstSyncDone && !dryRun) {\n      backupDbFile(\"pre-arena-elo-sync\");\n      firstSyncDone = true;\n    }\n\n    // Clean up stale entries before writing new ones\n    if (!dryRun) {\n      try {\n        deleteExpiredIntelligence();\n      } catch (err) {\n        const message = err instanceof Error ? err.message : String(err);\n        console.warn(`[ARENA_ELO_SYNC] Failed to delete expired intelligence: ${message}`);\n      }\n    }\n\n    const leaderboards = await fetchArenaLeaderboards();\n    const entries = transformToModelIntelligence(leaderboards);\n\n    if (!dryRun && entries.length > 0) {\n      try {\n        bulkUpsertModelIntelligence(entries);\n      } catch (err) {\n        const message = err instanceof Error ? err.message : String(err);\n        console.warn(`[ARENA_ELO_SYNC] Failed to bulk upsert intelligence: ${message}`);\n        return {\n          success: false,\n          modelCount: 0,\n          source: \"arena_elo\",\n          error: message,\n        };","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/arenaEloSync.ts#L372-L408","documentation":"Non-fatal warning inside syncArenaElo's pre-write cleanup: deleteExpiredIntelligence() threw while pruning stale arena intelligence rows, and the sync deliberately continues writing fresh entries rather than aborting. The message identifies the DB-level prune failure only.","triggerScenarios":"Thrown at src/lib/arenaEloSync.ts:390 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check DB write permissions/locks on the intelligence table","Ignore for transient SQLite busy errors","Run a manual sync after fixing to force cleanup"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}