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
- Re-run with --ignore-errors to let dive continue despite the path problems (results may be slightly incomplete).
- Inspect the joined underlying errors (errors.Join chain) to see which paths are problematic.
- Rebuild or normalize the image (e.g. docker save then docker load) to fix tar-level oddities.
- 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
- Add --ignore-errors to pipelines that scan third-party or unusual images.
- Normalize images (docker save/load) before analysis to repair tar oddities.
- Read the joined error chain to identify offending paths before ignoring them.
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
- cannot export analysis: %w
- unable to determine image source from %q: %v
- failed to unmarshal CI config file %s: %w
- directory for JSON export does not exist: %s
- controller failed update: %w
AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15).
Data as JSON: /api/errors/54c91277ceb513ae.
Report an issue: GitHub.