{"record":{"id":"3d30eaa72892d79c","repo":"SeleniumHQ/selenium","slug":"for","errorCode":null,"errorMessage":"{} for {}","messagePattern":"\\{\\} for \\{\\}","errorType":"http","errorClass":"Selenium::Server::Error","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/server.rb","lineNumber":160,"sourceCode":"            total = response.content_length\n            progress = 0\n            segment_count = 0\n\n            response.read_body do |segment|\n              progress += segment.length\n              segment_count += 1\n\n              if (segment_count % 15).zero?\n                percent = progress.fdiv(total) * 100\n                print \"#{CL_RESET}Downloading #{destination.path}: #{percent.to_i}% (#{progress} / #{total})\"\n                segment_count = 0\n              end\n\n              destination.write(segment)\n            end\n          end\n\n          raise Error, \"#{resp.code} for #{destination.path}\" unless resp.is_a? Net::HTTPSuccess\n        end\n      end\n    end\n\n    #\n    # The Mode of the Server\n    # :standalone, #hub, #node\n    #\n\n    attr_accessor :role, :host, :port, :timeout, :background, :log\n\n    #\n    # @param [String] jar Path to the server jar.\n    # @param [Hash] opts the options to create the server process with\n    #\n    # @option opts [Integer] :port Port the server should listen on (default: 4444).\n    # @option opts [Integer] :timeout Seconds to wait for server launch/shutdown (default: 30)\n    # @option opts [true,false] :background Run the server in the background (default: false)","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/server.rb#L142-L178","documentation":"Raised by Selenium::Server.download_server (server.rb) when the HTTP response to the server-jar download is not a Net::HTTPSuccess. The message interpolates the HTTP status code and the destination path, e.g. \"404 for selenium-server.jar\".","triggerScenarios":"download_server completes the request but resp.is_a?(Net::HTTPSuccess) is false (server.rb:160), e.g. a 404/403/5xx from github-releases.githubusercontent.com.","commonSituations":"GitHub release asset moved or renamed; rate-limited (403/429); transient 5xx; proxy returning an error page; the requested version tag does not exist.","solutions":["Retry after a short delay (transient 5xx/429 are common).","Verify the version/URL; download the jar manually from the Selenium releases page.","If rate-limited, authenticate or wait; check http_proxy/HTTP_PROXY settings.","Pre-download the jar and pass its path to Selenium::Server.new so download is skipped."],"exampleFix":"# before\nSelenium::Server.download latest, dest  # resp 404\n# after: pre-download then reference local jar\nserver = Selenium::Server.new('/path/selenium-server.jar', port: 4444)","handlingStrategy":"retry","validationCode":"require 'net/http'\nuri = URI(download_url)\ncode = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.head(uri.request_uri).code }\nraise \"preflight HEAD returned #{code}\" unless code.start_with?('2')","typeGuard":null,"tryCatchPattern":"retries = 0\nbegin\n  Selenium::Server.download latest, dest\nrescue Selenium::Server::Error => e\n  raise if (retries += 1) > 3 || !e.message.match?(/^[45]\\d\\d for /)\n  sleep 2 ** retries\n  retry\nend","preventionTips":["Pre-download the jar manually and pass the local path to Selenium::Server.new.","Set http_proxy/HTTP_PROXY correctly for restricted networks.","Watch for GitHub rate-limiting (403/429) in CI."],"tags":["download","http","server","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}