{"record":{"id":"3572c0162e81661b","repo":"dagger/dagger","slug":"load-id-w","errorCode":null,"errorMessage":"load ID: %w","messagePattern":"load ID: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/object.go","lineNumber":129,"sourceCode":"\t\t}\n\t\treturn moduleObjectFieldsToSDKInput(ctx, t, parentCall, x.Self().Fields)\n\tcase *ModuleObject:\n\t\treturn moduleObjectFieldsToSDKInput(ctx, t, dagql.CurrentCall(ctx), x.Fields)\n\tcase dagql.IDable:\n\t\tdag, err := CurrentDagqlServer(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"current dagql server: %w\", err)\n\t\t}\n\t\tid, err := x.ID()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"load object ID: %w\", err)\n\t\t}\n\t\tif id == nil || id.EngineResultID() == 0 {\n\t\t\treturn nil, fmt.Errorf(\"load object ID: expected attached result ID\")\n\t\t}\n\t\tval, err := dag.Load(ctx, id)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"load ID: %w\", err)\n\t\t}\n\t\tswitch x := val.(type) {\n\t\tcase dagql.ObjectResult[*ModuleObject]:\n\t\t\tparentCall, err := x.ResultCall()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"loaded module object SDK input call frame: %w\", err)\n\t\t\t}\n\t\t\treturn moduleObjectFieldsToSDKInput(ctx, t, parentCall, x.Self().Fields)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unexpected value type %T\", x)\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%T.ConvertToSDKInput cannot handle %T\", t, x)\n\t}\n}\n\nfunc moduleObjectFieldsToSDKInput(ctx context.Context, t *ModuleObjectType, parentCall *dagql.ResultCall, fields map[string]any) (map[string]any, error) {\n\tif len(fields) == 0 {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/object.go#L111-L147","documentation":"Once a valid attached ID is available, ConvertToSDKInput calls dag.Load(ctx, id) on the current dagql server to materialize the object. This error wraps any failure from that load — typically a cache miss (the engine result backing the ID no longer exists), a malformed ID, or no current server context.","triggerScenarios":"Thrown at core/object.go:129 when the library encounters an invalid state.","commonSituations":"Engine restart or cache eviction between obtaining the object and converting it; passing an ID produced by a different engine/session; IDs crossing module boundaries where the result wasn't persisted.","solutions":["Convert the object to SDK input within the same engine session that produced it","Verify the ID is well-formed and belongs to the current engine's cache","Avoid storing IDs long-term; store the serialized SDK input (the JSON fields) instead","Check the wrapped dag.Load error to distinguish cache-miss vs malformed-ID"],"exampleFix":"// before\n// id saved to disk, engine restarted, dag.Load fails\nConvertToSDKInput(ctx, idableFromOldID)\n// after\n// re-execute the query to get a fresh, loadable ID\nval, err := dag.Load(ctx, freshID)\nConvertToSDKInput(ctx, val)","handlingStrategy":"try-catch","validationCode":"// verify the ID still loads before conversion\nif _, err := dag.Load(ctx, id); err != nil {\n    return fmt.Errorf(\"ID no longer loadable in this session: %w\", err)\n}","typeGuard":"func loadableIn(dagql *dagql.Server, ctx context.Context, id dagql.ID) bool {\n    _, err := dagql.Load(ctx, id)\n    return err == nil\n}","tryCatchPattern":"converted, err := objType.ConvertToSDKInput(ctx, val)\nif err != nil && strings.Contains(err.Error(), \"load ID:\") {\n    return fmt.Errorf(\"backing engine result is gone; re-run the query that produced this object: %w\", err)\n}","preventionTips":["Convert SDK inputs in the same session that produced the value","Persist serialized SDK input JSON rather than raw IDs for long-term storage","Watch for cache eviction when holding objects across long-running operations"],"tags":["dagql","cache-miss","id-load"],"backgroundTag":"cache-miss-on-load","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"}