{"record":{"id":"444df4d6bf46002e","repo":"overleaf/overleaf","slug":"failed-to-check-project","errorCode":null,"errorMessage":"failed to check project","messagePattern":"failed to check project","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"services/project-history/scripts/bulk_resync_file_fix_up.mjs","lineNumber":172,"sourceCode":"}\n\n/**\n * @param {Project} project\n * @return {Promise<{projectId: string, historyId: string} | null>}\n */\nasync function checkProject(project) {\n  if (gracefulShutdownInitiated) return null\n  if (project._id.getTimestamp() > FILESTORE_READ_OFF) {\n    STATS.skipped++ // Project created after all bugs were fixed.\n    return null\n  }\n  const projectId = project._id.toString()\n  const historyId = project.overleaf.history.id.toString()\n  for (const [condition, check] of Object.entries(conditions)) {\n    try {\n      if (await check(project)) return { projectId, historyId }\n    } catch (err) {\n      logger.err({ projectId, condition, err }, 'failed to check project')\n      STATS.checkFailure++\n      return null\n    }\n  }\n  STATS.skipped++\n  return null\n}\n\n/**\n * @param {string} projectId\n * @param {string} historyId\n * @return {Promise<void>}\n */\nasync function processProject(projectId, historyId) {\n  if (gracefulShutdownInitiated) return\n  const t0 = performance.now()\n  try {\n    await tryProcessProject(projectId, historyId)","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/overleaf/overleaf/blob/28ad3b03b71cb4311decdcb55c36b33ec10d72db/services/project-history/scripts/bulk_resync_file_fix_up.mjs#L154-L190","documentation":"Warning logged in the bulk_resync fix-up's checkProject when one of the heuristic condition checks throws while inspecting a project document (e.g. unexpected document shape making a condition accessor fail). The remaining conditions are still evaluated and the loop continues — the error only prevents that single condition from matching, so a genuinely affected project could be missed.","triggerScenarios":"Thrown at services/project-history/scripts/bulk_resync_file_fix_up.mjs:172 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the logged err to see which condition accessor failed","Harden condition checks against missing/legacy project fields","Re-run the script for the affected project once the condition is fixed","Cross-check STATS to see how many projects had conditions skipped"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"28ad3b03b71cb4311decdcb55c36b33ec10d72db","analyzedAt":"2026-09-03T02:10:22.807Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}