Jira (PUP-10215) Suppress backtraces from Ruby Support Script validation errors

3 views
Skip to first unread message

Charlie Sharpsteen (JIRA)

unread,
Jan 3, 2020, 2:12:03 PM1/3/20
to puppe...@googlegroups.com

Charlie Sharpsteen (JIRA)

unread,
Jan 3, 2020, 2:12:05 PM1/3/20
to puppe...@googlegroups.com
Charlie Sharpsteen created an issue
 
Puppet / Improvement PUP-10215
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: Support Script
Created: 2020/01/03 11:11 AM
Priority: Normal Normal
Reporter: Charlie Sharpsteen

Currently, an incompatible selection of options passed to the Ruby support script results in a scary-looking backtrace following the error message:

# puppet enterprise support --v3 --upload
ERROR: RuntimeError raised when validating settings: The upload option requires a value to be specified for the ticket setting.
	/opt/puppetlabs/puppet/modules/pe_support_script/lib/puppet_x/puppetlabs/support_script/v3/puppet-enterprise-support.rb:351:in `validate'
	/opt/puppetlabs/puppet/modules/pe_support_script/lib/puppet_x/puppetlabs/support_script/v3/puppet-enterprise-support.rb:2650:in `setup'
	/opt/puppetlabs/puppet/modules/pe_support_script/lib/puppet_x/puppetlabs/support_script/v3/puppet-enterprise-support.rb:2695:in `run'
	/opt/puppetlabs/puppet/modules/pe_support_script/lib/puppet/face/enterprise/support.rb:185:in `block (3 levels) in <top (required)>'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/interface/action.rb+eval[wrapper]:264:in `support'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/face_base.rb:247:in `main'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:383:in `run_command'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:667:in `exit_on_fail'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:139:in `run'
	/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
	/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

The settings validation logic is extremely centralized in the Runner#validate method, so the stack trace provides little value and makes the error message harder to interpret.

The script should just print the error message to the console:

# puppet enterprise support --v3 --upload
ERROR: RuntimeError raised when validating settings: The upload option requires a value to be specified for the ticket setting.

Reply all
Reply to author
Forward
0 new messages