{"record":{"id":"7d84babb37d3e45c","repo":"nats-io/nats-server","slug":"could-not-send-control-d-v","errorCode":null,"errorMessage":"could not send control=%d: %v","messagePattern":"could not send control=(.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/signal_windows.go","lineNumber":94,"sourceCode":"\tcase CommandStop, CommandQuit:\n\t\tcmd = svc.Stop\n\t\tto = svc.Stopped\n\tcase CommandReopen:\n\t\tcmd = reopenLogCmd\n\t\tto = svc.Running\n\tcase CommandReload:\n\t\tcmd = svc.ParamChange\n\t\tto = svc.Running\n\tcase commandLDMode:\n\t\tcmd = ldmCmd\n\t\tto = svc.Running\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown signal %q\", command)\n\t}\n\n\tstatus, err := s.Control(cmd)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not send control=%d: %v\", cmd, err)\n\t}\n\n\ttimeout := time.Now().Add(10 * time.Second)\n\tfor status.State != to {\n\t\tif timeout.Before(time.Now()) {\n\t\t\treturn fmt.Errorf(\"timeout waiting for service to go to state=%d\", to)\n\t\t}\n\t\ttime.Sleep(300 * time.Millisecond)\n\t\tstatus, err = s.Query()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not retrieve service status: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":76,"sourceCodeEnd":111,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/signal_windows.go#L76-L111","documentation":"Windows ProcessSignal: sending the selected service control command via s.Control(cmd) returned an error — the service exists but rejected the control (e.g. service already stopping, permission issue, or SCM communication failure). The control code and error are echoed; the signal was not delivered.","triggerScenarios":"Thrown at server/signal_windows.go:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check service state with sc query before sending the control","Run from an elevated shell to rule out access-denied","Retry after the service reaches a stable state"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}