{"record":{"id":"34154337643f8db4","repo":"dagger/dagger","slug":"select-s-returned-unresolved-object-result-q-sh","errorCode":null,"errorMessage":"select %s returned unresolved object result %q (shared result %d: hasValue=%t, persistedEnvelope=%t)","messagePattern":"select (.+?) returned unresolved object result %q \\(shared result (.+?): hasValue=%t, persistedEnvelope=%t\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dagql/server.go","lineNumber":1975,"sourceCode":"\t\t\t\tstate := shared.loadPayloadState()\n\t\t\t\tif state.isObject {\n\t\t\t\t\ttypeName := sharedResultObjectTypeName(shared, state)\n\t\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\t\"select %s returned unresolved object-typed result %q (shared result %d: hasValue=%t, persistedEnvelope=%t)\",\n\t\t\t\t\t\tsel.Field,\n\t\t\t\t\t\ttypeName,\n\t\t\t\t\t\tshared.id,\n\t\t\t\t\t\tstate.hasValue,\n\t\t\t\t\t\tstate.persistedEnvelope != nil,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif _, ok := res.(AnyObjectResult); ok {\n\t\t\t\ttypeName := \"\"\n\t\t\t\tif shared := res.cacheSharedResult(); shared != nil {\n\t\t\t\t\tpayload := shared.loadPayloadState()\n\t\t\t\t\ttypeName = sharedResultObjectTypeName(shared, payload)\n\t\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\t\"select %s returned unresolved object result %q (shared result %d: hasValue=%t, persistedEnvelope=%t)\",\n\t\t\t\t\t\tsel.Field,\n\t\t\t\t\t\ttypeName,\n\t\t\t\t\t\tshared.id,\n\t\t\t\t\t\tpayload.hasValue,\n\t\t\t\t\t\tpayload.persistedEnvelope != nil,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"select %s returned unresolved object result %q\", sel.Field, typeName)\n\t\t\t}\n\t\t\t// null scalar result; nothing to do\n\t\t\treturn nil\n\t\t}\n\n\t\tif nth != 0 {\n\t\t\tres, err = s.loadNthValue(ctx, res, nth, true)\n\t\t\tif err != nil {\n\t\t\t\treturn err","sourceCodeStart":1957,"sourceCodeEnd":1993,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/dagql/server.go#L1957-L1993","documentation":"dagql's Select walked a selection chain and got a field result whose Unwrap() is nil, yet the result is an object-typed result backed by a cache SharedResult whose payload never resolved (hasValue=false or no persisted envelope). The server reports the type name, shared-result cache ID, and payload state to help diagnose why the cached object result never received its value.","triggerScenarios":"Calling Server.Select with a selector whose field resolves to an ObjectResult that was cached/shared but never hydrated - e.g. the underlying call failed silently, the shared result's payload was never populated (hasValue=false), or a persisted envelope is missing (persistedEnvelope=false) when loading from the cache.","commonSituations":"Cross-session ID loading where a cached shared result exists but its persisted payload was evicted or never written; race or cancellation that aborted payload hydration; engine restart with a stale/incompatible cache referencing shared result IDs.","solutions":["Inspect the reported hasValue/persistedEnvelope flags: if both false, the shared result was never hydrated - re-issue the originating call instead of loading from a stale ID","Check that the ID being selected through was produced by the same engine instance/cache generation; regenerate the ID","Verify the field resolver always returns a non-nil value even on partial failure, rather than caching an empty result","If reproducible after an engine restart, clear or version the dagql cache so orphaned shared results are invalidated"],"exampleFix":"// before: selecting through a stale cached ID\nvar dir dagql.ObjectResult[*core.Directory]\nsrv.Select(ctx, root, &dir, dagql.Selector{Field: \"directory\", Args: ...})\n// after: re-create the object in-session so a fresh hydrated result exists\ndirObj, err := client.Directory().WithNewFile(\"a.txt\", \"hi\")\n_, err = srv.Select(ctx, root, &dir, dagql.Selector{Field: \"loadDirectoryFromID\", Args: dagql.NewInput(\"id\", dirObj.ID())})","handlingStrategy":"validation","validationCode":"// verify shared result state before selecting through a cached ID\nfunc canSelectFromID(ctx context.Context, srv *dagql.Server, id string) bool {\n    var probe dagql.ObjectResult[*core.Directory]\n    err := srv.Select(ctx, dagql.NewRoot[*core.Query](), &probe, dagql.Selector{Field: \"loadID\", Args: dagql.NewInput(\"id\", id)})\n    return err == nil && probe.Unwrap() != nil\n}","typeGuard":"func isHydrated(res dagql.AnyResult) bool {\n    return res != nil && res.Unwrap() != nil\n}","tryCatchPattern":null,"preventionTips":["Never persist dagql IDs across engine restarts or cache generations","Check hasValue on cache state when loading from stored IDs","Re-issue originating calls instead of replaying old shared results"],"tags":["dagql","cache","hydration","graphql"],"backgroundTag":"unresolved-cached-object-result","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"}