Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Data Collector fails to report exception thrown during run_list expansion #8157
Manually inserting a raise into Chef::PolicyBuilder::ExpandNodeObject#expand_run_list results in the chef-client run failing with no output to the data_collector (no start message, no end message)
This is because while the data collector hooks the run_list_expand_failed() event, the exception is thrown before run_started() is called (so no start message) and run_status is nil because the run_started() hook needs to be called and there is code which bypasses send_run_completion() if run_status is nil.
It looks like the original design was to capture the run_list_expand_failed() events but then when they blew up the completion message it was patched to avoid sending any data at all, which feels pretty wrong and buggy.
The cookbook_sync_failed() and cookbook_resolution_failed() events work correctly.
It seems the DC always inserts a blank line in the output file before the output of the last run, not sure if that was intentional or not, seems weird. The json in here isn't remotely human readable.