puppetlabs/puppet · error · ArgumentError

An URI can only be merged with an URI or String

Error message

An URI can only be merged with an URI or String

What it means

Error "An URI can only be merged with an URI or String" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/pops/evaluator/evaluator_impl.rb:1239

          when Array
            # Hash[[a, 1, b, 2]] => {}
            # Hash[a,1,b,2] => {a => 1, b => 2}
            # Hash[[a,1], [b,2]] => {[a,1] => [b,2]}
            # Hash[[[a,1], [b,2]]] => {a => 1, b => 2}
            # Use type calculator to determine if array is Array[Array[?]], and if so use second form
            # of call
            t = @@type_calculator.infer(y)
            if t.element_type.is_a? Types::PArrayType
              y.to_h
            else
              Hash[*y]
            end
          else
            raise ArgumentError, _('Can only append Array or Hash to a Hash')
          end
      x.merge y # new hash with overwrite
    when URI
      raise ArgumentError, _('An URI can only be merged with an URI or String') unless y.is_a?(String) || y.is_a?(URI)

      x + y
    when Types::PBinaryType::Binary
      raise ArgumentError, _('Can only append Binary to a Binary') unless y.is_a?(Types::PBinaryType::Binary)

      Types::PBinaryType::Binary.from_binary_string(x.binary_buffer + y.binary_buffer)
    else
      concatenate([x], y)
    end
  end

  # Produces the result x \ y (set difference)
  # When `x` is an Array, `y` is transformed to an array and then all matching elements removed from x.
  # When `x` is a Hash, all contained keys are removed from x as listed in `y` if it is an Array, or all its keys if it is a Hash.
  # The difference is returned. The given `x` and `y` are not modified by this operation.
  # @raise [ArgumentError] when `x` is neither an Array nor a Hash
  #
  def delete(x, y)

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/pops/evaluator/evaluator_impl.rb:1239 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/363d092e93cb037b. Report an issue: GitHub.