dagger/dagger · error
nil change
Error message
nil change
What it means
Defensive nil guard at the top of applier.Apply: the caller passed a nil *change to the diff applier. Changes are produced internally by the diff/apply machinery, so this indicates an upstream bookkeeping bug or an uninitialized change in user-authored extensions of that pipeline.
Source
Thrown at engine/snapshots/diffapply_linux.go:201
}
a.root = root
prevRelease := a.release
a.release = func() error {
err := mnter.Unmount()
return multierror.Append(err, prevRelease()).ErrorOrNil()
}
}
a.root, err = filepath.EvalSymlinks(a.root)
if err != nil {
return nil, errors.Wrapf(err, "failed to resolve symlinks in %s", a.root)
}
return a, nil
}
func (a *applier) Apply(ctx context.Context, c *change) error {
if c == nil {
return errors.New("nil change")
}
if c.kind == continuityfs.ChangeKindUnmodified {
return nil
}
dstPath, err := safeJoin(a.root, c.subPath)
if err != nil {
return errors.Wrapf(err, "failed to join paths %q and %q", a.root, c.subPath)
}
var dstStat *syscall.Stat_t
if dstfi, err := os.Lstat(dstPath); err == nil {
stat, ok := dstfi.Sys().(*syscall.Stat_t)
if !ok {
return errors.Errorf("failed to get stat_t for %T", dstStat)
}
dstStat = stat
} else if !os.IsNotExist(err) {View on GitHub (pinned to 82ba2681db)
Solutions
- Check for nil before calling Apply and skip or log the entry
- Fix the walker/callback so it never emits nil changes
- Ensure error paths that would produce a nil change return the error instead
Example fix
// before
applier.Apply(ctx, c) // c may be nil
// after
if c == nil { return nil } // or log & skip
applier.Apply(ctx, c) Defensive patterns
Strategy: validation
Validate before calling
if c == nil {
return errors.New("cannot apply nil change")
}
_ = applier.Apply(ctx, c) Type guard
func validChange(c *change) bool { return c != nil } Prevention
- Filter nil entries when collecting changes from walkers
- Return errors instead of nil changes in change factories
- Add assertions in walker callbacks
When it happens
Trigger: Passing nil directly to (*applier).Apply, or a change-walk callback that appends nil entries into the change channel/slice.
Common situations: Custom continuityfs walkers that yield nil on skipped entries; bugs in code that builds the change list (e.g. returning nil from a factory on error without checking).
Related errors
- failed to get global configuration: %w
- collect ID requires handle-form ID
- workspace is required
- bind session resource: nil cache
- bind session resource: empty session ID
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/4a1ff0c8f93b98f2.
Report an issue: GitHub.