{"record":{"id":"47d336a5fb3d85c6","repo":"juicedata/juicefs","slug":"marshal-protobuf-w","errorCode":null,"errorMessage":"marshal protobuf: %w","messagePattern":"marshal protobuf: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/java/libjfs/remote_write.go","lineNumber":164,"sourceCode":"\t\t\treturn err\n\t\t}\n\t}\n\n\t// Convert metrics to TimeSeries\n\ttsList, err := rw.ConvertMetricsToTimeSeries(mfs)\n\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}","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/sdk/java/libjfs/remote_write.go#L146-L182","documentation":"Returned by RemoteWriter.Push when protobuf marshalling of the assembled WriteRequest fails. This indicates structurally invalid data in the time series (e.g. invalid label names), not a network problem.","triggerScenarios":"Thrown at sdk/java/libjfs/remote_write.go:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate metric/label naming before pushing to the remote write endpoint"],"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"}