{"record":{"id":"310404499ab06067","repo":"overleaf/overleaf","slug":"err-message-blob-notfounderror-404-backupcorr","errorCode":null,"errorMessage":"err.message (Blob.NotFoundError -> 404, BackupCorruptedError -> 422)","messagePattern":"err\\.message \\(Blob\\.NotFoundError -> 404, BackupCorruptedError -> 422\\)","errorType":"http","errorClass":"Blob.NotFoundError","httpStatus":404,"severity":"error","filePath":"services/history-v1/backup-verifier-app.mjs","lineNumber":46,"sourceCode":"logger.initialize('history-v1-backup-verifier')\nMetrics.open_sockets.monitor()\nMetrics.injectMetricsRoute(app)\napp.use(Metrics.http.monitor(logger))\nMetrics.leaked_sockets.monitor(logger)\nMetrics.event_loop.monitor(logger)\nMetrics.memory.monitor(logger)\n\napp.get(\n  '/history/:historyId/blob/:hash/verify',\n  expressify(async (req, res) => {\n    const { historyId, hash } = req.params\n    try {\n      await verifyBlob(historyId, hash)\n      res.sendStatus(200)\n    } catch (err) {\n      logger.warn({ err, historyId, hash }, 'manual verify blob failed')\n      if (err instanceof Blob.NotFoundError) {\n        res.status(404).send(err.message)\n      } else if (err instanceof BackupCorruptedError) {\n        res.status(422).send(err.message)\n      } else {\n        throw err\n      }\n    }\n  })\n)\n\napp.get('/status', (req, res) => {\n  res.send('history-v1-backup-verifier is up')\n})\n\napp.get(\n  '/health_check',\n  expressify(async (req, res) => {\n    await healthCheck()\n    res.sendStatus(200)","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/overleaf/overleaf/blob/28ad3b03b71cb4311decdcb55c36b33ec10d72db/services/history-v1/backup-verifier-app.mjs#L28-L64","documentation":"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.","triggerScenarios":"Thrown at services/history-v1/backup-verifier-app.mjs:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["For 404: re-run the backup worker to persist the missing blob","For 422: restore the corrupted blob from backup or re-upload from the source project","Check the object store for partial/truncated writes of the affected hash","Use the logged err to distinguish storage unavailability from genuine corruption"],"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"}