So at one point I had consul running on Windows 7. This was several months ago. Recently I started looking back at consul, so I installed it using the Chocolatey package found here on the Chocolatey website.
First off, the package always throws an error when it tries to start the service. The error:
c o n s u l : U n e x p e c t e d s t a t u s S E R V I C E _ S T O P P E D i n r e s p o n s e t o S T A R T c o n t r o l .
That doesn't make Chocolatey think that the package failed to install though. Afterwards, I try dumping out the service using nssm and this is what appears:
C:\ProgramData\chocolatey PS>nssm dump consul
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe install consul C:\ProgramData\chocolatey\lib\consul\tools\consul.exe
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppParameters "agent -ui -config-dir=C:\ProgramData\consul\config -data-dir=C:\ProgramData\consul\data -bind '127.0.0.1' -bootstrap -server"
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppDirectory C:\ProgramData\chocolatey\lib\consul\tools
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppExit Default Exit
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppEnvironmentExtra :GOMAXPROCS=2
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppStdout C:\ProgramData\consul\logs\consul-output.log
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppStderr C:\ProgramData\consul\logs\consul-error.log
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppRotateFiles 1
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppRotateOnline 1
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul AppRotateBytes 10485760
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul DisplayName consul
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul ObjectName "NT Authority\NetworkService"
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul Start SERVICE_AUTO_START
C:\ProgramData\chocolatey\lib\NSSM\tools\nssm.exe set consul Type SERVICE_WIN32_OWN_PROCESS
If I take the above AppParameters and paste them after consul, it works perfectly. So, I'm at a lost to why I cannot start the service.
C:\ProgramData\chocolatey PS>start-service consul
start-service : Service 'consul (consul)' cannot be started due to the following error: Cannot start service consul on computer '.'.
At line:1 char:1
+ start-service consul
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
When I look at the Event Viewer it tells me this error message:
The consul service terminated with the following service-specific error:
Incorrect function.
Has anyone got the consul Chocolatey package to work recently on Windows? Is there a chance that this is a Windows bug, or a NSSM bug, or even a consul bug? I tried different versions of NSSM and different versions of consul with the same result. Any help I can get to get consul running on Windows would be appreciated.