{"record":{"id":"25704cd29237f5f1","repo":"dagger/dagger","slug":"decode-persisted-file-chown-lazy-w","errorCode":null,"errorMessage":"decode persisted file chown lazy: %w","messagePattern":"decode persisted file chown lazy: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/file.go","lineNumber":486,"sourceCode":"\t\t\tSearch:      persisted.Search,\n\t\t\tReplacement: persisted.Replacement,\n\t\t\tFirstFrom:   persisted.FirstFrom,\n\t\t\tAll:         persisted.All,\n\t\t}, nil\n\tcase persistedFileLazyKindWithTimestamps:\n\t\tvar persisted persistedFileWithTimestampsLazy\n\t\tif err := json.Unmarshal(payload, &persisted); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"decode persisted file withTimestamps lazy: %w\", err)\n\t\t}\n\t\tparent, err := loadPersistedObjectResultByResultID[*File](ctx, dag, persisted.ParentResultID, \"file withTimestamps parent\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &FileWithTimestampsLazy{LazyState: NewLazyState(), Parent: parent, Timestamp: persisted.Timestamp}, nil\n\tcase persistedFileLazyKindChown:\n\t\tvar persisted persistedFileChownLazy\n\t\tif err := json.Unmarshal(payload, &persisted); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"decode persisted file chown lazy: %w\", err)\n\t\t}\n\t\tparent, err := loadPersistedObjectResultByResultID[*File](ctx, dag, persisted.ParentResultID, \"file chown parent\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &FileChownLazy{LazyState: NewLazyState(), Parent: parent, Owner: persisted.Owner}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"decode persisted file lazy payload: unsupported lazy kind %q\", lazyKind)\n\t}\n}\n\nfunc (lazy *FileBlobLazy) Evaluate(ctx context.Context, file *File) error {\n\treturn lazy.LazyState.Evaluate(ctx, \"File.blob\", func(ctx context.Context) error {\n\t\tif dir, _ := filepath.Split(lazy.Filename); dir != \"\" {\n\t\t\treturn fmt.Errorf(\"file name %q must not contain a directory\", lazy.Filename)\n\t\t}\n\t\tif err := ValidateFileName(lazy.Filename); err != nil {\n\t\t\treturn err","sourceCodeStart":468,"sourceCodeEnd":504,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/file.go#L468-L504","documentation":"Wraps a json.Unmarshal failure decoding a persisted 'chown' lazy payload (persistedFileChownLazy) into a FileChownLazy. The payload stores a parent File and the owner (chown) target; invalid or schema-drifted JSON blocks rehydration. Same persisted-lazy-state corruption/compatibility family as errors 660-663.","triggerScenarios":"Decoding a persistedFileLazyKindChown payload: malformed JSON, Owner field type mismatch (e.g. owner encoded as string vs structured object), or payload written by an incompatible engine version.","commonSituations":"Engine version skew; corrupted engine state; Owner serialization format changed between versions; shared CI cache carrying foreign payloads.","solutions":["Regenerate state by clearing the bad persisted entry and re-running","Match engine versions across all environments touching the state","Verify persistedFileChownLazy JSON tags match the encoder","Examine the wrapped error to identify the failing field"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"lazy, err := decodePersistedFileLazy(ctx, dag, payload, kind)\nif err != nil {\n    if strings.Contains(err.Error(), \"decode persisted file chown lazy\") {\n        return reapplyChown(ctx, dag)\n    }\n    return err\n}","preventionTips":["Keep Owner field serialization stable across versions","Avoid sharing persisted state between engine builds","Prune caches when upgrading","Log and alert on decode failures as corruption signals"],"tags":["json","deserialization","persistence","lazy-state"],"backgroundTag":"json-unmarshal-failed","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"}