hcengineering/platform · error · Error

${infoFile} should present to check

Error message

${infoFile} should present to check

What it means

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.

Source

Thrown at server/backup/src/check.ts:69

}

/**
 * @public
 */
export interface WorkspaceCheckResult {
  date: number
  domains: DomainCheckResult[]
  blobs: BlobCheckResult
  ok: boolean
}

async function resolveSnapshots (
  storage: BackupStorage,
  date: number
): Promise<{ backupInfo: BackupInfo, snapshots: BackupSnapshot[], date: number }> {
  const infoFile = 'backup.json.gz'
  if (!(await storage.exists(infoFile))) {
    throw new Error(`${infoFile} should present to check`)
  }
  const backupInfo: BackupInfo = JSON.parse(gunzipSync(new Uint8Array(await storage.loadFile(infoFile))).toString())

  let snapshots = backupInfo.snapshots
  if (date !== -1) {
    const bk = backupInfo.snapshots.findIndex((it) => it.date === date)
    if (bk === -1) {
      throw new Error(`${infoFile} has no snapshot at ${date}`)
    }
    snapshots = backupInfo.snapshots.slice(0, bk + 1)
  } else {
    date = snapshots[snapshots.length - 1]?.date ?? -1
  }
  return { backupInfo, snapshots, date }
}

/**
 * Checks whether all documents recorded in a backup are present, and unchanged, in the given

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Point the check at the correct storage location containing backup.json.gz.
  2. Re-run the backup to (re)generate the manifest, then check again.
  3. Verify the storage credentials/bucket name are correct.
  4. Check object-storage lifecycle policies did not delete the manifest.

Example fix

// CLI usage
// before
checkts --storage s3://wrong-bucket/backups
// after
checkts --storage s3://backup-bucket/workspaces
Defensive patterns

Strategy: validation

Validate before calling

// verify the manifest exists before running the check
if (!(await storage.exists('backup.json.gz'))) {
  throw new Error('Target storage has no backup.json.gz; wrong bucket/prefix or incomplete backup')
}

Try / catch

try {
  await runCheck(ctx, storage, date)
} catch (err) {
  if (err instanceof Error && err.message.includes('should present to check')) {
    // point at the correct storage or re-run the backup
  } else throw err
}

Prevention

When it happens

Trigger: Running the backup check (resolveSnapshots, called via resolved) against a BackupStorage bucket/prefix that has no backup.json.gz file at its root.

Common situations: 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.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/c268259964ac481d. Report an issue: GitHub.