Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-1690

CLI subcommands produce confusing failures when puppetserver config corrupted

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: SERVER 5.0.0
    • Component/s: None
    • Labels:
    • Template:
    • Team:
      Systems Engineering
    • Story Points:
      1
    • Sprint:
      SE 2016-12-14
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      When puppetserver CLI commands were invoked they did not account for errors raised when loading and validating the puppetserver config. Because of this if an invalid configuration was present and a CLI subcommand was run, the subcommand would crash with an unhelpful error message unrelated to the actual config validation failure. This has been fixed so that errors with an unexpected format, such as errors generated while validating the config, are propagated up the stack without modification.
      Show
      When puppetserver CLI commands were invoked they did not account for errors raised when loading and validating the puppetserver config. Because of this if an invalid configuration was present and a CLI subcommand was run, the subcommand would crash with an unhelpful error message unrelated to the actual config validation failure. This has been fixed so that errors with an unexpected format, such as errors generated while validating the config, are propagated up the stack without modification.
    • QA Risk Assessment:
      Needs Assessment

      Description

      When one of the CLI subcommands is run and a puppetserver config file which has content that violates a schema is parsed, the resulting failure shown on the command line does not give any indication of what the real error is.

      For example, I ran the following steps in Puppet Server at the 2.7.1 tag, from source:

      1) Set the following bogus variable value in the ./dev/puppetserver.conf file:

      jruby-puppet: {
        ...
        master-conf-dir: 0
        ...
      }
      

      2) Ran the gem subcommand as follows:

      lein gem env
      

      Expected Result:

      An error message indicating something about the corrupt master-conf-dir variable value.

      Actual Result:

      Exception in thread "main" java.lang.AssertionError: Assert failed: (keyword? kw), compiling:(/private/var/folders/y5/24bhmms53nv2b4g8gyq6tl340000gn/T/form-init6633389292647995039.clj:1:125)
      	at clojure.lang.Compiler.load(Compiler.java:7391)
      	at clojure.lang.Compiler.loadFile(Compiler.java:7317)
      	at clojure.main$load_script.invokeStatic(main.clj:275)
      	at clojure.main$init_opt.invokeStatic(main.clj:277)
      	at clojure.main$init_opt.invoke(main.clj:277)
      	at clojure.main$initialize.invokeStatic(main.clj:308)
      	at clojure.main$null_opt.invokeStatic(main.clj:342)
      	at clojure.main$null_opt.invoke(main.clj:339)
      	at clojure.main$main.invokeStatic(main.clj:421)
      	at clojure.main$main.doInvoke(main.clj:384)
      	at clojure.lang.RestFn.invoke(RestFn.java:421)
      	at clojure.lang.Var.invoke(Var.java:383)
      	at clojure.lang.AFn.applyToHelper(AFn.java:156)
      	at clojure.lang.Var.applyTo(Var.java:700)
      	at clojure.main.main(main.java:37)
      Caused by: java.lang.AssertionError: Assert failed: (keyword? kw)
      	at puppetlabs.kitchensink.core$without_ns.invokeStatic(core.clj:572)
      	at puppetlabs.kitchensink.core$without_ns.invoke(core.clj:572)
      	at puppetlabs.puppetserver.cli.subcommand$run.invokeStatic(subcommand.clj:40)
      	at puppetlabs.puppetserver.cli.subcommand$run.invoke(subcommand.clj:26)
      	at puppetlabs.puppetserver.cli.gem$_main.invokeStatic(gem.clj:13)
      	at puppetlabs.puppetserver.cli.gem$_main.doInvoke(gem.clj:11)
      	at clojure.lang.RestFn.invoke(RestFn.java:457)
      	at clojure.lang.Var.invoke(Var.java:394)
      	at user$eval5.invokeStatic(form-init6633389292647995039.clj:1)
      	at user$eval5.invoke(form-init6633389292647995039.clj:1)
      	at clojure.lang.Compiler.eval(Compiler.java:6927)
      	at clojure.lang.Compiler.eval(Compiler.java:6917)
      	at clojure.lang.Compiler.load(Compiler.java:7379)
      	... 14 more
      

        Attachments

          Activity

            People

            • Assignee:
              jeremy.barlow Jeremy Barlow
              Reporter:
              jeremy.barlow Jeremy Barlow
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support