immich-app/immich · warning

No valid import paths found for library

Error message

No valid import paths found for library ${library.id}

What it means

During external-library sync, if every configured import path failed validation, there is nothing to crawl, so the sync job short-circuits with JobStatus.Skipped and this warning is logged naming the library id. It means the library is effectively unusable in its current configuration.

Solutions

  1. Fix or remove all invalid import paths shown by the per-path warnings for this library
  2. Verify the storage volume is mounted inside the container before triggering sync
  3. Re-validate paths and re-run library sync from the admin UI
  4. Check library id in the log matches the library you intended to configure

Example fix

// before
if (validImportPaths.length === 0) { this.logger.warn(`No valid import paths found for library ${library.id}`); return JobStatus.Skipped; }
// after
// ensure volume mounted then re-sync
// docker compose up -d  # with ./library:/path/to/library:ro
if (validImportPaths.length === 0) { this.logger.warn(`No valid import paths found for library ${library.id}`); return JobStatus.Skipped; }
Defensive patterns

Strategy: validation

Validate before calling

const checks = await Promise.all(library.importPaths.map(async (p) => ({ p, ok: await importPathUsable(p) })));
if (checks.every((c) => !c.ok)) throw new Error(`Library ${library.id} has no usable import paths`);

Prevention

When it happens

Trigger: handleQueueSyncFiles runs and all entries in library.importPaths fail validateImportPath (missing, unreadable, disallowed, or unmounted paths).

Common situations: Entire external volume offline at sync time; library paths configured before the storage was mounted; container restarted without the volume bind; all paths moved after a reorganization.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of immich-app/immich@e55ac299a4 (2026-09-15). Data as JSON: /api/errors/138f1707dc488950. Report an issue: GitHub.

Appendix: source

Thrown at server/src/services/library.service.ts:635

      this.logger.debug(`Library ${job.id} not found, skipping refresh`);
      return JobStatus.Skipped;
    }

    this.logger.debug(`Validating import paths for library ${library.id}...`);

    const validImportPaths: string[] = [];

    for (const importPath of library.importPaths) {
      const validation = await this.validateImportPath(importPath);
      if (validation.isValid) {
        validImportPaths.push(path.normalize(importPath));
      } else {
        this.logger.warn(`Skipping invalid import path: ${importPath}. Reason: ${validation.message}`);
      }
    }

    if (validImportPaths.length === 0) {
      this.logger.warn(`No valid import paths found for library ${library.id}`);

      return JobStatus.Skipped;
    }

    const pathsOnDisk = this.storageRepository.walk({
      pathsToCrawl: validImportPaths,
      includeHidden: false,
      exclusionPatterns: library.exclusionPatterns,
      take: JOBS_LIBRARY_PAGINATION_SIZE,
    });

    let importCount = 0;
    let crawlCount = 0;

    this.logger.log(`Starting disk crawl of ${validImportPaths.length} import path(s) for library ${library.id}...`);

    for await (const pathBatch of pathsOnDisk) {
      crawlCount += pathBatch.length;

View on GitHub (pinned to e55ac299a4)