-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows sensu service DSC error for starting #33
Comments
This looks very similar to the following error in: |
Can you provide your Puppet code where you setup the sensuclassic classes and any hiera data? Feel free to replace sensitive information with fake data. I would like to try and reproduce this issue locally. What version of Windows is this happening on? |
Hello @treydock I have attached how we are calling the class for sensuclassic with params you can replace with required strings. I have stripped out some non-required params so have done my best to leave all you should need. I have tested this issue on Windows Server 2012R2 and Windows Server 2016. |
Do you have something special configured for chocolatey to work? I am unable to install Sensu through Chocolatey. When I go to chocolatey website the only options for Sensu I see are for Sensu Go (sensu-agent and sensu-cli). Are you maybe using some kind of custom chocolately repo or custom chocolatey config? This is error I get:
|
Hello @treydock we internalise packages from chocolately into our internal repo whereby that repo is added as a source when the chocolately packages are installed. I have just checked though and you are right there is only Sensu Go so we have downloaded the client from Sensu themselves from https://eol-repositories.sensuapp.org/msi/2016/ and created the chocolately package from their msi using the chocolately package builder gui. We used the default options within that GUI so just a right click, create, build package and then uploaded to our internal repo. |
@StuartMcManus We just released v3.6.1. Could you give that a try and let us know if it addresses the issue. |
Hello @ghoneycutt sorry I have not had a chance to test yet but will pick Monday to test out. |
Hello @ghoneycutt I have tested using the new release 3.6.1 but it still comes up with the same error. |
@StuartMcManus Based on the errors you got its almost as if the Chocolatey package is installing the needed service and then the DSC service in the Puppet module is failing to to properly install the service or detect the existence of the service in same puppet run. I don't have the ability to test with Chocolately packages so I'm not sure I can reproduce this issue. One thing we can do to troubleshoot is you can modify this module on your local system and see if commenting out the following lines solves the problem: Also: Change these two lines to use https://github.com/sensu/puppet-module-sensuclassic/blob/master/manifests/client.pp#L57 https://github.com/sensu/puppet-module-sensuclassic/blob/master/manifests/client.pp#L68 If your able to share how you add the chocolately package and possibly make the chocolatey package available to me I can try debugging this locally. |
Hello @treydock this is happening after the service is installed correctly by DSC and working, whereby I then stop the service and run puppet to try and start it again. Chocolately just puts down the the files doing a standard msi install and puppet sensuclassic module creates the service using DSC. Chocolatey for you doesn't need to be factored in as it just puts down the files you can just manually install and run puppet to setup the service for you. The problem is purely to do with the DSC_Service resource within the sensuclassic module not detecting the service correctly when the service is stopped which sounds a like it then sees it as absent but when the service is running it does not have an issue. |
Hello @treydock just checking if you have had a chance to test out with a standard install using the package resource and puppet trying to start the service? |
I can reproduce the issue and honestly have no idea how to fix the problem, it's likely a bug or misconfiguration with the DSC Puppet module. I think I may be able to come up with a way to get rid of the Thus far what I've observed is what I think you saw and that's if |
Replace dsc_service with Exec that installs the sensu-client service Fixes #33
@StuartMcManus Can you try the changes in #35 and let me know if that resolves your issue? |
Replace dsc_service with Exec that installs the sensu-client service Fixes #33
Replace dsc_service with Exec that installs the sensu-client service Fixes #33
Replace dsc_service with Exec that installs the sensu-client service Fixes #33
Description of problem
Command used and debugging output
Platform and version information
Your OS: Redhat 7.8 (Maipo)
Your Ruby version: ruby 2.0.0.648-36.el7.x86_64
Your version of Puppet: 5.5.20 open source
Your version of Sensu: 1.8.0.1 (Windows client)
Your version of this module: 3.4.1
DSC module version: 1.9.3
Anything else to add that you think will be helpful?
I have attached the Puppet run below but the main part of the error is:
Error: Could not set 'present' on ensure: PowerShell DSC resource MSFT_ServiceResource failed to execute Set-TargetResource functionality with error message: The service 'sensu-client' to create alre ady exists with path 'c:\opt\sensu\bin\sensu-client.exe' (file: /etc/puppetlabs/code/environments/test/modules/external/sensuclassic/manifests/client.pp, line: 75) Error: Could not set 'present' on ensure: PowerShell DSC resource MSFT_ServiceResource failed to execute Set-TargetResource functionality with error message: The service 'sensu-client' to create alre ady exists with path 'c:\opt\sensu\bin\sensu-client.exe' (file: /etc/puppetlabs/code/environments/test/modules/external/sensuclassic/manifests/client.pp, line: 75) Wrapped exception: PowerShell DSC resource MSFT_ServiceResource failed to execute Set-TargetResource functionality with error message: The service 'sensu-client' to create already exists with path 'c:\opt\sensu\bin\sen su-client.exe'
Puppet_Run_Service_Start_Issue.txt
The text was updated successfully, but these errors were encountered: