{"record":{"id":"1f51c8d1e6e1fba6","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-write-series-count-to-vmselect-w","errorCode":null,"errorMessage":"cannot write series count to vmselect: %w","messagePattern":"cannot write series count to vmselect: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/vmselectapi/server.go","lineNumber":847,"sourceCode":"\tif err := s.beginConcurrentRequest(ctx); err != nil {\n\t\treturn ctx.writeErrorMessage(err)\n\t}\n\tdefer s.endConcurrentRequest()\n\n\t// Execute the request\n\tn, err := s.api.SeriesCount(ctx.qt, accountID, projectID, ctx.deadline)\n\tif err != nil {\n\t\treturn ctx.writeErrorMessage(err)\n\t}\n\n\t// Send an empty error message to vmselect.\n\tif err := ctx.writeString(\"\"); err != nil {\n\t\treturn fmt.Errorf(\"cannot send empty error message: %w\", err)\n\t}\n\n\t// Send series count to vmselect.\n\tif err := ctx.writeUint64(n); err != nil {\n\t\treturn fmt.Errorf(\"cannot write series count to vmselect: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (s *Server) processTSDBStatus(ctx *vmselectRequestCtx) error {\n\ts.tsdbStatusRequests.Inc()\n\n\t// Read request\n\tif err := ctx.readSearchQuery(); err != nil {\n\t\treturn err\n\t}\n\tif err := ctx.readDataBufBytes(maxLabelValueSize); err != nil {\n\t\treturn fmt.Errorf(\"cannot read focusLabel: %w\", err)\n\t}\n\tfocusLabel := string(ctx.dataBuf)\n\ttopN, err := ctx.readUint32()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot read topN: %w\", err)","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/vmselectapi/server.go#L829-L865","documentation":"Fires in processSeriesCount after the series count was successfully fetched: the binary write of the count to the vmselect RPC connection failed. This is a transport-level failure on the vmstorage<->vmselect connection (broken pipe, reset, timeout), meaning the successful query result could not be delivered.","triggerScenarios":"Thrown at lib/vmselectapi/server.go:847 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network stability between vmstorage and vmselect","Look for earlier log lines indicating the connection was closed or timed out","Verify vmselect is alive and not restarting/OOM-killed","Increase RPC timeouts if large responses or slow links are involved","Retry the query; the failure is usually transient connection loss"],"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"}