@neha-p6 - this does not have to be the last PR before the release, the tag should be with the minor changes that will cause the version bump.
What is the bug this is fixing?
The reason for doing this is: Currently there are issues with AIX builders and azure resource that is causing our piprlines to break. The releng team is looking to fix these issues. But we do not want this to be blocking for the next Infra Client 18 release.
This should be reverted immediately post the chef-client release: https://chefio.atlassian.net/browse/CHEF-1491
Looks like the DCO is failing?
Describe the bug
When I try to reindex an Automate 2 embedded Chef Server's org, the attempted reindex fails
To Reproduce
Install https://docs.chef.io/automate/infra_server/#command-line-install-of-chef-automate-and-infra-server
Create a user and org following steps 5. and 6. here https://docs.chef.io/server/install_server/#standalone
chef-server-ctl user-create janedoe Jane Doe janed@example.com 'abc123' --filename janedoe.pem
chef-server-ctl org-create testit 'Testingit' --association_user janedoe --filename testit-validator.pem
Notice on the Automate system's command line that I can view the user and org, like this
# chef-server-ctl org-list
testit
# chef-server-ctl user-list
janedoe
pivotal
Try a reindex
# chef-server-ctl reindex testit
/hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/vendor/bundle/gems/bundler-
1.17.2/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated
Reindexing orgs: ["testit"]
- Reindexing.
escript: exception error: no match of right hand side value
{ok,"400",
[{"Server","openresty"},
{"Date","Thu, 29 Apr 2021 19:41:14 GMT"},
{"Content-Type","text/html"},
{"Content-Length","250"},
{"Connection","close"}],
"<html>\r\n<head><title>400 No required SSL certificate was sent</title></head>\r\n<body
bgcolor=\"white\">\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>No required SSL certificate was
sent</center>\r\n<hr><center>openresty</center>\r\n</body>\r\n</html>\r\n"}
Failed to reindex data for testit!
Expected behavior
The testit org's search index is dropped and reindexed from the postgresql content and is searchable afterwards
Actual behavior
# chef-server-ctl reindex testit
/hab/pkgs/chef/chef-server-ctl/14.1.0/20210225010004/vendor/bundle/gems/bundler-
1.17.2/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated
Reindexing orgs: ["testit"]
- Reindexing.
escript: exception error: no match of right hand side value
{ok,"400",
[{"Server","openresty"},
{"Date","Thu, 29 Apr 2021 19:41:14 GMT"},
{"Content-Type","text/html"},
{"Content-Length","250"},
{"Connection","close"}],
"<html>\r\n<head><title>400 No required SSL certificate was sent</title></head>\r\n<body
bgcolor=\"white\">\r\n<center><h1>400 Bad Request</h1></center>\r\n<center>No required SSL certificate was
sent</center>\r\n<hr><center>openresty</center>\r\n</body>\r\n</html>\r\n"}
Failed to reindex data for testit!]
In the chef-automate system-logs
output during this attempted operation, we see this
Apr 29 19:58:42 automate-deployment.test hab[1336]: automate-cs-nginx.default(O): 127.0.0.1 - - [29/Apr/2021:19:58:42 +0000] "GET /_route/organizations/testit HTTP/1.1" 400 "0.000" 250 "-" "-" "-" "-" "-" "-" "-" "-" "-" "-" 87
This appears to correlate to line 149 on the system
# grep -n Headers /hab/pkgs/chef/oc_erchef/14.1.0/20210225010013/bin/reindex-opc-organization
149: {ok, "200", _Headers, Body} = rpc:call(?ERCHEF, ibrowse,send_req, [IntLB ++ "/_route/organizations/" ++ OrgName, [], get]),
153: Headers = string:join(lists:map(fun({Key, Val}) -> binary_to_list(Key) ++ "=" ++ integer_to_list(Val) end, KVList), ";"),
154: rpc:call(?ERCHEF, xdarklaunch_req,parse_header, [ fun(_) -> Headers end]).
and in https://github.com/chef/chef-server/blob/39fb0a3358cbd9e05d76f36dccc55e7024a67808/src/oc_erchef/priv/reindex-opc-organization#L149
Additional context
chef-automate version
output from the Automate 2 system
# chef-automate version
Version: 2
CLI Build: 20210416180743
Server Build: 20210420090302
chef-automate service-versions
from the Automate 2 system
# chef-automate service-versions
chef/backup-gateway 0.1.0 20210225022012
chef/automate-postgresql 9.6.11 20200929122522
chef/automate-pg-gateway 0.0.1 20201223040715
chef/automate-elasticsearch 6.8.14 20210309060053
chef/automate-es-gateway 0.1.0 20210305110358
chef/automate-ui 2.0.0 20210420085155
chef/pg-sidecar-service 0.0.1 20210225021936
chef/cereal-service 0.1.0 20210225021803
chef/event-service 0.1.0 20210225021907
chef/authz-service 0.1.0 20210309055746
chef/es-sidecar-service 1.0.0 20210225021453
chef/event-feed-service 1.0.0 20210309055746
chef/automate-dex 0.1.0 20210225021933
chef/teams-service 0.1.0 20210225021851
chef/authn-service 0.1.0 20210225021956
chef/secrets-service 1.0.0 20210225021851
chef/applications-service 1.0.0 20210225021849
chef/notifications-service 1.0.0 20210225021720
chef/nodemanager-service 1.0.0 20210415102807
chef/compliance-service 1.11.1 20210415102807
chef/license-control-service 1.0.0 20210225021855
chef/local-user-service 0.1.0 20210225021453
chef/session-service 0.1.0 20210225021851
chef/config-mgmt-service 0.1.0 20210309055742
chef/ingest-service 0.1.0 20210309055742
chef/infra-proxy-service 0.1.0 20210419015943
chef/data-feed-service 1.0.0 20210309055742
chef/event-gateway 0.1.0 20210225021924
chef/automate-gateway 0.1.0 20210419015946
chef/automate-cs-bookshelf 14.1.0 20210305102850
chef/automate-cs-oc-bifrost 14.1.0 20210305102849
chef/automate-cs-oc-erchef 14.1.0 20210305102850
chef/automate-cs-nginx 14.1.0 20210305102850
chef/automate-load-balancer 0.1.0 20201125093110
chef/deployment-service 0.1.0 20210416180743
Aha! Link: https://chef.aha.io/epics/SH-E-312
Fixed with https://github.com/chef/chef-server/pull/3390 and available from 15.6.1 of Infra Server release.
Would you be able to upload the cookbook that you are seeing this issue with and also a gzip of the log directory that includes the error. That will help us understand a few more things that might be causing this issue.
The build is successful, but it was not able to find the builders for Amazon Linux 2022. Still looking.
Issue when using chef_gem
resource installing a custom gem
Chef Client 18.1.0
Oracle Linux 7.x
Using chef client 18 to install gem Works correctly on Chef 16
Chef 18
---- Begin output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
STDOUT:
STDERR: ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::
---- End output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
Chef 16
* chef_gem[ibus] action upgrade[2023-02-22T17:49:45+00:00] INFO: Processing chef_gem[ibus] action upgrade (/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/libraries/host_helper.rb line 15)
[2023-02-22T17:50:08+00:00] INFO: chef_gem[ibus] upgraded(allow_downgrade) ibus to 0.9.3
- upgrade(allow_downgrade) package ibus from uninstalled to 0.9.3
================================================================================
Error executing action `upgrade` on resource 'chef_gem[ibus]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
STDOUT:
STDERR: ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::
---- End output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
Ran /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ returned 1
...
[2023-02-22T19:29:47+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2023-02-22T19:29:47+00:00] FATAL: ---------------------------------------------------------------------------------------
[2023-02-22T19:29:47+00:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
[2023-02-22T19:29:47+00:00] FATAL: ---------------------------------------------------------------------------------------
[2023-02-22T19:29:47+00:00] DEBUG: Mixlib::ShellOut::ShellCommandFailed: mysql[install_mysql] (cwxtiauto_ibus_ops::mysql_install line 7) had an error: Mixlib::ShellOut::ShellCommandFailed: chef_gem[ibus] (cwxtiauto_ibus_ops::mysql_install line 15) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
STDOUT:
STDERR: ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::
---- End output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
Ran /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ returned 1
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/mixlib-shellout-3.2.7/lib/mixlib/shellout.rb:300:in `invalid!'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/mixlib-shellout-3.2.7/lib/mixlib/shellout.rb:287:in `error!'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/mixlib-shellout-3.2.7/lib/mixlib/shellout/helper.rb:130:in `shell_out_compacted!'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/mixlib-shellout-3.2.7/lib/mixlib/shellout/helper.rb:54:in `shell_out!'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider/package/rubygems.rb:587:in `install_via_gem_command'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider/package/rubygems.rb:555:in `install_package'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider/package/rubygems.rb:594:in `upgrade_package'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider/package.rb:147:in `block (3 levels) in <class:Package>'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider/package.rb:269:in `multipackage_api_adapter'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider/package.rb:146:in `block (2 levels) in <class:Package>'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/mixin/why_run.rb:51:in `add_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:293:in `converge_by'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider/package.rb:145:in `block in <class:Package>'
(eval):2:in `block in action_upgrade'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:304:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:304:in `compile_and_converge_action'
(eval):2:in `action_upgrade'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:245:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:601:in `block in run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:628:in `with_umask'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:600:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_builder.rb:85:in `block in build'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_builder.rb:84:in `each'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_builder.rb:84:in `build'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/dsl/declare_resource.rb:313:in `build_resource'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/dsl/declare_resource.rb:265:in `declare_resource'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/dsl/resources.rb:36:in `chef_gem'
/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/libraries/host_helper.rb:15:in `rescue in require_ibus_gem'
/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/libraries/host_helper.rb:5:in `require_ibus_gem'
/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/libraries/host_helper.rb:30:in `host'
/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/resources/mysql.rb:312:in `block in class_from_file'
(eval):2:in `block in action_install'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:304:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:304:in `compile_and_converge_action'
(eval):2:in `action_install'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:245:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:601:in `block in run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:628:in `with_umask'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:600:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:74:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:108:in `block in run_all_actions'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:108:in `each'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:108:in `run_all_actions'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:132:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/resource_list.rb:96:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:54:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/resource_list.rb:94:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/3.1.0/forwardable.rb:238:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:130:in `converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:852:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:847:in `catch'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:847:in `converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:871:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:289:in `run'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:305:in `run_with_graceful_exit_option'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:281:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/local_mode.rb:42:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:264:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application/base.rb:352:in `run_application'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:67:in `run'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-bin-18.1.0/bin/chef-client:25:in `<top (required)>'
/opt/chef/bin/chef-client:184:in `load'
/opt/chef/bin/chef-client:184:in `<main>'
>>>> Caused by Gem::MissingSpecError: Gem::MissingSpecError
/opt/chef/embedded/lib/ruby/3.1.0/rubygems/dependency.rb:311:in `to_specs'
/opt/chef/embedded/lib/ruby/3.1.0/rubygems/dependency.rb:323:in `to_spec'
/opt/chef/embedded/lib/ruby/3.1.0/rubygems/core_ext/kernel_gem.rb:62:in `gem'
/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/libraries/host_helper.rb:7:in `require_ibus_gem'
/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/libraries/host_helper.rb:30:in `host'
/tmp/kitchen/cache/cookbooks/cwxtiauto_ibus_ops/resources/mysql.rb:312:in `block in class_from_file'
(eval):2:in `block in action_install'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:304:in `instance_eval'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:304:in `compile_and_converge_action'
(eval):2:in `action_install'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/provider.rb:245:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:601:in `block in run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:628:in `with_umask'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource.rb:600:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:74:in `run_action'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:108:in `block in run_all_actions'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:108:in `each'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:108:in `run_all_actions'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:132:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/resource_list.rb:96:in `block in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/stepable_iterator.rb:54:in `each_with_index'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/resource_collection/resource_list.rb:94:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/3.1.0/forwardable.rb:238:in `execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/runner.rb:130:in `converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:852:in `block in converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:847:in `catch'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:847:in `converge'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:871:in `converge_and_save'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/client.rb:289:in `run'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:305:in `run_with_graceful_exit_option'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:281:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/local_mode.rb:42:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:264:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application/base.rb:352:in `run_application'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-18.1.0/lib/chef/application.rb:67:in `run'
/opt/chef/embedded/lib/ruby/gems/3.1.0/gems/chef-bin-18.1.0/bin/chef-client:25:in `<top (required)>'
/opt/chef/bin/chef-client:184:in `load'
/opt/chef/bin/chef-client:184:in `<main>'
[2023-02-22T19:29:47+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: mysql[install_mysql] (cwxtiauto_ibus_ops::mysql_install line 7) had an error: Mixlib::ShellOut::ShellCommandFailed: chef_gem[ibus] (cwxtiauto_ibus_ops::mysql_install line 15) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
STDOUT:
STDERR: ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::
---- End output of /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ ----
Ran /opt/chef/embedded/bin/gem install ibus -q --no-document -v "0.10.0" --clear-sources --source=https://<redacted>/api/gems/rubygems/ returned 1
Was able to get it to work after running /opt/chef/embedded/bin/gem update --system '3.3.15' -q --no-document
Seems that we need a newer version of rubygems
rubygems 3.3.7
is installed by default in Chef 18
after running gem update --system
to version 3.3.15
it works correctly
Fix is in 3.3.15
I tried 3.3.14
and verified the issue was still there
Not the best workaround though as Chef still thinks its using 3.3.7
(since I assume it's pinned to that version)
irb(main):010:0> Gem.loaded_specs['chef'].rubygems_version
=> "3.3.7"
But embedded shows the updated version
# /opt/chef/embedded/bin/gem -v
3.3.15
Not sure we can update --system
using chef_gem
resource? Was trying to do that to keep them in sync, but no luck. So right now running the command with an execute
resource
Also wasn't sure we can update rubygems without needing to take a new version of ruby, which looks like we would need to take 3.2
to get an updated rubygems as well
Thank you for posting the details with the issue. We will be looking into bumping the version of Ruby to 3.2 for chef/chef in the upcoming year. Closing this for now, please reopen if needed.
Sorry for the delay in responding to this issue, The original issue has since been fixed in the win32_certstore repo. Chef-18 uses 0.6.15 of win32-certstore that contains the fix. Chef-17 is currently in works for getting shaped up for a release, the upcoming release will contain the fix for the issue. We do not have an exact date for the release of Chef-17 yet.
Looking into this - current change to revert the commented builders is in praj/add_amazon_linux_2022. Testing that out internally.
The use of the macos_userdefaults resource is causing failures on the server side when Chef::DataCollector attempts to upload the node object after a successful converge.
This issue is specific to the resource after it was modified to utilize CoreFoundations in #11898 by @rishichawda.
I realize that this is potentially an issue on the Automate side, and I previously opened up this issue on Automate's side before I knew the source of the error. I opened that issue a few months ago and have yet to receive a response. I would really appreciate it if your internal team could reach out to the automate team and try to diagnose the issue, or maybe this is something that can be fixed via modifications to the resource.
This is specific to Chef >= 17.7.22
MacOS Monterey
Use the macos_userdefaults
resource
[2022-07-06T15:13:04-07:00] WARN: Server returned error 500 for https://oe-chef-7x6i.managedautomate.io/organizations/core/data-collector, retrying 1/5 in 3s
[2022-07-06T15:13:07-07:00] WARN: Server returned error 500 for https://oe-chef-7x6i.managedautomate.io/organizations/core/data-collector, retrying 2/5 in 7s
[2022-07-06T15:13:15-07:00] WARN: Server returned error 500 for https://oe-chef-7x6i.managedautomate.io/organizations/core/data-collector, retrying 3/5 in 10s
[2022-07-06T15:13:26-07:00] WARN: Server returned error 500 for https://oe-chef-7x6i.managedautomate.io/organizations/core/data-collector, retrying 4/5 in 27s
[2022-07-06T15:13:53-07:00] WARN: Server returned error 500 for https://oe-chef-7x6i.managedautomate.io/organizations/core/data-collector, retrying 5/5 in 63s
[2022-07-06T15:14:57-07:00] WARN: Error while reporting run start to Data Collector. URL: https://oe-chef-7x6i.managedautomate.io/organizations/core/data-collector Exception: 500 -- 500 "Internal Server Error"
I was able to retrieve the response body of the API call:
rpc error: code = Internal desc = Unable to transform Run message to ChefClientRun: json: cannot unmarshal bool into Go struct field Deprecation.deprecations.message of type string