puppetlabs/puppet · error · Puppet::Error

unexpected attributes %{keys} in %{path}

Error message

unexpected attributes %{keys} in %{path}

What it means

Error "unexpected attributes %{keys} in %{path}" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/ssl/certificate_request_attributes.rb:33

    @custom_attributes = {}
    @extension_requests = {}
  end

  # Attempt to load a yaml file at the given @path.
  # @return true if we are able to load the file, false otherwise
  # @raise [Puppet::Error] if there are unexpected attribute keys
  def load
    Puppet.info(_("csr_attributes file loading from %{path}") % { path: path })
    if Puppet::FileSystem.exist?(path)
      hash = Puppet::Util::Yaml.safe_load_file(path, [Symbol]) || {}
      unless hash.is_a?(Hash)
        raise Puppet::Error, _("invalid CSR attributes, expected instance of Hash, received instance of %{klass}") % { klass: hash.class }
      end

      @custom_attributes = hash.delete('custom_attributes') || {}
      @extension_requests = hash.delete('extension_requests') || {}
      unless hash.keys.empty?
        raise Puppet::Error, _("unexpected attributes %{keys} in %{path}") % { keys: hash.keys.inspect, path: @path.inspect }
      end

      return true
    end
    false
  end
end

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/ssl/certificate_request_attributes.rb:33 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/7e4f7b1f293a525b. Report an issue: GitHub.