{"record":{"id":"72644da686ed4e4e","repo":"ruby/rubygems","slug":"17-72644d","errorCode":"17","errorMessage":"Too many redirects","messagePattern":"Too many redirects","errorType":"http","errorClass":"HTTPError","httpStatus":null,"severity":"error","filePath":"lib/bundler/fetcher/downloader.rb","lineNumber":42,"sourceCode":"        Errno::ECONNRESET,\n        Errno::ETIMEDOUT,\n        Errno::EAGAIN,\n        Gem::Net::HTTPBadResponse,\n        Gem::Net::HTTPHeaderSyntaxError,\n        Gem::Net::ProtocolError,\n        Zlib::BufError,\n      ].freeze\n\n      attr_reader :connections\n      attr_reader :redirect_limit\n\n      def initialize(connections, redirect_limit)\n        @connections = connections\n        @redirect_limit = redirect_limit\n      end\n\n      def fetch(uri, headers = {}, counter = 0)\n        raise HTTPError, \"Too many redirects\" if counter >= redirect_limit\n\n        filtered_uri = URICredentialsFilter.credential_filtered_uri(uri)\n\n        response = request(uri, headers)\n        Bundler.ui.debug(\"HTTP #{response.code} #{response.message} #{filtered_uri}\")\n\n        case response\n        when Gem::Net::HTTPSuccess, Gem::Net::HTTPNotModified\n          response\n        when Gem::Net::HTTPRedirection\n          new_uri = Gem::URI.parse(response[\"location\"])\n          if new_uri.host == uri.host\n            new_uri.user = uri.user\n            new_uri.password = uri.password\n          end\n          fetch(new_uri, headers, counter + 1)\n        when Gem::Net::HTTPRequestedRangeNotSatisfiable\n          new_headers = headers.dup","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/fetcher/downloader.rb#L24-L60","documentation":"Error \"Too many redirects\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/fetcher/downloader.rb:42 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"}