{"record":{"id":"3f6c4f63411bf782","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-write-topheapentry-name-w","errorCode":null,"errorMessage":"cannot write topHeapEntry name: %w","messagePattern":"cannot write topHeapEntry name: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/vmselectapi/server.go","lineNumber":963,"sourceCode":"\tif err := writeTopHeapEntries(ctx, status.SeriesCountByLabelValuePair); err != nil {\n\t\treturn fmt.Errorf(\"cannot write seriesCountByLabelValuePair to vmselect: %w\", err)\n\t}\n\tif err := writeTopHeapEntries(ctx, status.LabelValueCountByLabelName); err != nil {\n\t\treturn fmt.Errorf(\"cannot write labelValueCountByLabelName to vmselect: %w\", err)\n\t}\n\tif err := writeMetricNameStatRecords(ctx, status.SeriesQueryStatsByMetricName); err != nil {\n\t\treturn fmt.Errorf(\"cannot write SeriesMetricNamesStats: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc writeTopHeapEntries(ctx *vmselectRequestCtx, a []storage.TopHeapEntry) error {\n\tif err := ctx.writeUint64(uint64(len(a))); err != nil {\n\t\treturn fmt.Errorf(\"cannot write topHeapEntries size: %w\", err)\n\t}\n\tfor _, e := range a {\n\t\tif err := ctx.writeString(e.Name); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot write topHeapEntry name: %w\", err)\n\t\t}\n\t\tif err := ctx.writeUint64(e.Count); err != nil {\n\t\t\treturn fmt.Errorf(\"cannot write topHeapEntry count: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (s *Server) processSearchMetricNames(ctx *vmselectRequestCtx) error {\n\ts.searchMetricNamesRequests.Inc()\n\n\t// Read request.\n\tif err := ctx.readSearchQuery(); err != nil {\n\t\treturn err\n\t}\n\n\tif err := s.beginConcurrentRequest(ctx); err != nil {\n\t\treturn ctx.writeErrorMessage(err)","sourceCodeStart":945,"sourceCodeEnd":981,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/vmselectapi/server.go#L945-L981","documentation":"Fires in writeTopHeapEntries when writing an entry's Name string to the vmselect connection fails mid-stream. The response payload is abandoned at that entry; the root cause is a transport failure on the RPC connection.","triggerScenarios":"Thrown at lib/vmselectapi/server.go:963 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check for network interruptions or connection resets in logs","Verify vmselect liveness and protocol version match","Retry the TSDB status request"],"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"}