{"record":{"id":"b78d52bfd40649f0","repo":"dagger/dagger","slug":"inspect-sdk-s-args-w","errorCode":null,"errorMessage":"inspect sdk %s args: %w","messagePattern":"inspect sdk (.+?) args: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/sdk/module_init.go","lineNumber":94,"sourceCode":"\t\tField: fn.Name,\n\t\tArgs:  callArgs,\n\t}); err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to call sdk module %s: %w\", fn.Name, err)\n\t}\n\treturn inst, nil\n}\n\nfunc (sdk *module) initFunctionCallArgs(\n\tctx context.Context,\n\tdag *dagql.Server,\n\tfn *core.Function,\n\tworkspace dagql.ObjectResult[*core.Workspace],\n\tstandardArgs map[string]any,\n\tsdkArgs map[string]any,\n) ([]dagql.NamedInput, error) {\n\tfieldSpec, err := fn.FieldSpec(ctx, core.NewUserMod(sdk.mod))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"inspect sdk %s args: %w\", fn.Name, err)\n\t}\n\tinputs := fieldSpec.Args.Inputs(dag.View)\n\tinputByName := make(map[string]dagql.InputSpec, len(inputs))\n\tfor _, input := range inputs {\n\t\tinputByName[input.Name] = input\n\t}\n\n\tworkspaceID, err := workspace.ID()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"workspace id: %w\", err)\n\t}\n\n\tusedSDKArgs := map[string]struct{}{}\n\tnamed := make([]dagql.NamedInput, 0, len(inputs))\n\tfor _, argRes := range fn.Args {\n\t\targ := argRes.Self()\n\t\tinput, ok := inputByName[arg.Name]\n\t\tif !ok {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/sdk/module_init.go#L76-L112","documentation":"Dagger wraps failures from fn.FieldSpec while building the argument list for an SDK init function call. FieldSpec inspects the SDK function's declared GraphQL schema so standard and user args can be matched and decoded; if introspection of the function's spec fails, arguments cannot be assembled.","triggerScenarios":"Calling InitModule/InitClient where the SDK runtime's function spec cannot be built: the function's schema is malformed, its declared types are unsupported/unknown to the core type system, or a declared arg input cannot be resolved in the current dagql view.","commonSituations":"Custom SDK declaring args with unsupported types; SDK runtime schema out of sync with the engine's expected init function signatures (version mismatch); corrupted SDK module schema cache.","solutions":["Read the wrapped inner error to find which function/arg spec failed","Update CLI/engine and SDK runtime to matching versions","If using a custom SDK, ensure initModule/initClient signatures match the current SDK interface spec","Clear engine cache and retry"],"exampleFix":"// before: custom SDK with legacy initModule signature\nInitModule(name, path string) ...\n// after: match current interface (include workspace + args)\nInitModule(workspace Workspace, name string, path string, args map[string]any) ...","handlingStrategy":"try-catch","validationCode":"// shell: confirm CLI/SDK compatibility before init\ndagger version\n# update engine/CLI so built-in SDK schemas match expectations\n# dagger update / upgrade engine as needed","typeGuard":null,"tryCatchPattern":"// Go client\n_, err := ws.InitModule(ctx, name, path, args)\nif err != nil && strings.Contains(err.Error(), \"inspect sdk \") {\n    return fmt.Errorf(\"SDK init function schema mismatch — update SDK/CLI: %w\", err)\n}","preventionTips":["Keep custom SDK init function signatures matching the current interface spec","Upgrade engine and SDK runtimes together","Clear engine cache if schemas appear stale","Check inner error to identify the offending arg type"],"tags":["init","schema","argument-mapping","dagger"],"backgroundTag":"schema-introspection-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"}