{"record":{"id":"6515912603ab9d1d","repo":"thanos-io/thanos","slug":"unsupported-remote-write-version","errorCode":null,"errorMessage":"unsupported remote_write version","messagePattern":"unsupported remote_write version","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/receive/handler.go","lineNumber":864,"sourceCode":"\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) {\n\ttLogger := h.logger\n\n\t// This replica value is used to detect cycles in cyclic topologies.\n\t// A non-zero value indicates that the request has already been replicated by a previous receive instance.\n\t// For almost all users, this is only used in fully connected topologies of IngestorRouter instances.\n\t// For acyclic topologies that use RouterOnly and IngestorOnly instances, this causes issues when replicating data.\n\t// See discussion in: https://github.com/thanos-io/thanos/issues/4359.","sourceCodeStart":846,"sourceCodeEnd":882,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/receive/handler.go#L846-L882","documentation":"The rwVersion switch in the remote-write HTTP handler hit its default case: determineRWVersion returned an unrecognized version, so the request cannot be dispatched to v1 or v2 handling and is answered 400.","triggerScenarios":"Thrown at pkg/receive/handler.go:864 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send a supported remote-write protocol version (1 or 2).","Update the client SDK; check X-Prometheus-Remote-Write-Version and Content-Type consistency."],"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"}