cluster_search in Prometheus fails with: ArgumentError: tried to create Proc object without a block
Broken with Chef-17, works in Chef-16, seems to be ruby 3 related.
Synchronizing cookbooks:
- prometheus-platform (2.3.0)
- cluster-search (1.6.0)
- seven_zip (4.2.2)
- ark (6.0.4)
Installing cookbook gem dependencies:
Compiling cookbooks...
Loading Chef InSpec profile files:
Loading Chef InSpec input files:
Loading Chef InSpec waiver files:
================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/prometheus-platform/recipes/default.rb
================================================================================
ArgumentError
-------------
tried to create Proc object without a block
Cookbook Trace: (most recent call first)
----------------------------------------
/tmp/kitchen/cache/cookbooks/cluster-search/libraries/default.rb:22:in `proc'
/tmp/kitchen/cache/cookbooks/cluster-search/libraries/default.rb:22:in `cluster_search'
/tmp/kitchen/cache/cookbooks/prometheus-platform/recipes/scrapers.rb:33:in `block in from_file'
/tmp/kitchen/cache/cookbooks/prometheus-platform/recipes/scrapers.rb:28:in `each'
/tmp/kitchen/cache/cookbooks/prometheus-platform/recipes/scrapers.rb:28:in `map'
/tmp/kitchen/cache/cookbooks/prometheus-platform/recipes/scrapers.rb:28:in `from_file'
/tmp/kitchen/cache/cookbooks/prometheus-platform/recipes/default.rb:21:in `from_file'
Relevant File Content:
----------------------
/tmp/kitchen/cache/cookbooks/cluster-search/libraries/default.rb:
15: # See the License for the specific language governing permissions and
16: # limitations under the License.
17: #
18:
19: # ClusterSearch module
20: module ClusterSearch
21: def cluster_search(cluster_config)
22>> fun = extract_fun(cluster_config, block_given? ? proc : nil)
23: raise 'cluster_search: empty argument' if cluster_config.to_h.empty?
24:
25: Chef::Log.info "Searching for cluster: #{cluster_config}"
26: cluster_search_fun(cluster_config, fun)
27: end
28:
29: private
30:
31: def extract_fun(cluster_config, fun)
System Info:
------------
chef_version=17.10.3
platform=centos
platform_version=7.9.2009
ruby=ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]
program_name=/bin/chef-client
executable=/opt/chef/bin/chef-client
Running handlers:
[2022-09-16T13:28:38+00:00] ERROR: Running exception handlers
Running handlers complete
[2022-09-16T13:28:38+00:00] ERROR: Exception handlers complete
Infra Phase failed. 0 resources updated in 27 seconds
[2022-09-16T13:28:38+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2022-09-16T13:28:38+00:00] FATAL: ---------------------------------------------------------------------------------------
[2022-09-16T13:28:38+00:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
[2022-09-16T13:28:38+00:00] FATAL: ---------------------------------------------------------------------------------------
[2022-09-16T13:28:38+00:00] FATAL: ArgumentError: tried to create Proc object without a block
via https://gitlab.com/chef-platform/prometheus-platform/-/jobs/3040291632