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

PolicyBuilder complains about run_list being set in JSON data even though run_list is not set. #9155

Open
NAshwini opened this issue Dec 11, 2019 · 0 comments

Comments

@NAshwini
Copy link
Contributor

@NAshwini NAshwini commented Dec 11, 2019

Reoccurence #3557

Description

When bootstrapping a node using the -j or --json-attribute-file options to pass JSON containing policy_name and policy_group definitions but no run_list definition, Chef::PolicyBuilder::Policyfile complains that setting the run_list in JSON data is unsupported.
This internally set a empty runlist in first-boot attribute which leads to above issue.

Chef Version

14.14.29

Platform Version

Ubuntu18

Replication Case

Create a json file with value as { "policy_group": "azuregrp", "policy_name": "azurepolicy" }
Try to bootstrap a fresh node by command knife bootstrap <IP-Address> -x "azure" -P "<PASSWORD>" --json-attribute-file /etc/chef/bootattr.json -c "/etc/chef/knife.rb" --sudo

Client Output

Unexpected Error:
 Chef::PolicyBuilder::Policyfile::UnsupportedFeature: Policyfile does not support setting the run_list in json data.

Stacktrace

Generated at 2019-12-11 09:43:06 +0000
Chef::PolicyBuilder::Policyfile::UnsupportedFeature: Policyfile does not support setting the run_list in json data.
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/policy_builder/policyfile.rb:107:in `initialize'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/policy_builder/dynamic.rb:155:in `new'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/policy_builder/dynamic.rb:155:in `select_implementation'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/policy_builder/dynamic.rb:74:in `load_node'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/client.rb:472:in `load_node'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/client.rb:267:in `run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/application.rb:303:in `run_with_graceful_exit_option'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/application.rb:279:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/application.rb:261:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/application/client.rb:449:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/lib/chef/application.rb:66:in `run'
/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.14.29/bin/chef-client:25:in `<top (required)>'
/usr/bin/chef-client:81:in `load'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.