{"record":{"id":"e9aa1dcb704d0fc3","repo":"dagger/dagger","slug":"get-fn-parent-w","errorCode":null,"errorMessage":"get fn parent: %w","messagePattern":"get fn parent: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/codegen/generator/go/templates/modules.go","lineNumber":269,"sourceCode":"\tdefer func() {\n\t\tif rerr != nil {\n\t\t\tif ` + voidRet + ` := fnCall.ReturnError(ctx, convertError(rerr)); err != nil {\n\t\t\t\tfmt.Println(\"failed to return error:\", err, \"\\noriginal error:\", rerr)\n\t\t\t}\n\t\t}\n\t}()\n\n\tparentName, err := fnCall.ParentName(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get parent name: %w\", err)\n\t}\n\tfnName, err := fnCall.Name(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get fn name: %w\", err)\n\t}\n\tparentJson, err := fnCall.Parent(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get fn parent: %w\", err)\n\t}\n\tfnArgs, err := fnCall.InputArgs(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get fn args: %w\", err)\n\t}\n\n\tinputArgs := map[string][]byte{}\n\tfor _, fnArg := range fnArgs {\n\t\targName, err := fnArg.Name(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"get fn arg name: %w\", err)\n\t\t}\n\t\targValue, err := fnArg.Value(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"get fn arg value: %w\", err)\n\t\t}\n\t\tinputArgs[argName] = []byte(argValue)\n\t}","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/cmd/codegen/generator/go/templates/modules.go#L251-L287","documentation":"Generated-module runtime error: dispatch() failed to fetch the serialized parent object (JSON) via fnCall.Parent(ctx). The parent JSON is required to deserialize the receiver the user's method is called on; if the engine query errors, dispatch wraps it as 'get fn parent' and returns it to the engine.","triggerScenarios":"Function call where the engine cannot provide the parent object JSON — parent failed to serialize in the engine, session/connection dropped between ParentName/Name and Parent queries, or SDK/engine schema mismatch.","commonSituations":"Chained calls where the parent object's ID became invalid; engine restart mid-pipeline; calling a function on an object produced by a different module version; CLI/SDK skew after upgrade.","solutions":["Re-run the pipeline with a current, matched dagger CLI and freshly regenerated (`dagger develop`) module","Ensure the parent object is still valid (re-create it in the same session rather than reusing stale IDs)","Check engine logs for the underlying GraphQL error behind the %w wrap","Restart the engine if the session state was corrupted"],"exampleFix":"// before\n$ dagger call old-step --reuse-parent  # stale parent ID from previous engine\n\n// after\n$ dagger call build && dagger call serve  # fresh objects in one session","handlingStrategy":"fallback","validationCode":"// avoid stale parent objects: recreate chains in a single session\n// parent, err := dag.Container().From(\"alpine\").ID(ctx) // fresh ID before each call","typeGuard":null,"tryCatchPattern":"res, err := step.Serve(ctx)\nif err != nil && strings.Contains(err.Error(), \"get fn parent\") {\n\t// rebuild parent object and retry once\n\treturn rebuildParentAndRetry(ctx)\n}","preventionTips":["Do not reuse object IDs across engine restarts or CLI upgrades","Keep multi-step pipelines in one dagger session","Match CLI/SDK versions and regenerate with `dagger develop`"],"tags":["dagger","runtime","engine","go-sdk"],"backgroundTag":"engine-parent-object-unavailable","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"}