dagger/dagger · error
patch did not reproduce changeset content: modified %v, rena
Error message
patch did not reproduce changeset content: modified %v, renamed %v
What it means
reconcileDirsAfterPatch verification failure: the patched tree still differs from the expected changeset — files remain modified or renamed that the patch should have reproduced. The patch application produced wrong content for regular files.
Source
Thrown at core/mcp.go:955
}
dirChanged := slices.ContainsFunc(
slices.Concat(origPaths.Added, origPaths.AllRemoved),
func(p string) bool { return strings.HasSuffix(p, "/") },
)
if !dirChanged {
return patched, nil
}
residual, err := NewChangeset(ctx, patched, changes.Self().After)
if err != nil {
return patched, err
}
paths, err := residual.ComputePaths(ctx)
if err != nil {
return patched, fmt.Errorf("compute patch residue: %w", err)
}
if len(paths.Modified) > 0 || len(paths.Renamed) > 0 {
return patched, fmt.Errorf("patch did not reproduce changeset content: modified %v, renamed %v", paths.Modified, paths.Renamed)
}
for _, p := range slices.Concat(paths.Added, paths.AllRemoved) {
if !strings.HasSuffix(p, "/") {
return patched, fmt.Errorf("patch did not reproduce changeset file %q", p)
}
}
// Recorded as selectors on the overlay chain, so they are pure data like
// the patch itself, and replay tolerantly: withNewDirectory is mkdir -p,
// withoutDirectory ignores an already-missing path.
for _, dir := range paths.Added {
if err := srv.Select(ctx, patched, &patched, dagql.Selector{
View: srv.View,
Field: "withNewDirectory",
Args: []dagql.NamedInput{
{Name: "path", Value: dagql.NewString(strings.TrimSuffix(dir, "/"))},
},
}); err != nil {
return patched, fmt.Errorf("restore directory %q: %w", dir, err)View on GitHub (pinned to 82ba2681db)
Solutions
- Regenerate the patch from the current diff rather than reusing a stale one
- Check the patch applies cleanly (context lines, line endings)
- Verify the 'after' tree recorded in the changeset matches expectations
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/mcp.go:955 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/a8d0c2fb5db1e06c.
Report an issue: GitHub.