Closed Bug 1784593 Opened 2 years ago Closed 2 years ago

selenium.common.exceptions.SessionNotCreatedException: Message: Error: NS_ERROR_UNKNOWN_HOST error opening Firefox v103.0.2 with GeckoDriver v0.31.0

Categories

(Testing :: geckodriver, defect)

Firefox 103
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: debanjanb, Unassigned, NeedInfo)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Steps to reproduce:

Initiated Firefox v103.0.2 with latest GeckoDriver v0.31.0 and Selenium v4.4.0

UserAgent:

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0

Code trials:

from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Log

import sys
print ("Python Version: " +str(sys.version_info))

import selenium
print("Selenium version: " +selenium.__version__)

log = Log()
log.level = "trace"
options = Options()
options.add_argument(log.level)
s = Service('C:\\BrowserDrivers\\geckodriver.exe')
driver = webdriver.Firefox(service=s, options=options)
driver.get('https://www.google.com/')

Actual results:

Firefox v103.0.2 (current) when initiated with latest GeckoDriver v0.31.0 and Selenium v4.4.0 crashes with NS_ERROR_UNKNOWN_HOST error as follows:

selenium.common.exceptions.SessionNotCreatedException: Message: Error: NS_ERROR_UNKNOWN_HOST

Console output, traceback and error stacktrace:

Python Version: sys.version_info(major=3, minor=9, micro=0, releaselevel='final', serial=0)
Selenium version: 4.4.0
Traceback (most recent call last):
  File "C:\Users\debanjan.bhattacharj\Desktop\Python Programs\Selenium_Firefox_tests.py", line 26, in <module>
    driver = webdriver.Firefox(service=s, options=options)
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 177, in __init__
    super().__init__(
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 276, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 369, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 434, in execute
    self.error_handler.check_response(response)
  File "C:\Users\user_name\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Error: NS_ERROR_UNKNOWN_HOST
Stacktrace:
#checkLoadingState@chrome://remote/content/shared/Navigate.jsm:239:28
onStateChange@chrome://remote/content/shared/Navigate.jsm:284:28

Expected results:

Firefox v103.0.2 with latest GeckoDriver v0.31.0 and Selenium v4.4.0 should get successfully initiated.

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Mach Core' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Mach Core
Product: Firefox → Firefox Build System
Component: Mach Core → geckodriver
Product: Firefox Build System → Testing

@debanjanb would you mind attaching the generated trace log from geckodriver? You most likely will find it as geckodriver.log in the current working directory. Thanks.

Flags: needinfo?(debanjanb)

No reply from reporter. I'm going to close the bug but will be happy to reopen in case the requested information has been given.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.