{"record":{"id":"f5289957fec0f306","repo":"puppetlabs/puppet","slug":"in-attr-expected-extension-record-index-to","errorCode":null,"errorMessage":"In %{attr}, expected extension record %{index} to have two or three items, but found %{count}","messagePattern":"In %(.+?), expected extension record %(.+?) to have two or three items, but found %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/ssl/certificate_request.rb","lineNumber":168,"sourceCode":"\n    index = -1\n    extensions.map do |ext_values|\n      index += 1\n\n      value = ext_value_to_ruby_value(ext_values)\n\n      # OK, turn that into an extension, to unpack the content.  Lovely that\n      # we have to swap the order of arguments to the underlying method, or\n      # perhaps that the ASN.1 representation chose to pack them in a\n      # strange order where the optional component comes *earlier* than the\n      # fixed component in the sequence.\n      case ext_values.length\n      when 2\n        { \"oid\" => ext_values[0].value, \"value\" => value }\n      when 3\n        { \"oid\" => ext_values[0].value, \"value\" => value, \"critical\" => ext_values[1].value }\n      else\n        raise Puppet::Error, _(\"In %{attr}, expected extension record %{index} to have two or three items, but found %{count}\") % { attr: attribute.oid, index: index, count: ext_values.length }\n      end\n    end\n  end\n\n  def subject_alt_names\n    @subject_alt_names ||= request_extensions\n                           .select { |x| x[\"oid\"] == \"subjectAltName\" }\n                           .map { |x| x[\"value\"].split(/\\s*,\\s*/) }\n                           .flatten\n                           .sort\n                           .uniq\n  end\n\n  # Return all user specified attributes attached to this CSR as a hash. IF an\n  # OID has a single value it is returned as a string, otherwise all values are\n  # returned as an array.\n  #\n  # The format of CSR attributes is specified in PKCS#10/RFC 2986","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/ssl/certificate_request.rb#L150-L186","documentation":"Error \"In %{attr}, expected extension record %{index} to have two or three items, but found %{count}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/ssl/certificate_request.rb:168 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"}