{"record":{"id":"bfb0f71c07480df8","repo":"dagger/dagger","slug":"decode-persisted-container-withsecretvariable-lazy","errorCode":null,"errorMessage":"decode persisted container withSecretVariable lazy payload: %w","messagePattern":"decode persisted container withSecretVariable lazy payload: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/container.go","lineNumber":4579,"sourceCode":"\tcase \"withoutAnnotation\":\n\t\tvar persisted persistedContainerWithoutAnnotationLazy\n\t\tif err := json.Unmarshal(payload, &persisted); err != nil {\n\t\t\treturn fmt.Errorf(\"decode persisted container withoutAnnotation lazy payload: %w\", err)\n\t\t}\n\t\tparent, err := loadPersistedObjectResultByResultID[*Container](ctx, dag, persisted.ParentResultID, \"container withoutAnnotation parent\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontainer.Lazy = &ContainerWithoutAnnotationLazy{\n\t\t\tLazyState: NewLazyState(),\n\t\t\tParent:    parent,\n\t\t\tName:      persisted.Name,\n\t\t}\n\t\treturn nil\n\tcase \"withSecretVariable\":\n\t\tvar persisted persistedContainerWithSecretVariableLazy\n\t\tif err := json.Unmarshal(payload, &persisted); err != nil {\n\t\t\treturn fmt.Errorf(\"decode persisted container withSecretVariable lazy payload: %w\", err)\n\t\t}\n\t\tparent, err := loadPersistedObjectResultByResultID[*Container](ctx, dag, persisted.ParentResultID, \"container withSecretVariable parent\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsecret, err := loadPersistedObjectResultByResultID[*Secret](ctx, dag, persisted.SecretResultID, \"container withSecretVariable secret\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcontainer.Lazy = &ContainerWithSecretVariableLazy{\n\t\t\tLazyState: NewLazyState(),\n\t\t\tParent:    parent,\n\t\t\tName:      persisted.Name,\n\t\t\tSecret:    secret,\n\t\t}\n\t\treturn nil\n\tcase \"withoutSecretVariable\":\n\t\tvar persisted persistedContainerWithoutSecretVariableLazy","sourceCodeStart":4561,"sourceCodeEnd":4597,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/container.go#L4561-L4597","documentation":"This error wraps a json.Unmarshal failure decoding the persisted lazy payload for a Container's 'withSecretVariable' operation (from Container.WithSecretVariable). The payload must contain the parent result ID, secret name, and secret result ID; malformed JSON or wrong field types trigger it. It signals incompatible or corrupt persisted lazy state rather than a user API misuse.","triggerScenarios":"Hydrating a persisted Container built with WithSecretVariable where the stored JSON does not match persistedContainerWithSecretVariableLazy - e.g. SecretResultID or ParentResultID fields missing, wrong-typed, or payload truncated.","commonSituations":"Dagger engine upgraded between write and read of the persisted state; corrupted engine cache; a secret result reference record that was garbage-collected or written incorrectly.","solutions":["Prune or reset the Dagger engine cache so the pipeline re-executes and re-persists the lazy state","Pin the same Dagger version for writing and reading persisted state (schema may have changed between releases)","Verify engine storage integrity (disk errors, partial writes) and re-run the pipeline","If reproducible on current versions, report with the inner json.Unmarshal error"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"if err := runPipeline(ctx); err != nil {\n    if strings.Contains(err.Error(), \"decode persisted container withSecretVariable lazy payload\") {\n        // invalid persisted lazy payload: clear cache, re-run\n        exec.Command(\"dagger\", \"engine\", \"prune\").Run()\n        err = runPipeline(ctx)\n    }\n    return err\n}","preventionTips":["Upgrade CLI and engine together; never mix versions in one pipeline","Prune cache after Dagger upgrades before resuming persisted workflows","Watch for disk-full conditions that cause partial cache writes","Re-run the pipeline rather than reusing suspicious persisted state"],"tags":["dagger","json","persistence","secrets","deserialization"],"backgroundTag":"persisted-state-decode-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"}