nats-io/nats-server · error
could not retrieve service status: %v
Error message
could not retrieve service status: %v
What it means
Windows ProcessSignal: while polling s.Query() during the state-transition wait loop, querying the service status failed (SCM communication error, service terminated abruptly, etc.). The underlying error is echoed; the wait for the target state is abandoned.
Source
Thrown at server/signal_windows.go:105
to = svc.Running
default:
return fmt.Errorf("unknown signal %q", command)
}
status, err := s.Control(cmd)
if err != nil {
return fmt.Errorf("could not send control=%d: %v", cmd, err)
}
timeout := time.Now().Add(10 * time.Second)
for status.State != to {
if timeout.Before(time.Now()) {
return fmt.Errorf("timeout waiting for service to go to state=%d", to)
}
time.Sleep(300 * time.Millisecond)
status, err = s.Query()
if err != nil {
return fmt.Errorf("could not retrieve service status: %v", err)
}
}
return nil
}
View on GitHub (pinned to 3a66a489d2)
Solutions
- Verify the service still exists and the SCM is healthy (sc query)
- Retry the signal command after a brief pause
- Check Windows event logs for service crashes
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at server/signal_windows.go:105 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02).
Data as JSON: /api/errors/e78a0dd49db6e071.
Report an issue: GitHub.