wagoodman/dive · error

file tree has path errors (use '--ignore-errors' to attempt

Error message

file tree has path errors (use '--ignore-errors' to attempt to continue)

What it means

Raised lazily by the v1 UI config's TreeComparer() when building the filetree comparison cache over the analysis ref-trees produced path errors (duplicate paths, unhashable/corrupt nodes). By default these errors abort the TUI; the message points at the --ignore-errors flag which sets Preferences.IgnoreErrors to tolerate them and continue with the partially built comparer.

Source

Thrown at cmd/dive/cli/internal/ui/v1/config.go:54

		KeyBindings:                key.DefaultBindings(),
		ShowFiletreeAttributes:     true,
		ShowAggregatedLayerChanges: true,
		CollapseFiletreeDirectory:  false, // don't start with collapsed directories
		FiletreePaneWidth:          0.5,
		FiletreeDiffHide:           []string{}, // empty slice means show all
	}
}

func (c *Config) TreeComparer() (filetree.Comparer, error) {
	if c.do == nil {
		c.do = &sync.Once{}
	}
	c.do.Do(func() {
		treeStack := filetree.NewComparer(c.Analysis.RefTrees)
		errs := treeStack.BuildCache()
		if errs != nil {
			if !c.Preferences.IgnoreErrors {
				errs = append(errs, fmt.Errorf("file tree has path errors (use '--ignore-errors' to attempt to continue)"))
				c.stackErrs = errors.Join(errs...)
				return
			}
		}
		c.stack = treeStack
	})

	return c.stack, c.stackErrs
}

type ContentReader interface {
	Extract(ctx context.Context, id string, layer string, path string) error
}

View on GitHub (pinned to d6c691947f)

Solutions

  1. Re-run with --ignore-errors to let dive continue despite the path problems (results may be slightly incomplete).
  2. Inspect the joined underlying errors (errors.Join chain) to see which paths are problematic.
  3. Rebuild or normalize the image (e.g. docker save then docker load) to fix tar-level oddities.
  4. Report the image's builder details upstream if the tree should have been valid.

Example fix

# before
dive myimage:latest   # -> file tree has path errors (use '--ignore-errors' to attempt to continue)

# after
dive myimage:latest --ignore-errors
Defensive patterns

Strategy: fallback

Validate before calling

# preflight: tolerate path errors when the image source is not fully trusted
dive myimage --ignore-errors 2>/dev/null || dive myimage --ignore-errors

Prevention

When it happens

Trigger: Analyzing an image whose layer filetrees contain path inconsistencies — e.g. duplicate file paths across layers, invalid path characters, or malformed tar entries — while --ignore-errors is not set. BuildCache() returns non-empty errs and the original path errors are joined beneath this sentinel message.

Common situations: Images built by unusual or buggy builders (some old Docker versions, hand-crafted tars, windows-base images with case-differing paths); images with whiteout-file edge cases; after a dive version upgrade that tightened path validation.

Related errors


AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15). Data as JSON: /api/errors/54c91277ceb513ae. Report an issue: GitHub.