{"record":{"id":"a3072c9fc7c9b26f","repo":"dagger/dagger","slug":"decode-persisted-cache-volume-payload-w","errorCode":null,"errorMessage":"decode persisted cache volume payload: %w","messagePattern":"decode persisted cache volume payload: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/cache.go","lineNumber":401,"sourceCode":"\t\tSelector  string           `json:\"selector,omitempty\"`\n\t}{\n\t\tKey:       cache.Key,\n\t\tNamespace: cache.Namespace,\n\t\tSourceID:  sourceID,\n\t\tSharing:   cache.Sharing,\n\t\tOwner:     cache.Owner,\n\t\tSelector:  selector,\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"marshal cache volume lock key: %w\", err)\n\t}\n\treturn \"cache-volume:\" + string(payload), nil\n}\n\nfunc (*CacheVolume) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error) {\n\tvar persisted persistedCacheVolumePayload\n\tif err := json.Unmarshal(payload, &persisted); err != nil {\n\t\treturn nil, fmt.Errorf(\"decode persisted cache volume payload: %w\", err)\n\t}\n\n\tsource := dagql.Nullable[dagql.ObjectResult[*Directory]]{}\n\tif persisted.SourceResultID != 0 {\n\t\tsourceRes, err := loadPersistedObjectResultByResultID[*Directory](ctx, dag, persisted.SourceResultID, \"cache volume source\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif sourceRes.Self() != nil {\n\t\t\tsource = dagql.NonNull(sourceRes)\n\t\t}\n\t}\n\n\tcache := NewCache(\n\t\tpersisted.Key,\n\t\tpersisted.Namespace,\n\t\tsource,\n\t\tpersisted.Sharing,","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/cache.go#L383-L419","documentation":"Wrap from CacheVolume.DecodePersistedObject when the persisted payload JSON cannot be unmarshalled into persistedCacheVolumePayload. Means the cache volume ID's embedded payload is corrupt or was written by an incompatible Dagger version.","triggerScenarios":"Thrown at core/cache.go:401 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a fresh CacheVolume instead of reusing the old ID","Check for engine version mismatch when reusing cached IDs","Inspect the payload in the ID for corruption"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}