{"record":{"id":"a5e1511b5472dc15","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-unmarshal-point-w","errorCode":null,"errorMessage":"cannot unmarshal point: %w","messagePattern":"cannot unmarshal point: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/protoparser/datadogv2/parser.go","lineNumber":189,"sourceCode":"\t\tcase 2:\n\t\t\tmetric, ok := fc.String()\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"cannot unmarshal metric\")\n\t\t\t}\n\t\t\ts.Metric = metric\n\t\tcase 4:\n\t\t\tdata, ok := fc.MessageData()\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"cannot read point data\")\n\t\t\t}\n\t\t\tif len(points) < cap(points) {\n\t\t\t\tpoints = points[:len(points)+1]\n\t\t\t} else {\n\t\t\t\tpoints = append(points, Point{})\n\t\t\t}\n\t\t\tpt := &points[len(points)-1]\n\t\t\tif err := pt.unmarshalProtobuf(data); err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot unmarshal point: %w\", err)\n\t\t\t}\n\t\tcase 1:\n\t\t\tdata, ok := fc.MessageData()\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"cannot read resource data\")\n\t\t\t}\n\t\t\tif len(resources) < cap(resources) {\n\t\t\t\tresources = resources[:len(resources)+1]\n\t\t\t} else {\n\t\t\t\tresources = append(resources, Resource{})\n\t\t\t}\n\t\t\tr := &resources[len(resources)-1]\n\t\t\tif err := r.unmarshalProtobuf(data); err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot unmarshal resource: %w\", err)\n\t\t\t}\n\t\tcase 7:\n\t\t\tsourceTypeName, ok := fc.String()\n\t\t\tif !ok {","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/protoparser/datadogv2/parser.go#L171-L207","documentation":"This error is returned by Series.unmarshalProtobuf (lib/protoparser/datadogv2/parser.go:189) while decoding a DataDog /api/v2/series protobuf request. A `points` submessage (field 4, MetricSeries.points) was present, its length-delimited payload was extracted, but Point.unmarshalProtobuf failed to decode it; the underlying error is wrapped with %w. It means the bytes of that point do not form a valid Point message (double value = 1, int64 timestamp = 2).","triggerScenarios":"Calling UnmarshalProtobuf on a request body whose series field 4 payload is truncated, corrupt, or uses wire types incompatible with easyproto's decoding of a double/int64 Point message (e.g. a varint length that exceeds the remaining bytes, or a nested field with an invalid tag).","commonSituations":"A DataDog agent or SDK sending a malformed or truncated v2 payload; an HTTP client sending the wrong Content-Type so a protobuf body is delivered as garbage bytes; payload corruption in transit; sender built against an incompatible version of the agent-payload metrics proto.","solutions":["Dump and validate the offending request body against the DataDog agent_payload.proto schema to confirm the Point submessage is well-formed.","Verify the sender posts the body as application/x-protobuf to /api/v2/series (not JSON) so the bytes match the expected schema.","Update the sending agent/SDK and VictoriaMetrics to versions built from compatible DataDog agent-payload protos.","If you own the client, regenerate/re-encode the payload with a real protobuf library and retry; discard the malformed record and let the agent re-send."],"exampleFix":"// before: posting JSON bytes to the protobuf endpoint\nhttp.Post(url+\"/api/v2/series\", \"application/json\", body)\n// after: serialize the v2 series payload with the DataDog proto and the right content type\ndata, _ := proto.Marshal(&pb.MetricPayload{Series: series})\nhttp.Post(url+\"/api/v2/series\", \"application/x-protobuf\", bytes.NewReader(data))","handlingStrategy":"validation","validationCode":"// Validate the payload before calling UnmarshalProtobuf\nfunc looksLikeProtobuf(b []byte) bool {\n\tif len(b) == 0 || b[0]>>3 != 1 { // first field tag should be field 1 (series)\n\t\treturn false\n\t}\n\treturn b[0]&0x7 == 2 // wire type 2 (length-delimited)\n}","typeGuard":null,"tryCatchPattern":"if err := datadogv2.UnmarshalProtobuf(&req, body); err != nil {\n\tvar wrapErr *fmt.wrapError\n\terrors.As(err, &wrapErr)\n\tlog.Printf(\"bad dd-series protobuf payload (%d bytes): %v\", len(body), err)\n\thttp.Error(w, \"bad request\", http.StatusBadRequest)\n\treturn\n}","preventionTips":["Always serialize v2 series payloads with generated protobuf code from the official agent-payload schema.","Post with Content-Type application/x-protobuf to /api/v2/series; never mix JSON and protobuf paths.","Validate payloads with protoc --decode in CI for any custom sender.","Monitor 400 responses from VictoriaMetrics to catch sender regressions early."],"tags":["protobuf","datadog","unmarshal","metrics-ingestion"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}