[Chef Provision] ERROR: Setting `deployment_group` is not configured

Hi,

I run chef provision --no-policy --recipe setup_vagrant_server and got this error.

 write file /etc/chef/client.rb on vagrant-docker
    [vagrant-docker] Starting Chef Client, version 12.12.15

                     ================================================================================
                     Chef encountered an error attempting to load the node data for "vagrant-docker"
                     ================================================================================

                     Unexpected Error:
                     -----------------
                     Chef::PolicyBuilder::Policyfile::ConfigurationError: Setting `deployment_group` is not configured.

                     Platform:
                     ---------
                     x86_64-linux


                     Running handlers:
                     [2016-07-20T11:41:16+00:00] ERROR: Running exception handlers
                     Running handlers complete
                     [2016-07-20T11:41:16+00:00] ERROR: Exception handlers complete
                     Chef Client failed. 0 resources updated in 01 seconds
                     [2016-07-20T11:41:16+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
                     [2016-07-20T11:41:16+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
                     [2016-07-20T11:41:16+00:00] ERROR: Setting `deployment_group` is not configured.
                     [2016-07-20T11:41:16+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

    ================================================================================
    Error executing action `converge` on resource 'machine[vagrant-docker]'
    ================================================================================

    RuntimeError
    ------------
    Error: command 'chef-client -c /etc/chef/client.rb -l auto' exited with code 1.

    Resource Declaration:
    ---------------------
    # In /home/chrisd/atom-sync/chef-provision-ref/provision/recipes/setup_vagrant_server.rb

     59: machine machine_name do
     60:   machine_options ChefHelpers.get_machine_options(node, machine_name)
     61:   chef_config <<-CONF.gsub(/^\s+/, '')
     62:       use_policyfile true
     63:       policy_document_native_api false
     64:       policy_group "local"
     65:       policy_name "vagrant-docker-rc"
     66:   CONF
     67:   converge true
     68: end
     69:

    Compiled Resource:
    ------------------
    # Declared in /home/chrisd/atom-sync/chef-provision-ref/provision/recipes/setup_vagrant_server.rb:59:in `from_file'

    machine("vagrant-docker") do
      action [:converge]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      chef_server {:chef_server_url=>"http://localhost:7788", :options=>{:client_name=>"dummy", :signing_key_filename=>"/home/chrisd/atom-sync/chef-provision-ref/.chef/dummy.pem", :api_version=>"0"}}
      driver "vagrant"
      machine_options {:vagrant_options=>{:"vm.box"=>"bento/centos-7.2"}, :vagrant_config=>"    config.vm.network \"private_network\", ip: \"33.33.33.20\"\n    config.vm.provider 'virtualbox' do |v|\n      v.memory = 2048\n      v.cpus = 2\n    end\n"}
      declared_type :machine
      cookbook_name :provision
      recipe_name "setup_vagrant_server"
      chef_config "use_policyfile true\npolicy_document_native_api false\npolicy_group \"local\"\npolicy_name \"vagrant-docker-rc\"\n"
      converge true
    end

    Platform:
    ---------
    x86_64-linux

Error: Chef failed to converge: machine[vagrant-docker] (provision::setup_vagrant_server line 59) had an error: RuntimeError: Error: command 'chef-client -c /etc/chef/client.rb -l auto' exited with code 1.
Reason: (RuntimeError) machine[vagrant-docker] (provision::setup_vagrant_server line 59) had an error: RuntimeError: Error: command 'chef-client -c /etc/chef/client.rb -l auto' exited with code 1.

I had searched official docs at docs.chef.io but I cannot see where saying about deployment_group.

Hi,

I think I found the reason.

With Chef Zero, we have to specify deployment_group, instead of policy_group and policy_name.

Please feel free to close the thread. Thanks.

This is no longer the case. I cannot tell from your previous posts how you are setting the content of the client.rb on the guest node, but somehow you are getting policy_document_native_api false in there. The default value is now true so you can just remove that line, or else you can explicitly set it to true

Hi,

I had checked the Release log of Chef Zero, it does not mention explicitly to support policy_document_native_api natively.
I get little frustrated when some commands with Policyfile which does not work correctly with Chef Zero, like chef show-policy which return nothing.
It would be better that the documentation is more about how policy_document_native_api work in true and false mode.

I followed the original Provision flow from this Chef Cookbook chef-reference, I set policy_document_native_api to false, during Copy & Paste, I messed up the config :sweat_smile:.

I wish if Chef Zero has some documentation regarding the support for Policyfile, so user can be confident to use Chef Zero with Policyfile.

If you know some place that I can get the information, I would be grateful.

thanks @kallistec, I’ve tried chef export to use chef-client local mode. It’s awesome :grinning:. Seems like policy_document_native_api can be true for Chef Client newer than 12.7.