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

Data Collector fails to report exception thrown during run_list expansion #8157

Open
lamont-granquist opened this Issue Jan 23, 2019 · 2 comments

Comments

Projects
None yet
1 participant
@lamont-granquist
Copy link
Contributor

lamont-granquist commented Jan 23, 2019

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.

@lamont-granquist

This comment has been minimized.

Copy link
Contributor Author

lamont-granquist commented Jan 23, 2019

Also when directed at a file the data_collector leaves a file with a single LF in it, and appends a single LF for every failed run in this case.

@lamont-granquist

This comment has been minimized.

Copy link
Contributor Author

lamont-granquist commented Jan 23, 2019

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.

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