overleaf/overleaf · error · Blob.NotFoundError

err.message (Blob.NotFoundError -> 404, BackupCorruptedError

Error message

err.message (Blob.NotFoundError -> 404, BackupCorruptedError -> 422)

What it means

Error handling in the history-v1 backup-verifier's manual verification endpoint: verifyBlob failed for the given historyId/hash, and err.message is used to classify the response — Blob.NotFoundError maps to 404 (blob absent from backup bucket) and BackupCorruptedError maps to 422 (backup present but fails integrity verification). Any other error is logged with full context.

Source

Thrown at services/history-v1/backup-verifier-app.mjs:46

logger.initialize('history-v1-backup-verifier')
Metrics.open_sockets.monitor()
Metrics.injectMetricsRoute(app)
app.use(Metrics.http.monitor(logger))
Metrics.leaked_sockets.monitor(logger)
Metrics.event_loop.monitor(logger)
Metrics.memory.monitor(logger)

app.get(
  '/history/:historyId/blob/:hash/verify',
  expressify(async (req, res) => {
    const { historyId, hash } = req.params
    try {
      await verifyBlob(historyId, hash)
      res.sendStatus(200)
    } catch (err) {
      logger.warn({ err, historyId, hash }, 'manual verify blob failed')
      if (err instanceof Blob.NotFoundError) {
        res.status(404).send(err.message)
      } else if (err instanceof BackupCorruptedError) {
        res.status(422).send(err.message)
      } else {
        throw err
      }
    }
  })
)

app.get('/status', (req, res) => {
  res.send('history-v1-backup-verifier is up')
})

app.get(
  '/health_check',
  expressify(async (req, res) => {
    await healthCheck()
    res.sendStatus(200)

View on GitHub (pinned to 28ad3b03b7)

Solutions

  1. For 404: re-run the backup worker to persist the missing blob
  2. For 422: restore the corrupted blob from backup or re-upload from the source project
  3. Check the object store for partial/truncated writes of the affected hash
  4. Use the logged err to distinguish storage unavailability from genuine corruption
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at services/history-v1/backup-verifier-app.mjs:46 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of overleaf/overleaf@28ad3b03b7 (2026-09-03). Data as JSON: /api/errors/310404499ab06067. Report an issue: GitHub.