{"record":{"id":"47f73030f55f99ef","repo":"dagger/dagger","slug":"context-directory-call-w","errorCode":null,"errorMessage":"context directory call: %w","messagePattern":"context directory call: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/modulesource.go","lineNumber":1520,"sourceCode":"\t//   2. otherwise the module source itself.\n\t//\n\t// NOTE: this applies unilaterally, whether the module was loaded from Host,\n\t// Git, or a Directory.\n\tif ws, ok := WorkspaceFromContext(ctx); ok {\n\t\tinst, err = src.loadContextFromWorkspace(ctx, dag, ws, path, filterInputs)\n\t} else {\n\t\tinst, err = NewModuleSourceFS(nil, src).directory(ctx, dag, path, filterInputs)\n\t}\n\tif err != nil {\n\t\treturn inst, err\n\t}\n\tinstID, err := inst.ID()\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"context directory ID: %w\", err)\n\t}\n\tinstCall, err := inst.ResultCall()\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"context directory call: %w\", err)\n\t}\n\tif instID != nil && instCall.ContentDigest() == \"\" {\n\t\tsnapshot, err := inst.Self().Snapshot.GetOrEval(ctx, inst.Result)\n\t\tif err != nil {\n\t\t\treturn inst, fmt.Errorf(\"context directory snapshot: %w\", err)\n\t\t}\n\t\tdirPath, err := inst.Self().Dir.GetOrEval(ctx, inst.Result)\n\t\tif err != nil {\n\t\t\treturn inst, fmt.Errorf(\"context directory path: %w\", err)\n\t\t}\n\t\tdgst, err := GetContentHashFromDirectory(ctx, snapshot, dirPath)\n\t\tif err != nil {\n\t\t\treturn inst, fmt.Errorf(\"failed to content-hash contextual directory: %w\", err)\n\t\t}\n\t\tinst, err = inst.WithContentDigest(ctx, dgst)\n\t\tif err != nil {\n\t\t\treturn inst, fmt.Errorf(\"failed to set contextual directory content digest: %w\", err)\n\t\t}","sourceCodeStart":1502,"sourceCodeEnd":1538,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/modulesource.go#L1502-L1538","documentation":"Wraps a failure to retrieve the ResultCall (the dagql call metadata) of the context Directory instance. LoadContextDir needs the call to compute a content digest for cache keying; if the instance's result call cannot be resolved, this error is returned.","triggerScenarios":"ModuleSource.LoadContextDir runs and inst.ResultCall() fails — the dagql instance lacks a recorded result call, usually because the instance wasn't produced by a normal dagql Select/evaluation.","commonSituations":"Hit in internal module-loading paths, especially with workspace-bound contexts or custom Directory provisioning; almost always an engine-internal state issue rather than a user mistake.","solutions":["Look at the wrapped inner error for the root cause","Ensure the Directory instance originates from a dagql Select call with recorded call metadata","Retry the module load after clearing the engine session if state appears stale","File an upstream issue with reproduction if it persists"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Go: ensure instance was produced by a Select (has result metadata)\nif inst.Result == nil {\n    return fmt.Errorf(\"directory has no dagql result; obtain it via dag.Select\")\n}","typeGuard":null,"tryCatchPattern":"instCall, err := inst.ResultCall()\nif err != nil {\n    return nil, fmt.Errorf(\"context directory call: %w\", err)\n}","preventionTips":["Never hand-build dagql instances that bypass Select","Keep engine/CLI versions matched","File upstream issues with the unwrapped cause"],"tags":["dagql","directory","call-metadata"],"backgroundTag":"dagql-result-call-missing","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"}