Skip to content
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_service resource prints ruby warnings from win32-service gem #7335

Closed
flakzilla opened this issue Jun 4, 2018 · 6 comments
Closed

Comments

@flakzilla
Copy link

Description

We are in the process of upgrading from chef-client 13.x to 14.x. We encountered an unexpected behavior in the 14.x client where the windows_service resource prints out a bunch of warnings from the win32-service-0.8.10 gem. The warnings all deal with one particular service (CDPUserSvc) which apparently is checked each time the windows_service resource is used in a recipe. As far as I can tell, these warnings are just warnings and don't actually cause the windows_service resource to not work properly. It's an annoyance to see the warnings in the run output though, makes it much harder to read the logs or STDOUT of a chef run quickly.

Chef Version

chef-client 14.1.12

Platform Version

Windows Server 2016 (long term servicing build 1607, w/ desktop experience)

Replication Case

  • Install Windows Server 2016 with desktop experience
  • Install chef-client 141.12
  • Define a recipe with example windows_service resource like the following example:
windows_service "W32Time" do
        action          [:configure_startup, :start]
        startup_type    :automatic
        run_as_user     'NT AUTHORITY\LocalService'
        run_as_password ""
end
  • Run chef-client from an elevated command prompt on the server's desktop. Observe output similar to the sample below. The session ID appended to the CDPUserSvc service name will likely be different.

Client Output

  * windows_service[W32Time] action configure_startupC:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1081:in `block in services' : C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1081: warning: constant ::Fixnum is deprecated
 (StructuredWarnings::BuiltInWarning)C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1088:in `rescue in block in services' : WARNING: Failed to retrieve description for the CDPUserSvc_5fa8f service. (StructuredWarnings::StandardWarning)C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1101:in `rescue in block in services' : WARNING: Unable to get delayed auto start information for the CDPUserSvc_5fa8f service (StructuredWarnings::StandardWarning)C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1159:in `rescue in block in services' : WARNING: Unable to retrieve failure actions for the CDPUserSvc_5fa8f service (StructuredWarnings::StandardWarning) (up to date)
  * windows_service[W32Time] action startC:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1088:in `rescue in block in services' : WARNING: Failed to retrieve description for the CDPUserSvc_5fa8f service. (StructuredWarnings::StandardWarning)C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1101:in `rescue in block in services' : WARNING: Unable to get delayed auto start information for the CDPUserSvc_5fa8f service (StructuredWarnings::StandardWarning)C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/win32-service-0.8.10/lib/win32/service.rb:1159:in `rescue in block in services' : WARNING: Unable to retrieve failure actions for the CDPUserSvc_5fa8f service (StructuredWarnings::StandardWarning) (up to date)

Stacktrace

No stacktrace, the issue does not result in an error condition.

@tas50
Copy link
Contributor

tas50 commented Jun 13, 2018

This was fixed in win32-service here chef/win32-service@7b1720f. We just need to get that gem released and then bump our dep to fix that. Thanks for the report @flakzilla. These are annoying and easy to get rid of.

@flakzilla
Copy link
Author

Well enough. We'll keep an eye on this and update to the newer client version when it becomes available. I can confirm the issue is still present in 14.2.

Speaking of, the 14.2 client spits a bunch of these out unexpectedly:

WARN: Using deprecated positional arguments for sign(), please update to keyword arguments (from C:/opscode/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0-universal-mingw32/lib/chef/http/authenticator.rb:114)

Do you want another bug report for this?

@tas50
Copy link
Contributor

tas50 commented Jun 13, 2018

That last one we already have a fix for. It's in master and that'll get resolved with 14.3's release.

@flakzilla
Copy link
Author

Sounds good to me. Thanks for taking care of it.

@tas50
Copy link
Contributor

tas50 commented Jun 29, 2018

Resolved by #7405

@tas50 tas50 closed this as completed Jun 29, 2018
@lock
Copy link

lock bot commented Aug 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants