{"record":{"id":"4c058f80ac7c0809","repo":"VictoriaMetrics/VictoriaMetrics","slug":"value-doesn-t-contain-int64-it-contains-s","errorCode":null,"errorMessage":"value doesn't contain int64; it contains %s","messagePattern":"value doesn't contain int64; it contains (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/protoparser/zabbixconnector/parser.go","lineNumber":223,"sourceCode":"\t}\n\tswitch v.Type() {\n\tcase fastjson.TypeNumber:\n\t\treturn v.Float64()\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"value doesn't contain float64; it contains %s\", v.Type())\n\t}\n}\n\nfunc getInt64(o *fastjson.Value, k string) (int64, error) {\n\tv := o.Get(k)\n\tif v == nil {\n\t\treturn 0, fmt.Errorf(\"value is not exist\")\n\t}\n\tswitch v.Type() {\n\tcase fastjson.TypeNumber:\n\t\treturn v.Int64()\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"value doesn't contain int64; it contains %s\", v.Type())\n\t}\n}\n\nfunc getArray(o *fastjson.Value, k string) ([]*fastjson.Value, error) {\n\tv := o.Get(k)\n\tif v == nil {\n\t\treturn nil, fmt.Errorf(\"value is not exist\")\n\t}\n\tswitch v.Type() {\n\tcase fastjson.TypeArray:\n\t\treturn v.Array()\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"value doesn't contain array; it contains %s\", v.Type())\n\t}\n}\n\n// Tag represents metric tag\ntype Tag struct {","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/protoparser/zabbixconnector/parser.go#L205-L241","documentation":"`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.","triggerScenarios":"`\"clock\": \"1700000000\"` (quoted timestamp); a float such as `1700000000.5` where the parser expects Int64 semantics; boolean or null in an int field.","commonSituations":"Shell/PHP senders quoting all values; JavaScript producers serializing timestamps via String(); data pipelines that round-trip numbers through strings.","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"],"exampleFix":"// before\n{\"clock\": \"1700000000\"}\n// after\n{\"clock\": 1700000000}","handlingStrategy":"type-guard","validationCode":"if (!Number.isInteger(row.clock)) {\n  throw new Error(\"clock must be an integer, got: \" + JSON.stringify(row.clock));\n}","typeGuard":"function isInt64(v) {\n  return typeof v === \"number\" && Number.isInteger(v) && Math.abs(v) <= Number.MAX_SAFE_INTEGER;\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["json","type-error","zabbix"],"backgroundTag":"json-type-mismatch","analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}