{"record":{"id":"c268259964ac481d","repo":"hcengineering/platform","slug":"infofile-should-present-to-check","errorCode":null,"errorMessage":"${infoFile} should present to check","messagePattern":"(.+?) should present to check","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/backup/src/check.ts","lineNumber":69,"sourceCode":"}\n\n/**\n * @public\n */\nexport interface WorkspaceCheckResult {\n  date: number\n  domains: DomainCheckResult[]\n  blobs: BlobCheckResult\n  ok: boolean\n}\n\nasync function resolveSnapshots (\n  storage: BackupStorage,\n  date: number\n): Promise<{ backupInfo: BackupInfo, snapshots: BackupSnapshot[], date: number }> {\n  const infoFile = 'backup.json.gz'\n  if (!(await storage.exists(infoFile))) {\n    throw new Error(`${infoFile} should present to check`)\n  }\n  const backupInfo: BackupInfo = JSON.parse(gunzipSync(new Uint8Array(await storage.loadFile(infoFile))).toString())\n\n  let snapshots = backupInfo.snapshots\n  if (date !== -1) {\n    const bk = backupInfo.snapshots.findIndex((it) => it.date === date)\n    if (bk === -1) {\n      throw new Error(`${infoFile} has no snapshot at ${date}`)\n    }\n    snapshots = backupInfo.snapshots.slice(0, bk + 1)\n  } else {\n    date = snapshots[snapshots.length - 1]?.date ?? -1\n  }\n  return { backupInfo, snapshots, date }\n}\n\n/**\n * Checks whether all documents recorded in a backup are present, and unchanged, in the given","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/server/backup/src/check.ts#L51-L87","documentation":"resolveSnapshots in the backup check tool requires the storage to contain the top-level 'backup.json.gz' manifest; if storage.exists(infoFile) is false it throws this Error. Without the manifest, snapshot consistency cannot be verified.","triggerScenarios":"Running the backup check (resolveSnapshots, called via resolved) against a BackupStorage bucket/prefix that has no backup.json.gz file at its root.","commonSituations":"Pointing the check tool at the wrong bucket or path prefix; a backup that never completed so the manifest was never written; the manifest deleted by lifecycle rules or manual cleanup.","solutions":["Point the check at the correct storage location containing backup.json.gz.","Re-run the backup to (re)generate the manifest, then check again.","Verify the storage credentials/bucket name are correct.","Check object-storage lifecycle policies did not delete the manifest."],"exampleFix":"// CLI usage\n// before\ncheckts --storage s3://wrong-bucket/backups\n// after\ncheckts --storage s3://backup-bucket/workspaces","handlingStrategy":"validation","validationCode":"// verify the manifest exists before running the check\nif (!(await storage.exists('backup.json.gz'))) {\n  throw new Error('Target storage has no backup.json.gz; wrong bucket/prefix or incomplete backup')\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runCheck(ctx, storage, date)\n} catch (err) {\n  if (err instanceof Error && err.message.includes('should present to check')) {\n    // point at the correct storage or re-run the backup\n  } else throw err\n}","preventionTips":["Pin the storage bucket/prefix used by both backup and check jobs.","Only run checks after a backup job reports successful completion.","Exclude backup.json.gz from storage lifecycle deletions.","Verify storage credentials allow object listing before running tools."],"tags":["backup","missing-file","storage"],"backgroundTag":"backup-manifest-missing","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}