{"record":{"id":"bf051dd95f0f55e0","repo":"juicedata/juicefs","slug":"send-request-w","errorCode":null,"errorMessage":"send request: %w","messagePattern":"send request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/java/libjfs/remote_write.go","lineNumber":186,"sourceCode":"\treq, err := http.NewRequest(\"POST\", rw.url, bytes.NewReader(compressed))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create request: %w\", err)\n\t}\n\n\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)","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/libjfs/remote_write.go#L168-L204","documentation":"Returned by RemoteWriter.Push when the HTTP POST to the Prometheus remote write endpoint fails at the transport level — connection refused, timeout, or DNS failure. The endpoint is unreachable, not merely erroring.","triggerScenarios":"Thrown at sdk/java/libjfs/remote_write.go:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the remote write URL is reachable from the client","Check network/proxy settings and retry; transient network failures are expected"],"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"}