VictoriaMetrics/VictoriaMetrics · error
cannot write series count to vmselect: %w
Error message
cannot write series count to vmselect: %w
What it means
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.
Source
Thrown at lib/vmselectapi/server.go:847
if err := s.beginConcurrentRequest(ctx); err != nil {
return ctx.writeErrorMessage(err)
}
defer s.endConcurrentRequest()
// Execute the request
n, err := s.api.SeriesCount(ctx.qt, accountID, projectID, ctx.deadline)
if err != nil {
return ctx.writeErrorMessage(err)
}
// Send an empty error message to vmselect.
if err := ctx.writeString(""); err != nil {
return fmt.Errorf("cannot send empty error message: %w", err)
}
// Send series count to vmselect.
if err := ctx.writeUint64(n); err != nil {
return fmt.Errorf("cannot write series count to vmselect: %w", err)
}
return nil
}
func (s *Server) processTSDBStatus(ctx *vmselectRequestCtx) error {
s.tsdbStatusRequests.Inc()
// Read request
if err := ctx.readSearchQuery(); err != nil {
return err
}
if err := ctx.readDataBufBytes(maxLabelValueSize); err != nil {
return fmt.Errorf("cannot read focusLabel: %w", err)
}
focusLabel := string(ctx.dataBuf)
topN, err := ctx.readUint32()
if err != nil {
return fmt.Errorf("cannot read topN: %w", err)View on GitHub (pinned to 5079fb58f1)
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at lib/vmselectapi/server.go:847 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of VictoriaMetrics/VictoriaMetrics@5079fb58f1 (2026-09-03).
Data as JSON: /api/errors/1f51c8d1e6e1fba6.
Report an issue: GitHub.