{"record":{"id":"d6110c8b8687fd36","repo":"juicedata/juicefs","slug":"remote-write-failed-s","errorCode":null,"errorMessage":"remote_write failed: %s","messagePattern":"remote_write failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/java/libjfs/remote_write.go","lineNumber":191,"sourceCode":"\treq.Header.Set(\"Content-Encoding\", \"snappy\")\n\treq.Header.Set(\"Content-Type\", \"application/x-protobuf\")\n\treq.Header.Set(\"X-Prometheus-Remote-Write-Version\", \"0.1.0\")\n\n\tif rw.auth != \"\" {\n\t\tif strings.Contains(rw.auth, \":\") {\n\t\t\tparts := strings.Split(rw.auth, \":\")\n\t\t\treq.SetBasicAuth(parts[0], parts[1])\n\t\t}\n\t}\n\n\tresp, err := rw.client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"send request: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode/100 != 2 {\n\t\treturn fmt.Errorf(\"remote_write failed: %s\", resp.Status)\n\t}\n\n\treturn nil\n}\n\n// ConvertMetricsToTimeSeries converts Prometheus metric families to TimeSeries.\nfunc (rw *RemoteWriter) ConvertMetricsToTimeSeries(mfs []*dto.MetricFamily) ([]prompb.TimeSeries, error) {\n\tnow := model.Time(time.Now().UnixMilli())\n\tsamples, err := expfmt.ExtractSamples(&expfmt.DecodeOptions{\n\t\tTimestamp: now,\n\t}, mfs...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"extract samples: %w\", err)\n\t}\n\n\tvar tsList []prompb.TimeSeries\n\tfor _, sample := range samples {\n\t\t// Convert model.Metric to prompb.Label slice","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/libjfs/remote_write.go#L173-L209","documentation":"Returned by RemoteWriter.Push when the remote write endpoint answers with a non-2xx HTTP status. The push was delivered but rejected (auth failure, bad payload, or server-side ingestion error) and the response status identifies which.","triggerScenarios":"Thrown at sdk/java/libjfs/remote_write.go:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check pushgateway/remote-write credentials if 401/403","Inspect the server response code for payload issues (400) or server health (5xx)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}