[PUP-6425] Regression: puppet help errors out if any application raises while generating help Created: 2016/06/21  Updated: 2016/08/11  Resolved: 2016/07/14

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 4.6.0

Type: Bug Priority: Normal
Reporter: Josh Cooper Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relates to PUP-3521 puppet incorrectly swallows some errors Closed
Story Points: 1
Sprint: Client 2016-07-27
Release Notes: Bug Fix
Release Notes Summary: fix a regression from commit eccd3b which modified puppet to not swallow errors silently, but it caused a regression when a puppet sub-application raises an error


PUP-3521 (commit eccd3b modified puppet to not swallow errors silently, but it causes a regression because the result variable is not in scope. To reproduce, modify an app in lib/puppet/application/*.rb to raise an ArgumentError in its help method, then run:

bundle exec puppet help
Error: undefined local variable or method `result' for #<Puppet::Interface:0x007fab1b563218>

The problem line is:

    rescue StandardError
      result << [ "! #{appname}", "! Subcommand unavailable due to error. Check error logs." ]

Although the reproduction steps are contrived, I ran into this problem when I had an application in a module and the application called Puppet.settings.initialize_settings twice, which causes puppet to raise an exception.

Comment by Josh Cooper [ 2016/06/21 ]

ping Chris Price, relating to previous puppetserver ticket.

Comment by Eric Thompson [ 2016/07/14 ]

validated on ubuntu1604 at puppet-agent master SHA: 8ae9f84f8da7abe37d4c68f816677306814b164c

root@u4w9tscddf5tsxe:~# vi /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/inspect.rb
root@u4w9tscddf5tsxe:~# puppet help
Usage: puppet <subcommand> [options] <action> [options]
Available subcommands:
  agent             The puppet agent daemon
  apply             Apply Puppet manifests locally
  ca                Local Puppet Certificate Authority management.
  catalog           Compile, save, view, and convert catalogs.
  cert              Manage certificates and requests
  certificate       Provide access to the CA for certificate management.
  certificate_request  Manage certificate requests.
  certificate_revocation_list  Manage the list of revoked certificates.
  config            Interact with Puppet's settings.
  describe          Display help about resource types
  device            Manage remote network devices
  doc               Generate Puppet references
  epp               Interact directly with the EPP template parser/renderer.
  facts             Retrieve and store facts.
  file              Retrieve and store files in a filebucket
  filebucket        Store and retrieve files in a filebucket
  help              Display Puppet help.
  inspect           ! Subcommand unavailable due to error. Check error logs.
  key               Create, save, and remove certificate keys.

Generated at Mon Jan 20 07:05:46 PST 2020 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.