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

18.4.2 windows_service property "description": NoMethodError #14229

Open
rjhornsby opened this issue Feb 7, 2024 · 3 comments
Open

18.4.2 windows_service property "description": NoMethodError #14229

rjhornsby opened this issue Feb 7, 2024 · 3 comments
Assignees
Labels
Chef 18.5 Status: Waiting on Release Ready to merge, but waiting on cutting a release

Comments

@rjhornsby
Copy link

rjhornsby commented Feb 7, 2024

Description

As of 18.4.2, the windows_service resource does not process the description property/argument correctly. Example code:

windows_service service_name do
  binary_path_name startup_command
   name new_resource.agent_name
   description "#{new_resource.agent_name} agent"
   delayed_start false
   timeout 30
   action %i[create enable start]
 end

The error is:

NoMethodError
-------------
undefined method `description' for #<struct Struct::ServiceConfigInfo service_type="own process",
 start_type="auto start", error_control="normal", binary_path_name="C:/vault/vault.exe agent 
-config=C:/vault/config/agent.hcl ", load_order_group="", tag_id=0, dependencies=[], 
service_start_name="LocalSystem", display_name="vault">

            current_resource.description(config_info.description)           if new_resource.description
                                                    ^^^^^^^^^^^^

Removing the description property from the resource works around the problem.

Chef Version

18.4.2 (was working in 18.3.0)

Platform Version

      System Info:
      ------------
      chef_version=18.4.2
      platform=windows
      platform_version=10.0.17763
      ruby=ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]

Stacktrace

C:/cinc-project/cinc/embedded/lib/ruby/gems/3.1.0/gems/chef-18.4.2-x64-mingw-ucrt/lib/chef/provider/service/windows.rb:77:in `load_current_resource'
C:/cinc-project/cinc/embedded/lib/ruby/gems/3.1.0/gems/chef-18.4.2-x64-mingw-ucrt/lib/chef/provider.rb:228:in `run_action'
C:/cinc-project/cinc/embedded/lib/ruby/gems/3.1.0/gems/chef-18.4.2-x64-mingw-ucrt/lib/chef/resource.rb:601:in `block in run_action'
@rjhornsby rjhornsby added the Status: Untriaged An issue that has yet to be triaged. label Feb 7, 2024
@bdwyertech
Copy link

This is a result of #14064. ServiceConfigInfo does not include a description field, do we even test things anymore?

image

https://github.com/chef/win32-service/blob/67a0f7ac46a5e0332d95867f1ee2e7cd733b9117/lib/win32/service.rb#L206-L217

@joeldq
Copy link

joeldq commented Apr 8, 2024

This is also happening on Chef 17.10.122

@bdwyertech
Copy link

bdwyertech commented Apr 8, 2024

This is also happening on Chef 17.10.122

Makes sense. They backported the change I referenced into 17 here. #14151

They need to either revert or add the description field to the win32-service library.

@tpowell-progress tpowell-progress self-assigned this Apr 9, 2024
@tpowell-progress tpowell-progress added Triage: Confirmed Indicates and issue has been confirmed as described. and removed Status: Untriaged An issue that has yet to be triaged. labels Apr 11, 2024
@tpowell-progress tpowell-progress added Status: Waiting on Release Ready to merge, but waiting on cutting a release Chef 18.5 and removed Triage: Confirmed Indicates and issue has been confirmed as described. labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chef 18.5 Status: Waiting on Release Ready to merge, but waiting on cutting a release
Projects
None yet
Development

No branches or pull requests

4 participants