{"record":{"id":"b91189da0267338a","repo":"puppetlabs/puppet","slug":"unrecognized-value-for-request-merge-parameter","errorCode":null,"errorMessage":"Unrecognized value for request 'merge' parameter: '%{merge}'","messagePattern":"Unrecognized value for request 'merge' parameter: '%(.+?)'","errorType":"validation","errorClass":"Puppet::DataBinding::LookupError","httpStatus":null,"severity":"error","filePath":"lib/puppet/indirector/hiera.rb","lineNumber":74,"sourceCode":"      # Equivalent to Hiera :hash with default :native merge behavior. A Hash must be passed here\n      # to override possible Hiera deep merge config settings.\n      { :behavior => :native }\n    when 'deep'\n      # Equivalent to Hiera :hash with :deeper merge behavior.\n      { :behavior => :deeper }\n    when Hash\n      strategy = merge['strategy']\n      if strategy == 'deep'\n        result = { :behavior => :deeper }\n        # Remaining entries must have symbolic keys\n        merge.each_pair { |k, v| result[k.to_sym] = v unless k == 'strategy' }\n        result\n      else\n        convert_merge(strategy)\n      end\n    else\n      # TRANSLATORS \"merge\" is a parameter name and should not be translated\n      raise Puppet::DataBinding::LookupError, _(\"Unrecognized value for request 'merge' parameter: '%{merge}'\") % { merge: merge }\n    end\n  end\n\n  public\n\n  def self.hiera_config\n    hiera_config = Puppet.settings[:hiera_config]\n    config = {}\n\n    if Puppet::FileSystem.exist?(hiera_config)\n      config = Hiera::Config.load(hiera_config)\n    else\n      Puppet.warning _(\"Config file %{hiera_config} not found, using Hiera defaults\") % { hiera_config: hiera_config }\n    end\n\n    config[:logger] = 'puppet'\n    config\n  end","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/indirector/hiera.rb#L56-L92","documentation":"The (deprecated) Hiera data-binding terminus converts the lookup 'merge' option into a Hiera resolution type via convert_merge. Accepted values: nil or 'first', a Puppet::Pops::MergeStrategy object, 'unique', 'hash', 'deep', or a Hash whose 'strategy' key is one of those strings. Anything else - true, false as a non-nil boolean true, symbols like :deep, or unknown strings - raises Puppet::DataBinding::LookupError.","triggerScenarios":"Calling the hiera data binding terminus with options[:merge] of an unsupported type: merge: true, merge: :unique, merge: 'array', or a Hash whose 'strategy' is an unrecognized value that recurses into the else branch.","commonSituations":"Tooling that passes booleans for deep merge (hiera 3 CLI habits); symbolized YAML keys producing Hashes without a usable 'strategy'; code written against the modern lookup() API reused against this terminus.","solutions":["Pass one of the strings 'first', 'unique', 'hash', 'deep', or nil, as the merge value.","For deep merge options pass a Hash with string keys: { 'strategy' => 'deep', 'merge_hash_arrays' => true }.","Use Puppet::Pops::MergeStrategy objects when integrating with the modern lookup API.","Migrate off this terminus (the class is deprecated): use the lookup() function or Puppet::DataBinding.indirection.terminus(:hiera)."],"exampleFix":"# before\nPuppet::DataBinding.indirection.find(key, nil,\n  variables: scope, merge: :deep)\n# LookupError: Unrecognized value for request 'merge' parameter: ':deep'\n\n# after\nPuppet::DataBinding.indirection.find(key, nil,\n  variables: scope, merge: { 'strategy' => 'deep' })","handlingStrategy":"type-guard","validationCode":"raise ArgumentError, 'unsupported merge value' unless valid_merge?(merge)\noptions = { variables: scope, merge: merge }","typeGuard":"MERGE_WORDS = %w[first unique hash deep].freeze\n\ndef valid_merge?(value)\n  value.nil? ||\n    (value.is_a?(String) && MERGE_WORDS.include?(value)) ||\n    value.is_a?(Puppet::Pops::MergeStrategy) ||\n    (value.is_a?(Hash) && (value['strategy'].nil? || MERGE_WORDS.include?(value['strategy'])))\nend","tryCatchPattern":null,"preventionTips":["Always use string keys in merge hashes; YAML symbol keys silently bypass strategy handling.","Booleans are not merge values in this API; use nil or 'first'.","Prefer the supported lookup() function over the deprecated Hiera terminus."],"tags":["puppet","hiera","lookup","parameter-validation","deprecated-api"],"backgroundTag":"invalid-parameter-value","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}