{"record":{"id":"24c4f4f473e2b28a","repo":"dagger/dagger","slug":"failed-to-content-hash-dockerfile-bind-mount-sour","errorCode":null,"errorMessage":"failed to content hash dockerfile bind mount: source snapshot: %w","messagePattern":"failed to content hash dockerfile bind mount: source snapshot: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/container.go","lineNumber":2798,"sourceCode":"\t// Key the result on the mounted content rather than the source directory's\n\t// recipe, mirroring BuildKit's content-checksummed bind-mount cache keys.\n\t// A taught content digest is a global alias for the result's cache identity,\n\t// so it must still include everything that distinguishes this container:\n\t// the parent it was built from and the target/readOnly mount config.\n\tparentDgst, err := parent.ContentPreferredDigest(ctx)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to content hash dockerfile bind mount: parent digest: %w\", err)\n\t}\n\tdagqlCache, err := dagql.EngineCache(ctx)\n\tif err != nil {\n\t\treturn inst, err\n\t}\n\tif err := dagqlCache.Evaluate(ctx, dir); err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to content hash dockerfile bind mount: evaluate source: %w\", err)\n\t}\n\tsrcSnapshot, err := dir.Self().Snapshot.GetOrEval(ctx, dir.Result)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to content hash dockerfile bind mount: source snapshot: %w\", err)\n\t}\n\tsrcRoot, err := dir.Self().Dir.GetOrEval(ctx, dir.Result)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to content hash dockerfile bind mount: source path: %w\", err)\n\t}\n\tsrcHash := \"empty\"\n\tif srcSnapshot != nil {\n\t\tdgst, err := core.GetContentHashFromFile(ctx, srcSnapshot, path.Join(srcRoot, args.SourcePath))\n\t\tif err != nil {\n\t\t\treturn inst, fmt.Errorf(\"failed to content hash dockerfile bind mount at %q: %w\", args.SourcePath, err)\n\t\t}\n\t\tsrcHash = string(dgst)\n\t}\n\treturn inst.WithContentDigest(ctx, hashutil.HashStrings(\n\t\t\"__withMountedPathDockerfileCompat\",\n\t\tstring(parentDgst),\n\t\ttarget,\n\t\tstrconv.FormatBool(args.ReadOnly),","sourceCodeStart":2780,"sourceCodeEnd":2816,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/container.go#L2780-L2816","documentation":"Dockerfile bind-mount cache-key computation failed to obtain the source directory's snapshot (GetOrEval on the mounted dir). This is an internal evaluation error while materializing the mount context for content hashing — the source directory could not be snapshotted for the cache key.","triggerScenarios":"Snapshot.GetOrEval fails for the mount source Directory — the underlying checkpoint/snapshot of the directory tree cannot be materialized (storage error, missing blob, failed evaluation).","commonSituations":"Corrupted or pruned content-addressable store; directory whose snapshot evaluation hits an engine/storage error; very large directories timing out during snapshot.","solutions":["Read the wrapped inner error to identify the snapshot/storage failure.","Check engine content store health and disk space; re-run the pipeline step producing the source directory.","Retry the build; if persistent, clear/rebuild the engine's cache state."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := mount(ctx); err != nil {\n    if strings.Contains(err.Error(), \"source snapshot\") {\n        // check store health, retry\n    }\n}","preventionTips":["Monitor content-addressable store disk usage and integrity","Fix failing upstream steps that produce the source directory","Retry transient snapshot failures before diagnosing deeper"],"tags":["snapshot","dockerfile","mount","storage"],"backgroundTag":"content-digest-computation-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"}