{"record":{"id":"2e5f31133b32d59c","repo":"ruby/rubygems","slug":"key-file-does-not-exist","errorCode":null,"errorMessage":"#{key_file}: does not exist","messagePattern":"#(.+?): does not exist","errorType":"exception","errorClass":"Gem::OptionParser::InvalidArgument","httpStatus":null,"severity":"error","filePath":"lib/rubygems/commands/cert_command.rb","lineNumber":101,"sourceCode":"  end\n\n  def open_cert(certificate_file)\n    check_openssl\n    OpenSSL::X509::Certificate.new File.read certificate_file\n  rescue Errno::ENOENT\n    raise Gem::OptionParser::InvalidArgument, \"#{certificate_file}: does not exist\"\n  rescue OpenSSL::X509::CertificateError\n    raise Gem::OptionParser::InvalidArgument,\n      \"#{certificate_file}: invalid X509 certificate\"\n  end\n\n  def open_private_key(key_file)\n    check_openssl\n    passphrase = ENV[\"GEM_PRIVATE_KEY_PASSPHRASE\"]\n    key = OpenSSL::PKey.read File.read(key_file), passphrase\n    key\n  rescue Errno::ENOENT\n    raise Gem::OptionParser::InvalidArgument, \"#{key_file}: does not exist\"\n  rescue OpenSSL::PKey::PKeyError, ArgumentError\n    raise Gem::OptionParser::InvalidArgument, \"#{key_file}: invalid RSA, DSA, or EC key\"\n  end\n\n  def execute\n    check_openssl\n\n    options[:add].each do |certificate|\n      add_certificate certificate\n    end\n\n    options[:remove].each do |filter|\n      remove_certificates_matching filter\n    end\n\n    options[:list].each do |filter|\n      list_certificates_matching filter\n    end","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/commands/cert_command.rb#L83-L119","documentation":"Error \"#{key_file}: does not exist\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/commands/cert_command.rb:101 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":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}