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

Chef-client not outputting proper exit codes in fork mode. #8332

Open
brywilliamsCF opened this Issue Apr 1, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@brywilliamsCF
Copy link

brywilliamsCF commented Apr 1, 2019

Description

In cases where a reboot has been scheduled I receive exit code ‘35’ with --no-fork but exit code ‘1’ without specifying --no-fork.

In the documentation for client.rb about client_fork it says “Must be set to false up to Chef Client 13.11.3 to gather the standard return code offered by exit_status true. Chef Client 14.x behaves as expected, with no changes to the Chef Client configuration file necessary.”

Chef Version

14.11.21

Platform Version

CentOS 7.6

Replication Case

Use the 'reboot' resource in a cookbook.
Run chef-client which will output FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 35) but the actual exit code will be 1.
Run chef-client --no-fork and the exit code will be 35.

Client Output

# sudo /usr/bin/chef-client --force-formatter --override-runlist yum_update
Starting Chef Client, version 14.11.21
[2019-03-29T13:21:57-05:00] WARN: Data collector token authentication is not recommended for client-server modePlease upgrade Chef Server to 12.11.0 and remove the token from your config file to use key based authentication instead
[2019-03-29T13:21:57-05:00] WARN: Run List override has been provided.
[2019-03-29T13:21:57-05:00] WARN: Original Run List: 

[redacted]

  * reboot[reboot_after_yum_update] action request_reboot[2019-03-29T13:23:17-05:00] WARN: Reboot requested:'reboot_after_yum_update'

    - request a system reboot to occur if the run succeeds
[2019-03-29T13:23:17-05:00] WARN: Skipping final node save because override_runlist was given

Running handlers:
Running handlers complete
Chef Client finished, 3/9 resources updated in 01 minutes 25 seconds
[2019-03-29T13:23:17-05:00] WARN: Rebooting server at a recipe's request. Details: {:delay_mins=>2, :reason=>"Reboot after patching", :timestamp=>2019-03-29 13:23:17 -0500, :requested_by=>"reboot_after_yum_update"}

Running handlers:
[2019-03-29T13:23:17-05:00] ERROR: Running exception handlers
Running handlers complete
[2019-03-29T13:23:17-05:00] ERROR: Exception handlers complete
Chef Client failed. 3 resources updated in 01 minutes 25 seconds

[redacted]

Reboot after patching
The system is going down for reboot at Fri 2019-03-29 13:25:17 CDT!

[2019-03-29T13:23:17-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2019-03-29T13:23:17-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-03-29T13:23:17-05:00] ERROR: Rebooting server at a recipe's request. Details: {:delay_mins=>2, :reason=>"Reboot after patching", :timestamp=>2019-03-29 13:23:17 -0500, :requested_by=>"reboot_after_yum_update"}
[2019-03-29T13:23:17-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 35)

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