{"record":{"id":"3003fe6e194b790a","repo":"dagger/dagger","slug":"materialize-changes-for-changeset-d-w","errorCode":null,"errorMessage":"materialize changes for changeset %d: %w","messagePattern":"materialize changes for changeset (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/changeset.go","lineNumber":1208,"sourceCode":"\t}\n\n\t// Each diff is an independent snapshot-diff materialization, so take them\n\t// all at once.\n\tvar ourContent *changesetContent\n\totherContents := make([]*changesetContent, len(others))\n\tcontentJobs := changesetJobs().WithJob(\"self changes\", func(ctx context.Context) error {\n\t\tcontent, err := ch.content(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"materialize our changes: %w\", err)\n\t\t}\n\t\tourContent = content\n\t\treturn nil\n\t})\n\tfor i, other := range others {\n\t\tcontentJobs = contentJobs.WithJob(fmt.Sprintf(\"changeset %d changes\", i), func(ctx context.Context) error {\n\t\t\tcontent, err := other.content(ctx)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"materialize changes for changeset %d: %w\", i, err)\n\t\t\t}\n\t\t\totherContents[i] = content\n\t\t\treturn nil\n\t\t})\n\t}\n\tif err := contentJobs.Run(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\n\tafterDir, err := enginetel.TaskRet(ctx, \"octopus merge\", func(ctx context.Context) (*Directory, error) {\n\t\treturn gitOctopusMergeChangesets(ctx, before, ourContent, otherContents)\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn enginetel.TaskRet(ctx, \"new changeset from merge\", func(ctx context.Context) (*Changeset, error) {\n\t\treturn newChangesetFromMerge(ctx, before, afterDir)","sourceCodeStart":1190,"sourceCodeEnd":1226,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/changeset.go#L1190-L1226","documentation":"During multiway merging, each incoming changeset's content is materialized in a parallel job named 'changeset %d changes'; failures are wrapped with the changeset index. This identifies exactly which of the N incoming changesets could not have its content materialized.","triggerScenarios":"Calling the multiway merge API where other.content(ctx) fails for changeset i in the others slice - path computation, dagql Select, or EngineCache.Evaluate errors inside the parallel job.","commonSituations":"One of many merged changesets came from a failed or foreign pipeline; oversized directory content that fails evaluation; shared context cancelled by another job's failure.","solutions":["Use the index in the message to locate the failing changeset and inspect its wrapped cause.","Rebuild or drop the offending changeset and retry the merge.","Materialize each changeset's content (via ComputePaths/Sync on After) before the batch merge to fail fast and localize errors.","Retry with a fresh context; check engine logs for the failing dagql query."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for i, cs := range others {\n    if _, err := cs.ComputePaths(ctx); err != nil {\n        return fmt.Errorf(\"changeset %d unusable before merge: %w\", i, err)\n    }\n}","typeGuard":"func allChangesetsValid(others []*dagger.Changeset) bool {\n    for _, cs := range others { if cs == nil { return false } }\n    return true\n}","tryCatchPattern":"merged, err := base.WithChangesets(ctx, others)\nif err != nil {\n    var idx int\n    if n, _ := fmt.Sscanf(err.Error(), \"materialize changes for changeset %d\", &idx); n == 1 {\n        return fmt.Errorf(\"changeset at index %d could not be materialized: %w\", idx, err)\n    }\n    return err\n}","preventionTips":["Pre-validate each incoming changeset's computability before batch merging.","Ensure parent pipeline steps succeeded so changeset content is evaluable.","Allow adequate context deadlines for parallel content jobs on large trees."],"tags":["go","dagger","changeset","concurrency","error-wrapping"],"backgroundTag":"dagql-evaluation-failed","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}