dagger/dagger · error
inspect sdk %s args: %w
Error message
inspect sdk %s args: %w
What it means
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.
Source
Thrown at core/sdk/module_init.go:94
Field: fn.Name,
Args: callArgs,
}); err != nil {
return inst, fmt.Errorf("failed to call sdk module %s: %w", fn.Name, err)
}
return inst, nil
}
func (sdk *module) initFunctionCallArgs(
ctx context.Context,
dag *dagql.Server,
fn *core.Function,
workspace dagql.ObjectResult[*core.Workspace],
standardArgs map[string]any,
sdkArgs map[string]any,
) ([]dagql.NamedInput, error) {
fieldSpec, err := fn.FieldSpec(ctx, core.NewUserMod(sdk.mod))
if err != nil {
return nil, fmt.Errorf("inspect sdk %s args: %w", fn.Name, err)
}
inputs := fieldSpec.Args.Inputs(dag.View)
inputByName := make(map[string]dagql.InputSpec, len(inputs))
for _, input := range inputs {
inputByName[input.Name] = input
}
workspaceID, err := workspace.ID()
if err != nil {
return nil, fmt.Errorf("workspace id: %w", err)
}
usedSDKArgs := map[string]struct{}{}
named := make([]dagql.NamedInput, 0, len(inputs))
for _, argRes := range fn.Args {
arg := argRes.Self()
input, ok := inputByName[arg.Name]
if !ok {View on GitHub (pinned to 82ba2681db)
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
Example fix
// before: custom SDK with legacy initModule signature InitModule(name, path string) ... // after: match current interface (include workspace + args) InitModule(workspace Workspace, name string, path string, args map[string]any) ...
Defensive patterns
Strategy: try-catch
Validate before calling
// shell: confirm CLI/SDK compatibility before init dagger version # update engine/CLI so built-in SDK schemas match expectations # dagger update / upgrade engine as needed
Try / catch
// Go client
_, err := ws.InitModule(ctx, name, path, args)
if err != nil && strings.Contains(err.Error(), "inspect sdk ") {
return fmt.Errorf("SDK init function schema mismatch — update SDK/CLI: %w", err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- unknown type %q
- %T.getDecoder: failed to get schema: %w
- %T.getDecoder: incorrect type %T for scalar
- schema: %w
- load dependency schema: %w
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/b78d52bfd40649f0.
Report an issue: GitHub.