{"record":{"id":"699a1f50c5c4618c","repo":"thanos-io/thanos","slug":"proto-cannot-parse-invalid-wire-format-data","errorCode":null,"errorMessage":"proto: cannot parse invalid wire-format data","messagePattern":"proto: cannot parse invalid wire-format data","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/receive/handler.go","lineNumber":857,"sourceCode":"\tif !requestLimiter.AllowSizeBytes(tenantHTTP, int64(len(reqBuf))) {\n\t\thttp.Error(w, \"write request too large\", http.StatusRequestEntityTooLarge)\n\t\treturn\n\t}\n\n\trwVersion, err := determineRWVersion(r)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tswitch rwVersion {\n\tcase 1:\n\t\t// NOTE: Due to zero copy ZLabels, Labels used from WriteRequests keeps memory\n\t\t// from the whole request. Ensure that we always copy those when we want to\n\t\t// store them for longer time.\n\t\tvar wreq prompb.WriteRequest\n\t\tif err := proto.Unmarshal(reqBuf, &wreq); err != nil {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\t_ = h.handleV1HTTP(ctx, w, r, &wreq, tLogger, tenantHTTP, requestLimiter)\n\tcase 2:\n\t\th.handleV2HTTP(ctx, w, r, reqBuf, tLogger, tenantHTTP, requestLimiter)\n\tdefault:\n\t\tpanic(\"unsupported remote_write version\")\n\t}\n}\n\ntype requestStats struct {\n\ttimeseries   int\n\ttotalSamples int\n}\n\ntype tenantRequestStats map[string]requestStats\n\nfunc (h *Handler) handleRequest(ctx context.Context, rep uint64, data []wreqTenantTuple) (tenantRequestStats, error) {","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/receive/handler.go#L839-L875","documentation":"proto.Unmarshal of the v1 WriteRequest failed — the decompressed body is not valid protobuf wire format (wrong content type, corruption, or a non-snappy payload sent to the endpoint); the handler responds 400.","triggerScenarios":"Thrown at pkg/receive/handler.go:857 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the sender targets the correct endpoint and encoding.","Check that compression/proxy layers do not alter the body.","Client bug: fix serialization, do not retry as-is."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}