{"record":{"id":"16cd0e788c1505e7","repo":"SeleniumHQ/selenium","slug":"error-16cd0e","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"Errno::ENOENT","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/server.rb","lineNumber":185,"sourceCode":"    # :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)\n    # @option opts [true,false,String] :log Either a path to a log file,\n    #                                      or true to pass server log to stdout.\n    # @raise [Errno::ENOENT] if the jar file does not exist\n    #\n\n    def initialize(jar, opts = {})\n      raise Errno::ENOENT, jar unless File.exist?(jar)\n\n      @java = opts.fetch(:java, 'java') || 'java'\n      @jar = jar\n      @host = '127.0.0.1'\n      @role = opts.fetch(:role, 'standalone')\n      @port = opts.fetch(:port, WebDriver::PortProber.above(4444))\n      @timeout = opts.fetch(:timeout, 30)\n      @background = opts.fetch(:background, false)\n      @additional_args = opts.fetch(:args, [])\n      @log = opts[:log]\n      if opts[:log_level]\n        @log ||= true\n        @additional_args << '--log-level'\n        @additional_args << opts[:log_level].to_s\n      end\n\n      @log_file = nil\n    end","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/server.rb#L167-L203","documentation":"Raised in Selenium::Server.new (server.rb:185) when the jar path passed in does not exist on disk; it raises Errno::ENOENT with the jar path as the message. The documented contract (@raise [Errno::ENOENT]) makes this an explicit precondition check.","triggerScenarios":"File.exist?(jar) is false at server.rb:185, i.e. the jar argument points to a non-existent file.","commonSituations":"The jar was never downloaded; wrong path/typo; relative path resolved against an unexpected cwd; the download step was skipped.","solutions":["Confirm the jar path exists (File.exist?(jar)) before constructing the Server.","Let Selenium download the jar (Selenium::Server.download) instead of supplying a path you are unsure about.","Use an absolute path to the jar."],"exampleFix":"# before\nserver = Selenium::Server.new('selenium-server.jar')  # not present\n# after\njar = Selenium::Server.download(:latest)\nserver = Selenium::Server.new(jar, port: 4444)","handlingStrategy":"validation","validationCode":"raise ArgumentError, \"jar not found: #{jar}\" unless File.exist?(jar)\nserver = Selenium::Server.new(jar, opts)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify File.exist?(jar) before constructing Selenium::Server.","Use Selenium::Server.download to obtain the jar rather than guessing a path.","Always pass an absolute path to the jar."],"tags":["server","file-io","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}