hcengineering/platform · error · NotFoundError

Not Found

Error message

Not Found

What it means

statBlob looks up the blob in the storage adapter (storage.stat). If the storage adapter returns undefined the blob does not exist for the workspace, and the service throws NotFoundError. This is the preview service's canonical 'no such object' response for metadata/thumbnail requests.

Source

Thrown at pods/preview/src/service.ts:138

        return {
          filePath: thumbPath,
          mimeType: contentType
        }
      })
    })
  }

  @withContext('stat-blob')
  async statBlob (ctx: MeasureContext, workspace: WorkspaceUuid, name: string): Promise<Blob> {
    const wsId = { uuid: workspace } as any

    const stat = await this.storage.stat(ctx, wsId, name)
    if (stat !== undefined) {
      return stat
    }

    throw new NotFoundError()
  }

  findProvider (ctx: MeasureContext, contentType: string): PreviewProvider {
    const provider = this.providers.find((it) => it.supports(contentType))
    if (provider != null) {
      return provider
    }

    throw new BadRequestError(`Unsupported content type: ${contentType}`)
  }

  private imageKey (workspaceId: string, name: string): string {
    return `image/${workspaceId}/${name}`
  }

  private thumbnailKey (workspaceId: string, name: string, params: ThumbnailParams): string {
    return `thumbnail/${workspaceId}/${name}-${params.width}-${params.height}-${params.format}`
  }

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Verify the blob name and workspace uuid against the record in your application DB.
  2. Confirm the object exists in the underlying storage (S3/MinIO bucket) under that key.
  3. Ensure upload completed before requesting the preview; retry after the upload finishes.
  4. Check that the preview service is configured against the same storage adapter/workspace as the uploading service.

Example fix

// before
const meta = await preview.metadata(ctx, workspace, name)
// after
const stat = await storage.stat(ctx, { uuid: workspace }, name)
if (stat === undefined) return null // skip preview for missing blob
const meta = await preview.metadata(ctx, workspace, name)
Defensive patterns

Strategy: validation

Validate before calling

const stat = await storage.stat(ctx, { uuid: workspace }, name)
if (stat === undefined) {
  return null // blob gone; skip preview request entirely
}

Try / catch

try {
  const meta = await preview.metadata(ctx, workspace, name)
} catch (err) {
  if (err.name === 'NotFoundError' || /not found/i.test(err.message)) return null
  throw err
}

Prevention

When it happens

Trigger: Calling the preview metadata or thumbnail endpoint with a workspace/name pair that has no corresponding object in storage — wrong or stale blob name, blob deleted, wrong workspace uuid, or storage backend connectivity returning no object.

Common situations: Clients caching blob names after deletion, typos in name/uuid, cross-environment storage (e.g. pointing at a bucket without the uploaded object), race where upload has not completed before preview is requested.

Related errors


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