Skip to content

Instantly share code, notes, and snippets.

@tyler-ball
Created August 13, 2015 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyler-ball/a9cbed07a9a8cbcbb19a to your computer and use it in GitHub Desktop.
Save tyler-ball/a9cbed07a9a8cbcbb19a to your computer and use it in GitHub Desktop.
chef provisioning output when running a failing audit recipe on provisioned node

recipe:

control_group "group" do
  control "foo" do
    it "should fail" do
      expect(1).to eq(2)
    end
  end
end

output:

[test-provisioning]$ bundle exec chef-client -z -o 'recipe[test-provisioning::test]'                                                                      *[master][ruby-2.1.6@cookbook-test-provisioning]
Starting Chef Client, version 12.4.1
[2015-08-12T15:29:45-06:00] WARN: Run List override has been provided.
[2015-08-12T15:29:45-06:00] WARN: Original Run List: []
[2015-08-12T15:29:45-06:00] WARN: Overridden Run List: [recipe[test-provisioning::test]]
resolving cookbooks for run list: ["test-provisioning::test"]
Synchronizing Cookbooks:
  - test-provisioning
Compiling Cookbooks...
[2015-08-12T15:29:45-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:45-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:45-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:45-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
[2015-08-12T15:29:47-06:00] WARN: Resource.dsl_name is deprecated and will be removed in Chef 13.  Use resource_name instead.
Converging 3 resources
Recipe: test-provisioning::test
  * aws_key_pair[ref-key-pair] action create[2015-08-12T15:29:47-06:00] WARN: Class Chef::Provider::AwsKeyPair does not declare 'resource_name :aws_key_pair'.
[2015-08-12T15:29:47-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.
[2015-08-12T15:29:48-06:00] WARN: Class Chef::Provider::PrivateKey does not declare 'resource_name :private_key'.
[2015-08-12T15:29:48-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.
 (up to date)
  * machine[footyler] action converge[2015-08-12T15:29:48-06:00] WARN: Class Chef::Provider::Machine does not declare 'resource_name :machine'.
[2015-08-12T15:29:48-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.
[2015-08-12T15:29:49-06:00] WARN: Class Chef::Provider::ChefNode does not declare 'resource_name :chef_node'.
[2015-08-12T15:29:49-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.
[2015-08-12T15:29:53-06:00] WARN: Class Chef::Provider::ChefNode does not declare 'resource_name :chef_node'.
[2015-08-12T15:29:53-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.
[2015-08-12T15:29:55-06:00] WARN: Class Chef::Provider::ChefClient does not declare 'resource_name :chef_client'.
[2015-08-12T15:29:55-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.
[2015-08-12T15:29:55-06:00] WARN: Class Chef::Provider::ChefNode does not declare 'resource_name :chef_node'.
[2015-08-12T15:29:55-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.

    - write file /etc/chef/client.rb on footyler
    - run 'sh -c /tmp/chef-install.sh' on footyler[2015-08-12T15:29:57-06:00] WARN: Class Chef::Provider::ChefNode does not declare 'resource_name :chef_node'.
[2015-08-12T15:29:57-06:00] WARN: This will no longer work in Chef 13: you must use 'resource_name' to provide DSL.

    [footyler] Starting Chef Client, version 12.4.1
               resolving cookbooks for run list: ["test-provisioning::audit"]
               Synchronizing Cookbooks:
                 - test-provisioning
               Compiling Cookbooks...
               Converging 0 resources
               Starting audit phase

               group
                 foo
                   should fail (FAILED - 1)

               Failures:

                 1) group foo should fail
                    Failure/Error: expect(1).to eq(2)

                      expected: 2
                           got: 1

                      (compared using ==)
                    # /var/chef/cache/cookbooks/test-provisioning/recipes/audit.rb:4:in `block (3 levels) in from_file'

               Finished in 0.00289 seconds (files took 0.28069 seconds to load)
               1 example, 1 failure

               Failed examples:

               rspec  # group foo should fail

               Audit phase exception:
                 Audit phase found failures - 1/1 controls failed

                 Running handlers:
                 Running handlers complete
                 Chef Client finished, 0/0 resources updated in 2.383209425 seconds
                   0/1 controls succeeded
               [2015-08-12T21:30:01+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
               [2015-08-12T21:30:01+00:00] ERROR: Found 1 errors, they are stored in the backtrace
               [2015-08-12T21:30:01+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

    ================================================================================
    Error executing action `converge` on resource 'machine[footyler]'
    ================================================================================

    RuntimeError
    ------------
    Error: command 'chef-client -l auto' exited with code 1.

    Resource Declaration:
    ---------------------
    # In /Users/tball/chef_repo/cookbooks/test-provisioning/.chef/local-mode-cache/cache/cookbooks/test-provisioning/recipes/test.rb

     25: machine 'footyler' do
     26:   action :converge
     27:   run_list ['recipe[test-provisioning::audit]']
     28:   chef_config "audit_mode :enabled"
     29: end
     30:

    Compiled Resource:
    ------------------
    # Declared in /Users/tball/chef_repo/cookbooks/test-provisioning/.chef/local-mode-cache/cache/cookbooks/test-provisioning/recipes/test.rb:25:in `from_file'

    machine("footyler") do
      action [:converge]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      chef_server {:chef_server_url=>"chefzero://localhost:8889", :options=>{:client_name=>"remball01.local", :signing_key_filename=>nil, :api_version=>"0"}}
      driver "aws::us-east-1"
      machine_options {:bootstrap_options=>{:key_name=>"ref-key-pair", :instance_type=>"t2.medium", :image_id=>"ami-96a818fe", :security_group_ids=>["sg-d0d44fb5"]}, :ssh_username=>"centos", :convergence_options=>{:chef_version=>"12.4.1"}}
      declared_type :machine
      cookbook_name "test-provisioning"
      recipe_name "test"
      run_list ["recipe[test-provisioning::audit]"]
      chef_config "audit_mode :enabled"
    end

Starting audit phase

Finished in 0.00025 seconds (files took 0.24802 seconds to load)
0 examples, 0 failures
Auditing complete

Running handlers:
[2015-08-12T15:30:01-06:00] ERROR: Running exception handlers
Running handlers complete
[2015-08-12T15:30:01-06:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 19.600841 seconds
[2015-08-12T15:30:01-06:00] FATAL: Stacktrace dumped to /Users/tball/chef_repo/cookbooks/test-provisioning/.chef/local-mode-cache/cache/chef-stacktrace.out
[2015-08-12T15:30:01-06:00] ERROR: Found 1 errors, they are stored in the backtrace
[2015-08-12T15:30:01-06:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment