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

Automatic parameter lookup expects Array/Hash instead of String with deeper merging

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.0
    • Fix Version/s: PUP 4.9.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Ubuntu 16.04

    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-02-08
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      A regression was introduced in Hiera 5 which caused problems when the default merge was specified in a hiera.yaml. The regression was that the merge logic refused to merge mismatched types, or non array and hash values. Now the behavior of hiera 3 is also the behavior of hiera 5 such that a merge of non mergeable values uses priority based selection.
      Show
      A regression was introduced in Hiera 5 which caused problems when the default merge was specified in a hiera.yaml. The regression was that the merge logic refused to merge mismatched types, or non array and hash values. Now the behavior of hiera 3 is also the behavior of hiera 5 such that a merge of non mergeable values uses priority based selection.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests

      Description

      Automatic parameter lookup stopped working after updating Puppet Server. Now I get:

      Info: Using configured environment 'local'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Warning: Found multiple default providers for service: debian, runit; using debian
      Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'zabbix::server' failed: The first element of the merge has wrong type, expects a value of type Array or Hash, got String in The first element of the merge has wrong type, expects a value of type Array or Hash, got String at /etc/puppetlabs/code/environments/local/site.pp:1:1 on node puppet2.example.net
      Warning: Not using cache on failed catalog
      Error: Could not retrieve catalog; skipping run
      

      In my Hiera hierarchy, I have set 'zabbix::server' to string in 2 layers. It should pick only one string. Instead, it tries to merge it as a hash and fails.

      hiera.yaml: http://pastebin.com/raw/N8NCTG6i
      puppet.conf: http://pastebin.com/raw/iuEN99na
      zabbix/manifests/init.pp: http://pastebin.com/raw/D5dA4T0t
      'zabbix::server' lines in hiera datadir: http://pastebin.com/raw/ri5fUtGa
      the error and site.pp: http://pastebin.com/raw/24F3YhZa

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ernetas Ernestas Lukoševičius
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support