dagger/dagger · error

list before directories: %w

Error message

list before directories: %w

What it means

computeChangesetPaths walks the mounted before-directory tree via listSubdirectories to find added/removed directories. This error fires when listing subdirectories of the before mount fails (I/O error on the bind-mounted snapshot), aborting path diff computation.

Source

Thrown at core/changeset.go:268

		}
		if _, ok := seen[parent]; ok {
			continue
		}
		seen[parent] = struct{}{}
		collapsed = append(collapsed, parent)
	}
	return collapsed
}

func computeChangesetPaths(ctx context.Context, beforeDir, afterDir string) (*ChangesetPaths, error) {
	fc, err := compareDirectories(ctx, beforeDir, afterDir)
	if err != nil {
		return nil, err
	}

	beforeDirs, err := listSubdirectories(beforeDir)
	if err != nil {
		return nil, fmt.Errorf("list before directories: %w", err)
	}
	afterDirs, err := listSubdirectories(afterDir)
	if err != nil {
		return nil, fmt.Errorf("list after directories: %w", err)
	}
	addedDirs, removedDirs := diffStringSlices(beforeDirs, afterDirs)

	// Expand renames into Added/Removed so addedPaths/removedPaths stay complete.
	renamedNew := make([]string, 0, len(fc.Renamed))
	renamedOld := make([]string, 0, len(fc.Renamed))
	for newPath, oldPath := range fc.Renamed {
		renamedNew = append(renamedNew, newPath)
		renamedOld = append(renamedOld, oldPath)
	}

	// Sort to match computeChangesetPathsDelta: both paths must emit one
	// canonical order, or which order a caller observes silently depends on
	// whether the metadata delta walk succeeded on the underlying mounts.

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Check the wrapped filesystem error on the mounted before directory
  2. Retry; the mount is recreated per invocation
  3. Verify the before snapshot ref is still valid and mountable
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at core/changeset.go:268 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/e63183448b3a7198. Report an issue: GitHub.