{"record":{"id":"5591a345ba377b65","repo":"nats-io/nats-server","slug":"could-not-access-service-v","errorCode":null,"errorMessage":"could not access service: %v","messagePattern":"could not access service: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/signal_windows.go","lineNumber":66,"sourceCode":"}\n\n// ProcessSignal sends the given signal command to the running nats-server service.\n// If service is empty, this signals the \"nats-server\" service. This returns an\n// error is the given service is not running or the command is invalid.\nfunc ProcessSignal(command Command, service string) error {\n\tif service == \"\" {\n\t\tservice = serviceName\n\t}\n\n\tm, err := mgr.Connect()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer m.Disconnect()\n\n\ts, err := m.OpenService(service)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not access service: %v\", err)\n\t}\n\tdefer s.Close()\n\n\tvar (\n\t\tcmd svc.Cmd\n\t\tto  svc.State\n\t)\n\n\tswitch command {\n\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","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/signal_windows.go#L48-L84","documentation":"Windows ProcessSignal: the Windows service manager (mgr.Connect succeeded) but OpenService failed for the named service (default 'nats-server'), so the service does not exist or the user lacks access. The underlying mgr error is appended; this is the Windows equivalent of a signal target not found.","triggerScenarios":"Thrown at server/signal_windows.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the service exists: sc query nats-server (or the name you passed)","Run the command from an elevated/authorized shell","Install the service first (nats-server --service install) or pass the correct service name"],"exampleFix":null,"handlingStrategy":"validation","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"}