{"record":{"id":"35bb286547b05d77","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-read-metricname-size-w","errorCode":null,"errorMessage":"cannot read metricName size: %w","messagePattern":"cannot read metricName size: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/protoparser/native/stream/streamparser.go","lineNumber":68,"sourceCode":"\n\tctx := &streamContext{}\n\tfor {\n\t\tuw := getUnmarshalWork()\n\t\tuw.tr = tr\n\t\tuw.ctx = ctx\n\t\tuw.callback = callback\n\n\t\t// Read uw.metricNameBuf\n\t\tif _, err := io.ReadFull(br, sizeBuf); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\t// End of stream\n\t\t\t\tputUnmarshalWork(uw)\n\t\t\t\tctx.wg.Wait()\n\t\t\t\treturn ctx.err\n\t\t\t}\n\t\t\treadErrors.Inc()\n\t\t\tctx.wg.Wait()\n\t\t\treturn fmt.Errorf(\"cannot read metricName size: %w\", err)\n\t\t}\n\t\treadCalls.Inc()\n\t\tbufSize := encoding.UnmarshalUint32(sizeBuf)\n\t\tif bufSize > 1024*1024 {\n\t\t\tparseErrors.Inc()\n\t\t\tctx.wg.Wait()\n\t\t\treturn fmt.Errorf(\"too big metricName size; got %d; shouldn't exceed %d\", bufSize, 1024*1024)\n\t\t}\n\t\tuw.metricNameBuf = bytesutil.ResizeNoCopyMayOverallocate(uw.metricNameBuf, int(bufSize))\n\t\tif _, err := io.ReadFull(br, uw.metricNameBuf); err != nil {\n\t\t\treadErrors.Inc()\n\t\t\tctx.wg.Wait()\n\t\t\treturn fmt.Errorf(\"cannot read metricName with size %d bytes: %w\", bufSize, err)\n\t\t}\n\t\treadCalls.Inc()\n\n\t\t// Read uw.blockBuf\n\t\tif _, err := io.ReadFull(br, sizeBuf); err != nil {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/protoparser/native/stream/streamparser.go#L50-L86","documentation":"Reading the 4-byte metricName size prefix failed with a non-EOF error mid-stream: the native payload ended abruptly or the reader errored between blocks.","triggerScenarios":"Thrown at lib/protoparser/native/stream/streamparser.go:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-export and re-upload the native data — the stream is truncated","Check network stability and proxy timeouts during upload","Confirm nothing appended extra bytes to the export file"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}