{"record":{"id":"c882e290cbf1d33e","repo":"puppetlabs/puppet","slug":"invalid-csr-attributes-expected-instance-of-hash","errorCode":null,"errorMessage":"invalid CSR attributes, expected instance of Hash, received instance of %{klass}","messagePattern":"invalid CSR attributes, expected instance of Hash, received instance of %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/ssl/certificate_request_attributes.rb","lineNumber":27,"sourceCode":"# @api private\nclass Puppet::SSL::CertificateRequestAttributes\n  attr_reader :path, :custom_attributes, :extension_requests\n\n  def initialize(path)\n    @path = path\n    @custom_attributes = {}\n    @extension_requests = {}\n  end\n\n  # Attempt to load a yaml file at the given @path.\n  # @return true if we are able to load the file, false otherwise\n  # @raise [Puppet::Error] if there are unexpected attribute keys\n  def load\n    Puppet.info(_(\"csr_attributes file loading from %{path}\") % { path: path })\n    if Puppet::FileSystem.exist?(path)\n      hash = Puppet::Util::Yaml.safe_load_file(path, [Symbol]) || {}\n      unless hash.is_a?(Hash)\n        raise Puppet::Error, _(\"invalid CSR attributes, expected instance of Hash, received instance of %{klass}\") % { klass: hash.class }\n      end\n\n      @custom_attributes = hash.delete('custom_attributes') || {}\n      @extension_requests = hash.delete('extension_requests') || {}\n      unless hash.keys.empty?\n        raise Puppet::Error, _(\"unexpected attributes %{keys} in %{path}\") % { keys: hash.keys.inspect, path: @path.inspect }\n      end\n\n      return true\n    end\n    false\n  end\nend\n","sourceCodeStart":9,"sourceCodeEnd":41,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/certificate_request_attributes.rb#L9-L41","documentation":"Error \"invalid CSR attributes, expected instance of Hash, received instance of %{klass}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/ssl/certificate_request_attributes.rb:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}