{"record":{"id":"26cc845ab0cae05f","repo":"janhq/jan","slug":"file-not-found-path","errorCode":null,"errorMessage":"File not found: ${path}","messagePattern":"File not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"extensions/llamacpp-extension/src/index.ts","lineNumber":1938,"sourceCode":"              ? opts.modelSha256\n              : saveName === 'mmproj.gguf'\n                ? opts.mmprojSha256\n                : undefined,\n          size:\n            saveName === 'model.gguf'\n              ? opts.modelSize\n              : saveName === 'mmproj.gguf'\n                ? opts.mmprojSize\n                : undefined,\n          model_id: modelId,\n        })\n        return localPath\n      }\n\n      // if local file (absolute path), check if it exists\n      // and return the path\n      if (!(await fs.existsSync(path)))\n        throw new Error(`File not found: ${path}`)\n      return path\n    }\n\n    let modelPath = await maybeDownload(opts.modelPath, 'model.gguf')\n    let mmprojPath = opts.mmprojPath\n      ? await maybeDownload(opts.mmprojPath, 'mmproj.gguf')\n      : undefined\n    // Speculative-decoding draft companion; paired with the main model. The\n    // file name stays `mtp.gguf` for every flavour: it is the local name of\n    // the paired draft, and changing it would orphan existing installs.\n    let draftModelPath = opts.specDraftPath\n      ? await maybeDownload(opts.specDraftPath, 'mtp.gguf')\n      : undefined\n\n    if (downloadItems.length > 0) {\n      try {\n        // emit download update event on progress\n        const onProgress = (transferred: number, total: number) => {","sourceCodeStart":1920,"sourceCodeEnd":1956,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/extensions/llamacpp-extension/src/index.ts#L1920-L1956","documentation":"The load-model path resolves opts.modelPath and opts.mmprojPath via maybeDownload(): remote URLs are downloaded, while local absolute paths are checked with fs.existsSync(). If a local path does not exist, 'File not found: <path>' is thrown before any model loading begins.","triggerScenarios":"Loading a model with opts.modelPath or opts.mmprojPath set to an absolute local path where the .gguf file does not exist; a moved/renamed/deleted model file; a wrong path in model.yml.","commonSituations":"Model file deleted from disk or moved to another drive; path recorded under an old data-folder location after an app update/migration; typo in the path; mount/external drive not connected.","solutions":["Verify the file exists at the given path (ls/Check on disk) and fix opts.modelPath / opts.mmprojPath","Point the model config to the correct location or re-import the model with valid paths","Re-download the model if the file was lost","Check the Jan data folder location did not change between versions and update configs accordingly"],"exampleFix":"// before\nawait loadModel({ modelPath: '/old/path/model.gguf' })\n// after\nif (!fs.existsSync('/new/path/model.gguf')) throw new Error('check path')\nawait loadModel({ modelPath: '/new/path/model.gguf' })","handlingStrategy":"validation","validationCode":"import { existsSync } from 'fs'\nfor (const p of [opts.modelPath, opts.mmprojPath]) {\n  if (p && !p.startsWith('http') && !existsSync(p)) throw new Error(`missing file: ${p}`)\n}\nawait loadModel(opts)","typeGuard":"const isExistingLocalFile = (p: unknown): p is string =>\n  typeof p === 'string' && !/^https?:\\/\\//.test(p) && existsSync(p)","tryCatchPattern":"try {\n  await loadModel(opts)\n} catch (e) {\n  if (e.message.startsWith('File not found:')) {\n    const missing = e.message.slice('File not found: '.length)\n    await redownloadOrRelocate(missing); return loadModel(opts)\n  }\n  throw e\n}","preventionTips":["Verify model paths in model.yml after app updates/migrations","Keep models on stable, mounted storage","Re-download models after manual cleanup of the data folder","Log the resolved path before loading for easy diagnosis"],"tags":["file-not-found","gguf","path"],"backgroundTag":"file-not-found","analyzedSha":"7205d770c1e097c3daf35a911176410e93bc5564","analyzedAt":"2026-09-17T14:27:30.100Z","contentChangedAt":"2026-09-17T14:27:30.100Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}