VictoriaMetrics/VictoriaMetrics · error
value doesn't contain int64; it contains %s
Error message
value doesn't contain int64; it contains %s
What it means
`getInt64` found the key but the JSON value is not a number type, so it rejects it with a message naming the actual fastjson type. Integers must arrive as JSON numbers; strings like `"1700000000"` or floats used for integer fields are rejected.
Source
Thrown at lib/protoparser/zabbixconnector/parser.go:223
}
switch v.Type() {
case fastjson.TypeNumber:
return v.Float64()
default:
return 0, fmt.Errorf("value doesn't contain float64; it contains %s", v.Type())
}
}
func getInt64(o *fastjson.Value, k string) (int64, error) {
v := o.Get(k)
if v == nil {
return 0, fmt.Errorf("value is not exist")
}
switch v.Type() {
case fastjson.TypeNumber:
return v.Int64()
default:
return 0, fmt.Errorf("value doesn't contain int64; it contains %s", v.Type())
}
}
func getArray(o *fastjson.Value, k string) ([]*fastjson.Value, error) {
v := o.Get(k)
if v == nil {
return nil, fmt.Errorf("value is not exist")
}
switch v.Type() {
case fastjson.TypeArray:
return v.Array()
default:
return nil, fmt.Errorf("value doesn't contain array; it contains %s", v.Type())
}
}
// Tag represents metric tag
type Tag struct {View on GitHub (pinned to 5079fb58f1)
Solutions
- Send the field as an unquoted integer: `"clock": 1700000000`
- Fix string interpolation in the payload builder to keep numeric types
- For sources that genuinely emit strings, parse to int64 before JSON marshaling
Example fix
// before
{"clock": "1700000000"}
// after
{"clock": 1700000000} Defensive patterns
Strategy: type-guard
Validate before calling
if (!Number.isInteger(row.clock)) {
throw new Error("clock must be an integer, got: " + JSON.stringify(row.clock));
} Type guard
function isInt64(v) {
return typeof v === "number" && Number.isInteger(v) && Math.abs(v) <= Number.MAX_SAFE_INTEGER;
} Prevention
- Do not stringify timestamps or IDs
- Use BigInt/long-aware serializers if IDs exceed 2^53
- Keep integer fields as native numbers in the payload builder
When it happens
Trigger: `"clock": "1700000000"` (quoted timestamp); a float such as `1700000000.5` where the parser expects Int64 semantics; boolean or null in an int field.
Common situations: Shell/PHP senders quoting all values; JavaScript producers serializing timestamps via String(); data pipelines that round-trip numbers through strings.
Related errors
- value doesn't contain float64; it contains %s
- value doesn't contain array; it contains %s
- value doesn't contain float64; it contains %s
- missing `host` object
- missing `host` element in `host` object
AI-assisted analysis of VictoriaMetrics/VictoriaMetrics@5079fb58f1 (2026-09-03).
Data as JSON: /api/errors/4c058f80ac7c0809.
Report an issue: GitHub.