{"record":{"id":"c5090b151195841e","repo":"immich-app/immich","slug":"skipping-invalid-import-path-importpath-reason-validation","errorCode":null,"errorMessage":"Skipping invalid import path: ${importPath}. Reason: ${validation.message}","messagePattern":"Skipping invalid import path: (.+?)\\. Reason: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/src/services/library.service.ts","lineNumber":630,"sourceCode":"\n  @OnJob({ name: JobName.LibrarySyncFilesQueueAll, queue: QueueName.Library })\n  async handleQueueSyncFiles(job: JobOf<JobName.LibrarySyncFilesQueueAll>): Promise<JobStatus> {\n    const library = await this.libraryRepository.get(job.id);\n    if (!library) {\n      this.logger.debug(`Library ${job.id} not found, skipping refresh`);\n      return JobStatus.Skipped;\n    }\n\n    this.logger.debug(`Validating import paths for library ${library.id}...`);\n\n    const validImportPaths: string[] = [];\n\n    for (const importPath of library.importPaths) {\n      const validation = await this.validateImportPath(importPath);\n      if (validation.isValid) {\n        validImportPaths.push(path.normalize(importPath));\n      } else {\n        this.logger.warn(`Skipping invalid import path: ${importPath}. Reason: ${validation.message}`);\n      }\n    }\n\n    if (validImportPaths.length === 0) {\n      this.logger.warn(`No valid import paths found for library ${library.id}`);\n\n      return JobStatus.Skipped;\n    }\n\n    const pathsOnDisk = this.storageRepository.walk({\n      pathsToCrawl: validImportPaths,\n      includeHidden: false,\n      exclusionPatterns: library.exclusionPatterns,\n      take: JOBS_LIBRARY_PAGINATION_SIZE,\n    });\n\n    let importCount = 0;\n    let crawlCount = 0;","sourceCodeStart":612,"sourceCodeEnd":648,"githubUrl":"https://github.com/immich-app/immich/blob/e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c/server/src/services/library.service.ts#L612-L648","documentation":"When syncing an external library, each configured import path is validated (existence, readability, and that it is an allowed path). If validation fails, the path is skipped and this warning names the path plus the validation reason. Sync continues with the remaining valid paths.","triggerScenarios":"An import path no longer exists or is unreadable on disk, points outside the allowed import roots, is a file instead of a directory, or fails validateImportPath for permissions reasons during handleQueueSyncFiles.","commonSituations":"External storage not mounted at sync time; import path renamed/moved; path added via config pointing at a location the server user cannot read; path blocked because it overlaps internal data directories.","solutions":["Read validation.message in the log for the exact reason and fix that cause","Check the path exists and is readable by the server process user","If on external storage, verify the volume is mounted before sync","Remove or correct the import path in the library settings","Ensure the path does not overlap Immich's internal upload/.immich directories"],"exampleFix":"// before\n{ this.logger.warn(`Skipping invalid import path: ${importPath}. Reason: ${validation.message}`); }\n// after\n// fix on deployment side, e.g. ensure mount exists\n// mount /mnt/library && chown -R immich:immich /mnt/library\n{ this.logger.warn(`Skipping invalid import path: ${importPath}. Reason: ${validation.message}`); }","handlingStrategy":"validation","validationCode":"async function importPathUsable(p: string): Promise<boolean> {\n  try { const s = await stat(p); return s.isDirectory(); } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate import paths after any volume mount or config change","Ensure the server user has read+execute on the path tree","Keep import paths outside Immich's internal directories","Watch sync logs for skipped-path warnings after reorganizations"],"tags":["library","filesystem","validation"],"backgroundTag":"directory-not-found","analyzedSha":"e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c","analyzedAt":"2026-09-15T07:20:19.675Z","contentChangedAt":"2026-09-15T07:20:19.675Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}