{"record":{"id":"bbcf1ffcebc4c108","repo":"dagger/dagger","slug":"failed-to-call-sdk-moduletypes-w","errorCode":null,"errorMessage":"failed to call sdk moduleTypes: %w","messagePattern":"failed to call sdk moduleTypes: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/sdk/module_typedefs.go","lineNumber":96,"sourceCode":"\t\t\tField: \"moduleTypes\",\n\t\t\tArgs: []dagql.NamedInput{\n\t\t\t\t{\n\t\t\t\t\tName:  \"modSource\",\n\t\t\t\t\tValue: dagql.NewID[*core.ModuleSource](sourceID),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:  \"introspectionJson\",\n\t\t\t\t\tValue: dagql.NewID[*core.File](schemaJSONFileID),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:  \"outputFilePath\",\n\t\t\t\t\tValue: dagql.NewString(moduleIDPath),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to call sdk moduleTypes: %w\", err)\n\t}\n\n\thideCtx := dagql.WithSkip(ctx)\n\terr = dag.Select(hideCtx, ctr, &ctr,\n\t\tdagql.Selector{\n\t\t\tField: \"withExec\",\n\t\t\tArgs: []dagql.NamedInput{\n\t\t\t\t{Name: \"args\", Value: dagql.ArrayInput[dagql.String]{}},\n\t\t\t\t{Name: \"useEntrypoint\", Value: dagql.NewBoolean(true)},\n\t\t\t\t{Name: \"experimentalPrivilegedNesting\", Value: dagql.NewBoolean(true)},\n\t\t\t\t{Name: \"execMD\", Value: dagql.NewDigestedSerializedString(&execMD, moduleTypesExecMDDigest)},\n\t\t\t\t{Name: \"moduleContext\", Value: dagql.Opt(moduleContextID)},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to execute sdk moduleTypes container: %w\", err)\n\t}","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/sdk/module_typedefs.go#L78-L114","documentation":"This error wraps any failure from the dagql Select call that invokes the SDK runtime's `moduleTypes` field to build a container for generating module type definitions. It is thrown by the dagger engine's core/sdk package during `ModuleTypes`, the phase where a module's SDK runtime container is called to emit /module-typedefs.json. The underlying %w error carries the real cause (SDK function resolution, GraphQL field error, etc.).","triggerScenarios":"The dag.Select on sdkInst.sdk with Field \"moduleTypes\" (args modSource, introspectionJson, outputFilePath) returns an error — e.g. the SDK runtime image cannot be resolved, the sdk module failed to initialize, or the underlying GraphQL query errored.","commonSituations":"A module's SDK runtime (e.g. the Go/Python/TS SDK module) has a bug or incompatible version; the source repository or ref cannot be resolved; the engine cannot serve the introspection JSON ID; network failure pulling the SDK base image.","solutions":["Read the wrapped %w cause to find the real failure (SDK runtime error, image pull, invalid source).","Verify the module's source (dir/ref) is valid and reachable.","Upgrade the dagger CLI/engine and module SDK dependencies to matching versions.","Re-run with debug logging / telemetry to see the failing nested span."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Go caller: ensure source and deps are valid before invoking module operations\nif src == nil || deps == nil {\n    return fmt.Errorf(\"module source and schema deps must be initialized before codegen\")\n}","typeGuard":null,"tryCatchPattern":"inst, err := sdkInst.ModuleTypes(ctx, deps, source, mod)\nif err != nil {\n    var gqlErr * dagql.QueryError // inspect wrapped cause\n    return fmt.Errorf(\"module sdk moduleTypes call failed: %w\", err)\n}","preventionTips":["Keep dagger CLI and engine versions in sync","Pin SDK module dependency versions","Validate module source refs before codegen","Capture full error chains (%w) when diagnosing"],"tags":["dagger","sdk","codegen","dagql"],"backgroundTag":"sdk-module-types-call-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"}