{"record":{"id":"5603140b4982deaa","repo":"SeleniumHQ/selenium","slug":"unknown-option-s-if-not-allowed-size-1-n","errorCode":null,"errorMessage":"unknown option#{'s' if not_allowed.size != 1}: #{not_allowed.inspect}","messagePattern":"unknown option#(.+?): #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/common/proxy.rb","lineNumber":70,"sourceCode":"        end\n\n        proxy\n      end\n\n      def initialize(opts = {})\n        not_allowed = []\n\n        opts.each do |k, v|\n          if ALLOWED.key?(k)\n            send(:\"#{k}=\", v)\n          else\n            not_allowed << k\n          end\n        end\n\n        return if not_allowed.empty?\n\n        raise ArgumentError, \"unknown option#{'s' if not_allowed.size != 1}: #{not_allowed.inspect}\"\n      end\n\n      def ==(other)\n        other.is_a?(self.class) && as_json == other.as_json\n      end\n      alias eql? ==\n\n      def http=(value)\n        self.type = :manual\n        @http = value\n      end\n\n      def no_proxy=(value)\n        self.type = :manual\n        @no_proxy = value\n      end\n\n      def ssl=(value)","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/proxy.rb#L52-L88","documentation":"Proxy.new iterates the options hash and only accepts keys present in the ALLOWED map (:type, :http, :no_proxy, :pac, :ssl, :auto_detect, :socks, :socks_username, :socks_password, :socks_version). Any unrecognized key is collected and, if any exist, ArgumentError is raised listing them. The message pluralizes to 'options' when more than one is rejected.","triggerScenarios":"Calling Proxy.new(ftp: 'host:port') since ftp is not a supported key. A typo such as :htp or :ssl_proxy. Passing a generic capabilities hash that includes unrelated keys.","commonSituations":"Assuming an FTP proxy key exists. Copying keys from another library's proxy config. Merging an options hash that contains non-proxy entries.","solutions":["Use only ALLOWED keys: :type, :http, :no_proxy, :pac, :ssl, :auto_detect, :socks, :socks_username, :socks_password, :socks_version.","Remove unrelated keys from the hash before passing it to Proxy.new.","Inspect Selenium::WebDriver::Proxy::ALLOWED to confirm valid key names."],"exampleFix":"# before\nproxy = Selenium::WebDriver::Proxy.new(ftp: 'proxy.example.com:8080')\n\n# after\nproxy = Selenium::WebDriver::Proxy.new(http: 'proxy.example.com:8080')","handlingStrategy":"validation","validationCode":"allowed = Selenium::WebDriver::Proxy::ALLOWED.keys\nunknown = opts.keys - allowed\nraise ArgumentError, \"unknown proxy options: #{unknown.inspect}\" unless unknown.empty?","typeGuard":"def valid_proxy_opts?(opts)\n  opts.is_a?(Hash) && (opts.keys - Selenium::WebDriver::Proxy::ALLOWED.keys).empty?\nend","tryCatchPattern":"begin\n  proxy = Selenium::WebDriver::Proxy.new(opts)\nrescue ArgumentError => e\n  raise unless e.message.include?('unknown option')\n  allowed = Selenium::WebDriver::Proxy::ALLOWED.keys\n  proxy = Selenium::WebDriver::Proxy.new(opts.slice(*allowed))\nend","preventionTips":["Reference Proxy::ALLOWED to confirm supported keys before construction.","Filter external config hashes with .slice(*Proxy::ALLOWED.keys).","Note that FTP proxy is not supported; use :http or :ssl as appropriate."],"tags":["ruby","proxy","validation"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}