{"record":{"id":"6abba3fac92a4439","repo":"hcengineering/platform","slug":"no-such-key-6abba3","errorCode":null,"errorMessage":"No such key","messagePattern":"No such key","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/front/src/index.ts","lineNumber":495,"sourceCode":"          const wsIds = await getWorkspaceIds(ctx, token, req.path)\n          if (wsIds === null) {\n            res.status(403).send()\n            return\n          }\n\n          const uuid = req.params.file ?? req.query.file\n          if (uuid === undefined) {\n            res.status(404).send()\n            return\n          }\n\n          let blobInfo = await ctx.with('stat', {}, (ctx) => config.storageAdapter.stat(ctx, wsIds, uuid), {\n            workspace: wsIds.uuid\n          })\n\n          if (blobInfo === undefined) {\n            ctx.error('No such key', { file: uuid, workspace: wsIds.uuid })\n            res.status(404).send()\n            return\n          }\n\n          if (req.method === 'HEAD') {\n            res.writeHead(200, {\n              'accept-ranges': 'bytes',\n              connection: 'keep-alive',\n              'Keep-Alive': 'timeout=5',\n              'content-type': blobInfo.contentType,\n              'content-length': blobInfo.size,\n              'content-security-policy': \"default-src 'none';\",\n              Etag: blobInfo.etag,\n              'Last-Modified': new Date(blobInfo.modifiedOn).toISOString()\n            })\n            res.status(200)\n\n            res.end()\n            return","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/server/front/src/index.ts#L477-L513","documentation":"The files handler checks storageAdapter.stat for the requested blob before serving it. When stat returns undefined the key does not exist in storage, so the server logs 'No such key' and responds HTTP 404.","triggerScenarios":"GET/HEAD /files?file=<uuid> where the blob uuid is absent from the workspace's storage (already deleted, never uploaded, or wrong uuid).","commonSituations":"Client caching or bookmarking file URLs after deletion; data migration losing blobs; typos/wrong workspace in the file uuid; uploads that silently failed earlier.","solutions":["Verify the file uuid exists in the target workspace's storage (check via storage console/CLI).","Re-upload the file if it was deleted or lost in migration.","Ensure the request targets the correct workspace containing the blob.","Handle 404 on the client by removing stale references."],"exampleFix":"// before\nconst res = await fetch(`/files?file=${uuid}`)\n// after\nconst res = await fetch(`/files?file=${uuid}`)\nif (res.status === 404) {\n  await reuploadFile(uuid)\n}","handlingStrategy":"fallback","validationCode":"async function fileExists(frontUrl: string, fileUuid: string): Promise<boolean> {\n  const res = await fetch(`${frontUrl}/files?file=${fileUuid}`, { method: 'HEAD' })\n  return res.status !== 404\n}","typeGuard":"function isFileUuid(uuid: unknown): uuid is string {\n  return typeof uuid === 'string' && /^[0-9a-f-]{36}$/i.test(uuid)\n}","tryCatchPattern":"const res = await fetch(`/files?file=${uuid}`)\nif (res.status === 404) {\n  console.warn(`file ${uuid} missing in workspace; restoring from backup`)\n  await restoreFile(uuid) // fallback path\n  return\n}\nreturn await res.blob()","preventionTips":["Treat 404 on file fetch as expected and handle it in client code.","Purge client-side caches/bookmarks of file URLs when files are deleted.","Verify workspace/uuid pairing when migrating data between workspaces."],"tags":["http-404","storage","missing-object"],"backgroundTag":"no-such-key","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}