{"record":{"id":"eadde7d498cf64ff","repo":"juicedata/juicefs","slug":"create-request-w","errorCode":null,"errorMessage":"create request: %w","messagePattern":"create request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/java/libjfs/remote_write.go","lineNumber":170,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"convert metrics: %w\", err)\n\t}\n\n\tif len(tsList) == 0 {\n\t\treturn nil // No samples to push\n\t}\n\n\t// Send to remote write endpoint\n\twr := &prompb.WriteRequest{Timeseries: tsList}\n\tdata, err := wr.Marshal()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshal protobuf: %w\", err)\n\t}\n\n\tcompressed := snappy.Encode(nil, data)\n\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()","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/libjfs/remote_write.go#L152-L188","documentation":"http.NewRequest failed to build the POST request for the Prometheus remote-write endpoint after the snappy-compressed protobuf payload was prepared. Fires when the configured remote-write URL is malformed (bad scheme, host, or control characters), preventing metrics push.","triggerScenarios":"Thrown at sdk/java/libjfs/remote_write.go:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the configured remote write URL so it is a valid absolute http(s) URL"],"exampleFix":null,"handlingStrategy":"try-catch","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"}