{"record":{"id":"0e28debfd6c4823e","repo":"hcengineering/platform","slug":"file-not-found-fileabspath","errorCode":null,"errorMessage":"File not found: ${fileAbsPath}","messagePattern":"File not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/huly/cards.ts","lineNumber":898,"sourceCode":"  private validateFormat (data: Record<string, any>, schema: FormatSchema, filePath: string): void {\n    const currentPath = path.dirname(filePath)\n    const errors = validateSchema(data, schema, currentPath)\n    if (errors.length > 0) {\n      throw new Error(\n        'Invalid import schema in ' +\n          filePath +\n          ': \\n' +\n          Array.from(errors)\n            .map((e) => `    * ${e}`)\n            .join(';\\n') +\n          '\\n'\n      )\n    }\n  }\n\n  private validateFileExists (fileAbsPath: string): void {\n    if (!fs.existsSync(fileAbsPath)) {\n      throw new Error('File not found: ' + fileAbsPath)\n    }\n  }\n}\n","sourceCodeStart":880,"sourceCodeEnd":902,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/huly/cards.ts#L880-L902","documentation":"validateFileExists is a precondition helper that throws when an absolute file path passed to the processor does not exist on disk. It ensures referenced source files are present before any parsing is attempted, giving a clear early failure instead of downstream read errors.","triggerScenarios":"Calling a CardsProcessor entry point with a file path (card, blob, or referenced document) that has been deleted, renamed, or whose path was constructed incorrectly (wrong relative base, wrong casing, missing volume/working directory).","commonSituations":"Files excluded by .gitignore or LFS not checked out; case-sensitive filesystems where the path casing differs; running the importer from a different working directory so relative-to-cwd paths resolve elsewhere; stale cached paths after a refactor.","solutions":["Verify the exact absolute path in the message exists (ls the path) and create/restore the file if missing.","Fix casing to match the filesystem exactly (Linux is case-sensitive).","Check how the path is constructed — ensure relative references resolve from the correct base directory.","Ensure the file is committed/pulled and not excluded by .gitignore, LFS settings, or CI checkout rules."],"exampleFix":"// before\nawait processor.process('docs/Cards/Note.md') // wrong casing, file is cards/note.md\n// after\nawait processor.process(path.resolve('docs/cards/note.md'))","handlingStrategy":"validation","validationCode":"import fs from 'fs'\nimport path from 'path'\nfunction assertFileExists(file: string): string {\n  const abs = path.resolve(file)\n  if (!fs.existsSync(abs)) throw new Error(`Pre-check failed: ${abs} does not exist`)\n  return abs\n}","typeGuard":null,"tryCatchPattern":"try {\n  await processor.process(file)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('File not found:')) {\n    const p = e.message.replace('File not found: ', '')\n    console.error(`${p} missing — check existence, casing, and that the file isn't gitignored/LFS-skipped`)\n  } else throw e\n}","preventionTips":["Always resolve paths to absolute before passing them to the processor.","On Linux, match file-name casing exactly.","Ensure referenced files are committed and not excluded by .gitignore, LFS, or CI checkout rules.","Run an existence pre-check over all input paths before starting a bulk import."],"tags":["importer","file-not-found","filesystem","path-resolution"],"backgroundTag":"referenced-file-missing","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}