pulumi/pulumi · error

malformed float value: missing or non-string 'value' field

Error message

malformed float value: missing or non-string 'value' field

What it means

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.

Source

Thrown at pkg/resource/stack/deployment.go:1180

					}
					return resource.MakeComponentResourceReference(urn, packageVersion), nil
				case resource.ByteStringSig:
					encoded, ok := objmap["value"].(string)
					if !ok {
						return resource.PropertyValue{},
							errors.New("malformed byte string: missing or non-string 'value' field")
					}
					decoded, err := base64.StdEncoding.DecodeString(encoded)
					if err != nil {
						return resource.PropertyValue{},
							fmt.Errorf("malformed byte string: unable to parse 'value' field: %w", err)
					}
					return resource.NewProperty(string(decoded)), nil
				case floatSignature:
					hex, ok := objmap["value"].(string)
					if !ok {
						return resource.PropertyValue{},
							errors.New("malformed float value: missing or non-string 'value' field")
					}
					bits, err := strconv.ParseUint(hex, 16, 64)
					if err != nil {
						return resource.PropertyValue{},
							fmt.Errorf("malformed float value: unable to parse 'value' field: %w", err)
					}
					floatVal := math.Float64frombits(bits)
					return resource.NewProperty(floatVal), nil
				default:
					return resource.PropertyValue{}, fmt.Errorf("unrecognized signature '%v' in property map", sig)
				}
			}

			// Otherwise, it's just a weakly typed object map.
			return resource.NewProperty(obj), nil
		case *apitype.SecretV1:
			return deserializeSecret(ctx, w, dec)
		default:

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Restore the stack state from a known-good backup (pulumi stack export earlier file or cloud backend history)
  2. Inspect the raw deployment JSON and ensure each float-signature entry has a string 'value' field containing 16 hex chars of IEEE-754 bits
  3. Regenerate the deployment by re-running the program and re-exporting the stack rather than editing JSON by hand
  4. Check CLI version parity between the tool that serialized and the one deserializing

Example fix

// before (malformed)
{"4d2f9c3a": {"sig": 404, "value": 3.14}}
// after (expected: hex of float bits)
{"4d2f9c3a": {"sig": 404, "value": "40091eb851eb851f"}}
Defensive patterns

Strategy: validation

Validate before calling

for k, v := range objmap {
    if _, isStr := v["value"].(string); !isStr {
        return fmt.Errorf("entry %q: float 'value' must be a hex string", k)
    }
}

Type guard

func isHexString(s string) bool {
    if len(s) != 16 { return false }
    _, err := strconv.ParseUint(s, 16, 64)
    return err == nil
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/577c0605fed5dd8d. Report an issue: GitHub.