LoadError: cannot load such file -- chef/mixin/homebrew_user when spinning a test server
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 8.2k
- Forks
- 2.5k
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 23
Description
When spinning up the server where chef-client is installed found an error :
Chef-client version: 18.5.0.
even tried to installed the libraries for homebrew and tried executing but still getting same error
Generated at 2025-01-29 06:09:22 -0500
LoadError: cannot load such file -- chef/mixin/homebrew_user
internal:/opt/chef/embedded/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require' <internal:/opt/chef/embedded/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
/var/chef/cache/cookbooks/homebrew/libraries/helpers.rb:23:in <class:HomebrewUserWrapper>' /var/chef/cache/cookbooks/homebrew/libraries/helpers.rb:22:in <top (required)>'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:290:in require' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:290:in block in load_libraries_from_cookbook'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:431:in block (2 levels) in each_file_in_cookbook_by_segment' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:428:in each'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:428:in block in each_file_in_cookbook_by_segment' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:427:in each'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:427:in each_file_in_cookbook_by_segment' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:287:in load_libraries_from_cookbook'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:135:in block in compile_libraries' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:132:in each'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:132:in compile_libraries' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context/cookbook_compiler.rb:103:in compile'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/run_context.rb:259:in load' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/policy_builder/expand_node_object.rb:103:in setup_run_context'
/opt/chef/embedded/lib/ruby/3.1.0/forwardable.rb:238:in setup_run_context' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/client.rb:493:in setup_run_context'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/client.rb:294:in run' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/application.rb:305:in run_with_graceful_exit_option'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/application.rb:281:in block in run_chef_client' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/local_mode.rb:42:in with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/application.rb:264:in run_chef_client' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/application/base.rb:354:in run_application'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.6.2/lib/chef/application.rb:67:in run' /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-bin-18.6.2/bin/chef-client:25:in <top (required)>'
/usr/bin/chef-client:192:in load' /usr/bin/chef-client:192:in
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with /var/chef/cache/cookbooks/homebrew/libraries/helpers.rb, especially the require at line 23, and compare it with the Chef 18.5.0 and 18.6.2 environment shown in the trace. Reproduce the server run and determine whether the missing chef/mixin/homebrew_user file is expected to be available. Done means the cookbook loads without this LoadError and the relevant regression is covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100