{"record":{"id":"3de046faed57708b","repo":"hcengineering/platform","slug":"low-level-storage-is-not-available-3de046","errorCode":null,"errorMessage":"Low level storage is not available","messagePattern":"Low level storage is not available","errorType":"exception","errorClass":"PlatformError","httpStatus":null,"severity":"error","filePath":"foundations/server/packages/server/src/client.ts","lineNumber":355,"sourceCode":"      }\n      const bevent = createBroadcastEvent(Array.from(classes))\n      void socket.send(\n        ctx,\n        {\n          result: [bevent]\n        },\n        this.binaryMode,\n        this.useCompression\n      )\n    } else {\n      void socket.send(ctx, { result: tx }, this.binaryMode, this.useCompression)\n    }\n  }\n\n  getOps (pipeline: Pipeline): BackupClientOps {\n    if (this.ops === undefined || this.opsPipeline !== pipeline) {\n      if (pipeline.context.lowLevelStorage === undefined) {\n        throw new PlatformError(unknownError('Low level storage is not available'))\n      }\n      this.ops = new BackupClientOps(pipeline.context.lowLevelStorage)\n      this.opsPipeline = pipeline\n    }\n    return this.ops\n  }\n\n  async loadChunk (ctx: ClientSessionCtx, domain: Domain, idx?: number): Promise<void> {\n    this.lastRequest = Date.now()\n    try {\n      const result = await this.getOps(ctx.pipeline).loadChunk(ctx.ctx, domain, idx)\n      await ctx.sendResponse(ctx.requestId, result)\n    } catch (err: any) {\n      await ctx.sendError(ctx.requestId, 'Failed to upload', unknownError(err))\n      ctx.ctx.error('failed to loadChunk', { domain, err })\n    }\n  }\n","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/foundations/server/packages/server/src/client.ts#L337-L373","documentation":"BackupClient.getOps lazily creates a BackupClientOps wrapper around pipeline.context.lowLevelStorage. If the pipeline context has no lowLevelStorage (undefined), backup/restore operations cannot talk to the underlying storage, so a PlatformError(unknownError(...)) is thrown.","triggerScenarios":"Invoking backup operations (via result, closeChunk, upload or clean paths) on a pipeline whose context was built without a lowLevelStorage adapter — e.g. storage not initialized or the pipeline was created before storage adapters were attached.","commonSituations":"Running backup tooling against a workspace/pipeline that lacks storage binding; server started with storage misconfigured so lowLevelStorage never got assigned; calling backup API before pipeline initialization completes.","solutions":["Ensure the pipeline context is initialized with a lowLevelStorage before using BackupClient","Fix the storage configuration so createStorageFromConfig produces an adapter and it is assigned to context.lowLevelStorage","Guard backup entry points to check context.lowLevelStorage first and fail with a clear config error"],"exampleFix":"// before\nclient.upload(pipeline, data)\n// after\nif (pipeline.context.lowLevelStorage === undefined) {\n  throw new Error('Backup unavailable: storage not configured for this pipeline')\n}\nclient.upload(pipeline, data)","handlingStrategy":"validation","validationCode":"function assertBackupReady(pipeline) {\n  if (pipeline?.context?.lowLevelStorage === undefined) {\n    throw new Error('Backup requires a pipeline initialized with a lowLevelStorage adapter')\n  }\n}","typeGuard":"function hasLowLevelStorage(pipeline) {\n  return pipeline != null && pipeline.context != null &&\n    pipeline.context.lowLevelStorage !== undefined\n}","tryCatchPattern":"import { PlatformError } from '@hcengineering/platform'\ntry {\n  await backupClient.upload(pipeline, data)\n} catch (e) {\n  if (e instanceof PlatformError && e.message.includes('Low level storage is not available')) {\n    throw new Error('Storage misconfigured: pipeline has no lowLevelStorage; fix storage config before backup')\n  }\n  throw e\n}","preventionTips":["Assert pipeline.context.lowLevelStorage in backup entry points and tests","Initialize storage adapters during pipeline boot and fail startup if missing","Cover backup flows with an integration test that requires a bound storage"],"tags":["backup","storage","initialization"],"backgroundTag":"missing-context-dependency","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}