{"record":{"id":"0fbab75bb1269fd8","repo":"hcengineering/platform","slug":"blob-file-not-found-blobpath-from-cardpath","errorCode":null,"errorMessage":"Blob file not found: ${blobPath} from:${cardPath}","messagePattern":"Blob file not found: (.+?) from:(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/huly/cards.ts","lineNumber":543,"sourceCode":"    const cardSchema = this.createCardSchema(masterTagAttributes, masterTagAssociaions, tagAttributes, tagAssociations)\n    this.validateFormat(cardHeader, cardSchema, cardPath)\n\n    const cardId = this.metadataRegistry.getRef(cardPath) as Ref<Card>\n    const cardProps: Record<string, any> = {\n      _id: cardId,\n      space: 'card:space:Default' as Ref<Space>,\n      title,\n      parent: parentCardId\n    }\n\n    const blobs = rawBlobs !== undefined ? (Array.isArray(rawBlobs) ? rawBlobs : [rawBlobs]) : []\n    if (blobs.length > 0) {\n      const blobProps: Record<string, BlobType> = {}\n      for (const blob of blobs) {\n        const blobPath = path.resolve(path.dirname(cardPath), blob)\n        const blobFile = blobFiles.get(blobPath)\n        if (blobFile === undefined) {\n          throw new Error('Blob file not found: ' + blobPath + ' from:' + cardPath)\n        }\n        blobProps[blobFile._id] = {\n          file: blobFile._id,\n          type: blobFile.type,\n          name: blobFile.name,\n          size: blobFile.size,\n          metadata: {} // todo: blobFile.metadata\n        }\n      }\n      cardProps.blobs = blobProps\n    }\n\n    const relations: UnifiedDoc<Doc>[] = []\n    for (const [key, value] of Object.entries(customProperties)) {\n      if (masterTagAttributes.has(key)) {\n        const attr = masterTagAttributes.get(key)\n        if (attr === undefined) {\n          throw new Error(`Attribute not found: ${key}, ${cardPath}`)","sourceCodeStart":525,"sourceCodeEnd":561,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/huly/cards.ts#L525-L561","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Create/restore the blob file at the absolute path printed in the error message.","Fix the relative blob path in the card YAML so it resolves from the card's directory (mind case sensitivity on Linux).","Move the blob inside the imported directory tree so the blob scanner registers it in blobFiles."],"exampleFix":"# before (card at /docs/cards/note.md)\nblobs:\n  - ../assets/spec.pdf   # file doesn't exist\n# after — either add the file at ../assets/spec.pdf or:\nblobs:\n  - ./attachments/spec.pdf","handlingStrategy":"validation","validationCode":"import fs from 'fs'\nimport path from 'path'\nfunction validateBlobsExist(cardPath: string, blobs: string[]): string[] {\n  return blobs\n    .map(b => path.resolve(path.dirname(cardPath), b))\n    .filter(p => !fs.existsSync(p))\n}","typeGuard":null,"tryCatchPattern":"try {\n  await processor.cardWithRelations(cardPath)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Blob file not found:')) {\n    const blobPath = e.message.match(/Blob file not found: (.+?) from:/)?.[1]\n    console.error(`Missing blob ${blobPath} — restore the file or fix the relative path in the card`)\n  } else throw e\n}","preventionTips":["Commit cards together with their blob/attachment folders — never .gitignore binaries they reference.","If using Git LFS, ensure blobs are pulled (git lfs pull) before importing.","When moving card files, update relative blob paths in the same change."],"tags":["importer","file-not-found","blobs","path-resolution"],"backgroundTag":"referenced-file-missing","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}