{"record":{"id":"68836a1cd570f450","repo":"SeleniumHQ/selenium","slug":"no-sessionid-in-returned-payload","errorCode":null,"errorMessage":"no sessionId in returned payload","messagePattern":"no sessionId in returned payload","errorType":"exception","errorClass":"Error::WebDriverError","httpStatus":null,"severity":"critical","filePath":"rb/lib/selenium/webdriver/remote/bridge.rb","lineNumber":74,"sourceCode":"        #\n\n        def initialize(http_client:)\n          @http = http_client\n          @file_detector = nil\n          @locator_converter = self.class.locator_converter\n        end\n\n        #\n        # Creates session.\n        #\n\n        def create_session(capabilities)\n          response = execute(:new_session, {}, prepare_capabilities_payload(capabilities))\n\n          @session_id = response['sessionId']\n          capabilities = response['capabilities']\n\n          raise Error::WebDriverError, 'no sessionId in returned payload' unless @session_id\n\n          @capabilities = Capabilities.json_create(capabilities)\n\n          case @capabilities[:browser_name]\n          when 'chrome', 'chrome-headless-shell'\n            extend(WebDriver::Chrome::Features)\n          when 'firefox'\n            extend(WebDriver::Firefox::Features)\n          when 'msedge', 'MicrosoftEdge'\n            extend(WebDriver::Edge::Features)\n          when 'Safari', 'Safari Technology Preview'\n            extend(WebDriver::Safari::Features)\n          when 'internet explorer'\n            extend(WebDriver::IE::Features)\n          end\n        end\n\n        #","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/remote/bridge.rb#L56-L92","documentation":"Raised by Remote::Bridge#create_session (Error::WebDriverError) when the new_session response payload contains no 'sessionId' key. Per the WebDriver spec a successful session creation must return a sessionId; its absence means the remote end returned a malformed or non-conformant response.","triggerScenarios":"Connecting to a server/endpoint that is not a compliant WebDriver implementation (e.g. a plain HTTP server, a proxy, or a legacy Selenium 2 protocol endpoint) that returns a body without sessionId; an intermediary mangling the JSON response.","commonSituations":"Wrong URL (e.g. pointing at a web UI or status endpoint instead of the WebDriver session endpoint); an old Grid/hub version; a mock or recording returning a partial payload; a reverse proxy stripping fields.","solutions":["Verify the remote URL points to a compliant WebDriver endpoint (e.g. http://host:4444 for a Selenium 4 Grid/Server).","Upgrade the remote end (Grid/Server/driver) to a WebDriver-compliant version.","Inspect the raw HTTP response from the new_session call to confirm the payload shape and adjust the endpoint/proxy accordingly."],"exampleFix":"// before\ndriver = Selenium::WebDriver.for(:remote, url: 'http://hub:4444/wd/hub', capabilities: caps)\n# legacy endpoint returns no sessionId\n\n// after\n# use the Selenium 4 Grid root endpoint\ndriver = Selenium::WebDriver.for(:remote, url: 'http://hub:4444', capabilities: caps)","handlingStrategy":"validation","validationCode":"# Confirm the endpoint is a compliant WebDriver server before session creation\nrequire 'net/http'\nuri = URI(grid_url + '/status')\nresp = Net::HTTP.get_response(uri)\nraise 'Endpoint is not a WebDriver server' unless resp.is_a?(Net::HTTPSuccess)","typeGuard":null,"tryCatchPattern":"begin\n  driver = Selenium::WebDriver.for(:remote, url: url, capabilities: caps)\nrescue Selenium::WebDriver::Error::WebDriverError => e\n  raise unless e.message.include?('sessionId')\n  raise \"Remote end returned no sessionId; verify URL/version: #{e.message}\"\nend","preventionTips":["Point the remote URL at a WebDriver-compliant endpoint (Selenium 4 Grid root, not /wd/hub).","Upgrade Grid/Server and browser drivers to current versions.","Inspect the raw new_session response when the error appears to detect proxy/endpoint issues."],"tags":["remote","session","protocol","grid"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}