{"record":{"id":"688cb2f3c5ae61e2","repo":"dagger/dagger","slug":"q-get-value-w","errorCode":null,"errorMessage":"%q: get value: %w","messagePattern":"%q: get value: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/modtree.go","lineNumber":662,"sourceCode":"\t// lists\n\t// FIXME: as an optimization, one-shot when possible?\n\tsrv := node.DagqlServer\n\t// 1. Are we the root? Select the module's main object from Query root.\n\t// A node is also treated as root if its parent is a synthetic naming-only\n\t// node (e.g. injected by workspace checks reparenting, which sets\n\t// Parent to an empty ModTreeNode with nil Module).\n\tif node.Parent == nil || node.Parent.Module.Self() == nil {\n\t\tmod := node.Module.Self()\n\t\tif mod == nil {\n\t\t\treturn fmt.Errorf(\"%q: get value: missing module\", node.PathString())\n\t\t}\n\t\tvar ctor *Function\n\t\tif objType := node.ObjectType(); objType != nil && objType.Constructor.Valid {\n\t\t\tctor = objType.Constructor.Value.Self()\n\t\t}\n\t\targs, err := boundWorkspaceArgs(ctx, srv, ctor)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"%q: get value: %w\", node.PathString(), err)\n\t\t}\n\t\treturn srv.Select(ctx, srv.Root(), dest, dagql.Selector{\n\t\t\tField: gqlFieldName(mod.Name()),\n\t\t\tArgs:  append(args, leafArgs...),\n\t\t})\n\t}\n\t// 2. Is parent an object?\n\tif parentObjType := node.Parent.ObjectType(); parentObjType != nil {\n\t\tvar parentObjValue dagql.AnyObjectResult\n\t\tif err := node.Parent.DagqlValue(ctx, &parentObjValue); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfn, _ := parentObjType.FunctionByName(node.Name)\n\t\targs, err := boundWorkspaceArgs(ctx, srv, fn)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"%q: get value: %w\", node.PathString(), err)\n\t\t}\n\t\treturn srv.Select(dagql.WithNonInternalTelemetry(ctx), parentObjValue, dest, dagql.Selector{","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/modtree.go#L644-L680","documentation":"dagqlValue (core/modtree.go:662) wraps a failure from boundWorkspaceArgs when selecting a root node's main object. boundWorkspaceArgs (core/modtree.go:739) resolves the required Workspace argument for the object's constructor; if the workspace value cannot be resolved (workspaceArgValue fails), the selection cannot proceed and this error prefixes the node path to the cause.","triggerScenarios":"Calling DagqlValue or RunAgent on a root ModTreeNode whose object type declares a non-optional Workspace argument, and the workspace value cannot be resolved from the context (no BoundWorkspace threaded) nor the session's ambient workspace.","commonSituations":"Evaluating a generator/workspace object outside a group where no workspace was bound into the context and no ambient session workspace exists; running a check or agent whose constructor requires a Workspace but the enclosing query lost it.","solutions":["Ensure a workspace is bound into the context (or a session ambient workspace exists) before evaluating the node","Make the Workspace argument optional in the object's constructor if it doesn't need to be required","Fix the wrapped error from workspaceArgValue reported after the node path in the message"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure a workspace is resolvable before evaluating a workspace-requiring root object\nif ws == nil {\n    ctx = core.WithBoundWorkspace(ctx, ws) // bind the enclosing workspace\n}","typeGuard":null,"tryCatchPattern":"if err := node.DagqlValue(ctx, &dest); err != nil {\n    if strings.Contains(err.Error(), \"get value:\") {\n        return fmt.Errorf(\"root %q needs a workspace in context: %w\", node.PathString(), err)\n    }\n    return err\n}","preventionTips":["Thread the workspace into the context in group composition before evaluating nodes","Declare Workspace args optional unless strictly required","Test generators outside group context to catch the no-ambient-workspace path"],"tags":["dagql","workspace-args","dagger"],"backgroundTag":"missing-workspace-argument","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"}