{"record":{"id":"577c0605fed5dd8d","repo":"pulumi/pulumi","slug":"malformed-float-value-missing-or-non-string-valu","errorCode":null,"errorMessage":"malformed float value: missing or non-string 'value' field","messagePattern":"malformed float value: missing or non-string 'value' field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/stack/deployment.go","lineNumber":1180,"sourceCode":"\t\t\t\t\t}\n\t\t\t\t\treturn resource.MakeComponentResourceReference(urn, packageVersion), nil\n\t\t\t\tcase resource.ByteStringSig:\n\t\t\t\t\tencoded, ok := objmap[\"value\"].(string)\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn resource.PropertyValue{},\n\t\t\t\t\t\t\terrors.New(\"malformed byte string: missing or non-string 'value' field\")\n\t\t\t\t\t}\n\t\t\t\t\tdecoded, err := base64.StdEncoding.DecodeString(encoded)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn resource.PropertyValue{},\n\t\t\t\t\t\t\tfmt.Errorf(\"malformed byte string: unable to parse 'value' field: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t\treturn resource.NewProperty(string(decoded)), nil\n\t\t\t\tcase floatSignature:\n\t\t\t\t\thex, ok := objmap[\"value\"].(string)\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn resource.PropertyValue{},\n\t\t\t\t\t\t\terrors.New(\"malformed float value: missing or non-string 'value' field\")\n\t\t\t\t\t}\n\t\t\t\t\tbits, err := strconv.ParseUint(hex, 16, 64)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn resource.PropertyValue{},\n\t\t\t\t\t\t\tfmt.Errorf(\"malformed float value: unable to parse 'value' field: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t\tfloatVal := math.Float64frombits(bits)\n\t\t\t\t\treturn resource.NewProperty(floatVal), nil\n\t\t\t\tdefault:\n\t\t\t\t\treturn resource.PropertyValue{}, fmt.Errorf(\"unrecognized signature '%v' in property map\", sig)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise, it's just a weakly typed object map.\n\t\t\treturn resource.NewProperty(obj), nil\n\t\tcase *apitype.SecretV1:\n\t\t\treturn deserializeSecret(ctx, w, dec)\n\t\tdefault:","sourceCodeStart":1162,"sourceCodeEnd":1198,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/stack/deployment.go#L1162-L1198","documentation":"During deserialization of a serialized Pulumi property map, a value whose signature indicates a special float encoding was found, but its 'value' field is missing or not a JSON string. The float encoding stores IEEE-754 bits as a hex string in objmap[\"value\"], so a non-string or absent field makes the value unrecoverable.","triggerScenarios":"Calling stack deserialization (e.g. DeserializeUntypedDeployment / property map decoding in pkg/resource/stack/deployment.go) on a deployment JSON where a secret/weak-typed value has the float signature constant but objmap[\"value\"] is absent, null, a number, or another non-string type.","commonSituations":"Hand-edited or corrupted stack checkpoint files, deployments produced by a different/older Pulumi version with a different serialization format, or programmatically generated deployment JSON missing the 'value' key.","solutions":["Restore the stack state from a known-good backup (pulumi stack export earlier file or cloud backend history)","Inspect the raw deployment JSON and ensure each float-signature entry has a string 'value' field containing 16 hex chars of IEEE-754 bits","Regenerate the deployment by re-running the program and re-exporting the stack rather than editing JSON by hand","Check CLI version parity between the tool that serialized and the one deserializing"],"exampleFix":"// before (malformed)\n{\"4d2f9c3a\": {\"sig\": 404, \"value\": 3.14}}\n// after (expected: hex of float bits)\n{\"4d2f9c3a\": {\"sig\": 404, \"value\": \"40091eb851eb851f\"}}","handlingStrategy":"validation","validationCode":"for k, v := range objmap {\n    if _, isStr := v[\"value\"].(string); !isStr {\n        return fmt.Errorf(\"entry %q: float 'value' must be a hex string\", k)\n    }\n}","typeGuard":"func isHexString(s string) bool {\n    if len(s) != 16 { return false }\n    _, err := strconv.ParseUint(s, 16, 64)\n    return err == nil\n}","tryCatchPattern":null,"preventionTips":["Never hand-edit exported stack JSON; use pulumi stack export/import round-trips only","Keep CLI versions consistent between machines that write and read deployments","Validate exported deployment files against the apitype schema before modifying"],"tags":["serialization","deployment","go"],"backgroundTag":"malformed-serialized-property-value","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}