homebrew icon indicating copy to clipboard operation
homebrew copied to clipboard

undefined method `full' for Chef::Resource::HomebrewTap

Open mjmerin opened this issue 3 years ago • 3 comments

:speaking_head: Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

:ghost: Brief Description

A clear and concise description of what the bug is.

When using the homebrew_tap resource we get the following error

         * homebrew_tap[chef/chef] action tap
           
           ================================================================================
           Error executing action `tap` on resource 'homebrew_tap[chef/chef]'
           ================================================================================
           
           NoMethodError
           -------------
           undefined method `full' for Chef::Resource::HomebrewTap
           
           Resource Declaration:
           ---------------------
           # In /Users/Shared/kitchen/cache/cookbooks/lab_build/recipes/chef_environment.rb

I've also tried executing the install_taps recipe and get the following similar errors

       Recipe: homebrew::install_taps
         * homebrew_tap[chef/chef] action tap
           
           ================================================================================
           Error executing action `tap` on resource 'homebrew_tap[chef/chef]'
           ================================================================================
           
           NoMethodError
           -------------
           undefined method `full' for Chef::Resource::HomebrewTap

:pancakes: Cookbook version

Version of the cookbook where you are encountering the issue.

5.3.0

:woman_cook: Chef-Infra Version

Tested on

21.12.720 and 21.9.613

:tophat: Platform details

macOS 10.15.7 Catalina

Steps To Reproduce

Steps to reproduce the behavior:

kitchen converge a recipe using homebrew_tap such as

homebrew_tap `chef/chef`

:police_car: Expected behavior

Expected tap to work

:heavy_plus_sign: Additional context

--full does not seem to be an option in homebrew's documentation anymore: https://docs.brew.sh/Taps

When trying to execute it we get the following:

brew tap --full chef/chef
Error: Calling the --full switch is disabled! There is no replacement.

Associated Homebrew PRs where this was removed: https://github.com/Homebrew/brew/pull/11337 https://github.com/Homebrew/brew/pull/11328

mjmerin avatar Dec 22 '21 18:12 mjmerin

      System Info:
       ------------
       chef_version=17.9.18
       platform=mac_os_x
       platform_version=10.15.7
       ruby=ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin19]
       program_name=/opt/chef/bin/chef-client
       executable=/opt/chef/bin/chef-client
       
   
   Running handlers:
   [2021-12-27T11:39:31-08:00] ERROR: Running exception handlers
   Running handlers complete
   [2021-12-27T11:39:31-08:00] ERROR: Exception handlers complete
   Infra Phase failed. 105 resources updated in 03 minutes 41 seconds
   [2021-12-27T11:39:31-08:00] FATAL: Stacktrace dumped to /Users/Shared/kitchen/cache/chef-stacktrace.out
   [2021-12-27T11:39:31-08:00] FATAL: ---------------------------------------------------------------------------------------
   [2021-12-27T11:39:31-08:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
   [2021-12-27T11:39:31-08:00] FATAL: ---------------------------------------------------------------------------------------
   [2021-12-27T11:39:31-08:00] FATAL: NoMethodError: homebrew_tap[chef/chef] (lab_build::chef_environment line 35) had an error: NoMethodError: undefined method `full' for Chef::Resource::HomebrewTap

jweyer8 avatar Dec 27 '21 20:12 jweyer8

I modified /opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.9.18/lib/chef/resource/homebrew_tap.rb in the node. removed #{new_resource.full ? "--full" : ""}, then it works.

https://github.com/chef/chef/blob/main/CHANGELOG.md#v17918-2021-12-23 "Remove the full option from homebrew_tap #12346 (damacus)"

chadjiang avatar Dec 28 '21 02:12 chadjiang

looks chef side already merged fix. https://github.com/chef/chef/pull/12418

chadjiang avatar Jan 04 '22 18:01 chadjiang