hcengineering/platform · error

Blob file not found: ${blobPath} from:${cardPath}

Error message

Blob file not found: ${blobPath} from:${cardPath}

What it means

Thrown by CardsProcessor.createCardWithRelations when a card references a blob (attachment/file) whose resolved absolute path is not present in the collected blobFiles map — i.e. the referenced blob file does not exist at the computed location. Blob paths are resolved relative to the card's directory.

Source

Thrown at packages/importer/src/huly/cards.ts:543

    const cardSchema = this.createCardSchema(masterTagAttributes, masterTagAssociaions, tagAttributes, tagAssociations)
    this.validateFormat(cardHeader, cardSchema, cardPath)

    const cardId = this.metadataRegistry.getRef(cardPath) as Ref<Card>
    const cardProps: Record<string, any> = {
      _id: cardId,
      space: 'card:space:Default' as Ref<Space>,
      title,
      parent: parentCardId
    }

    const blobs = rawBlobs !== undefined ? (Array.isArray(rawBlobs) ? rawBlobs : [rawBlobs]) : []
    if (blobs.length > 0) {
      const blobProps: Record<string, BlobType> = {}
      for (const blob of blobs) {
        const blobPath = path.resolve(path.dirname(cardPath), blob)
        const blobFile = blobFiles.get(blobPath)
        if (blobFile === undefined) {
          throw new Error('Blob file not found: ' + blobPath + ' from:' + cardPath)
        }
        blobProps[blobFile._id] = {
          file: blobFile._id,
          type: blobFile.type,
          name: blobFile.name,
          size: blobFile.size,
          metadata: {} // todo: blobFile.metadata
        }
      }
      cardProps.blobs = blobProps
    }

    const relations: UnifiedDoc<Doc>[] = []
    for (const [key, value] of Object.entries(customProperties)) {
      if (masterTagAttributes.has(key)) {
        const attr = masterTagAttributes.get(key)
        if (attr === undefined) {
          throw new Error(`Attribute not found: ${key}, ${cardPath}`)

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Create/restore the blob file at the absolute path printed in the error message.
  2. Fix the relative blob path in the card YAML so it resolves from the card's directory (mind case sensitivity on Linux).
  3. Move the blob inside the imported directory tree so the blob scanner registers it in blobFiles.

Example fix

# before (card at /docs/cards/note.md)
blobs:
  - ../assets/spec.pdf   # file doesn't exist
# after — either add the file at ../assets/spec.pdf or:
blobs:
  - ./attachments/spec.pdf
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'fs'
import path from 'path'
function validateBlobsExist(cardPath: string, blobs: string[]): string[] {
  return blobs
    .map(b => path.resolve(path.dirname(cardPath), b))
    .filter(p => !fs.existsSync(p))
}

Try / catch

try {
  await processor.cardWithRelations(cardPath)
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Blob file not found:')) {
    const blobPath = e.message.match(/Blob file not found: (.+?) from:/)?.[1]
    console.error(`Missing blob ${blobPath} — restore the file or fix the relative path in the card`)
  } else throw e
}

Prevention

When it happens

Trigger: A card's YAML lists a blob (e.g. `blobs: [./files/report.pdf]`) but the file is missing, the relative path is wrong (wrong number of ../, case mismatch), the blob lives outside the scanned directory so it was never registered in blobFiles, or the blob has an extension/format the scanner didn't collect.

Common situations: Copying card files without their attachment folders; git repos where binary blobs were excluded via .gitignore/LFS not pulled; moving cards to a new directory without updating relative blob paths.

Related errors


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