nats-io/nats-server · error

unknown signal %q

Error message

unknown signal %q

What it means

Windows ProcessSignal switch over the command (stop/quit, reopen, reload, ldm) hit the default case: the Command value is not one of the recognized Windows service control commands, so no svc.Cmd could be selected. Mirrors the non-Windows 'unknown signal' error; caused by an invalid --signal command.

Source

Thrown at server/signal_windows.go:89

		cmd svc.Cmd
		to  svc.State
	)

	switch command {
	case CommandStop, CommandQuit:
		cmd = svc.Stop
		to = svc.Stopped
	case CommandReopen:
		cmd = reopenLogCmd
		to = svc.Running
	case CommandReload:
		cmd = svc.ParamChange
		to = svc.Running
	case commandLDMode:
		cmd = ldmCmd
		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)
		}
	}

View on GitHub (pinned to 3a66a489d2)

Solutions

  1. Use a supported command: stop, quit, reopen, reload, ldm
  2. Check the command spelling in the --signal argument
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/signal_windows.go:89 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/21fe3cf310144809. Report an issue: GitHub.