ruby/rubygems · error · Gem::RemoteFetcher::FetchError

too many connection resets

Error message

too many connection resets

What it means

Error "too many connection resets" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/request.rb:254

      raise Gem::RemoteFetcher::FetchError.new("too many bad responses", @uri) if bad_response

      bad_response = true
      retry
    rescue Gem::Net::HTTPFatalError
      verbose "fatal error"

      raise Gem::RemoteFetcher::FetchError.new("fatal error", @uri)
    # HACK: work around EOFError bug in Gem::Net::HTTP
    # NOTE Errno::ECONNABORTED raised a lot on Windows, and make impossible
    # to install gems.
    rescue EOFError, Gem::Timeout::Error,
           Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE

      requests = @requests[connection]
      verbose "connection reset after #{requests} requests, retrying"

      raise Gem::RemoteFetcher::FetchError.new("too many connection resets", @uri) if retried

      reset connection

      retried = true
      retry
    end

    response
  ensure
    @connection_pool.checkin connection
  end

  ##
  # Resets HTTP connection +connection+.

  def reset(connection)
    @requests.delete connection

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. Retry later; the server repeatedly reset the connection
  2. Check network/proxy stability or use a different mirror

When it happens

Trigger: Thrown at lib/rubygems/request.rb:254 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/7d0383eca537356a. Report an issue: GitHub.