Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5502

lookup adapter "lookup_global" produces bad error message for faulty hiera.yaml

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.3.2
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-12-16
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      When the hiera.yaml file is not correct, lookup error messages are improved. The error message now more concise and includes the name of the key, the location of the broken hiera.yaml file and the location in hiera.yaml where the evaluation failed.

      Description

      When there is something wrong with the yaml syntax in a hiera.yaml the error message produced by the logic in lookup_adapter.lookup_global is not very helpful. It shows the error message twice, the reference to the faulty file says <unknown>, and the stack trace that is produced is for the location in the lookup_adapter, not where the error occurred.

      To trigger the error use a hiera yaml with a hierachy like this:

      :hierarchy:
        - %{boom}
      

      (error is that there should be quotes around the entry)

      The error can look like this:

      Error: Could not run: Error from DataBinding 'hiera' while looking up 'lookup_options': (<unknown>): found character that cannot start any token while scanning for the next token at line 3 column 11 in (<unknown>): found character that cannot start any token while scanning for the next token at line 3 column 11
      

      I think this is of importance to fix since it provides no clue to the user where the error may be.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                henrik.lindberg Henrik Lindberg
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support