Skip to content

[🐛 Bug]: webdriver.Firefox() fails with 'status': [13, 'unknown error'] #15763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sci-42ver opened this issue May 21, 2025 · 10 comments
Closed
Labels

Comments

@sci-42ver
Copy link

sci-42ver commented May 21, 2025

Description

I follow the doc https://selenium-python.readthedocs.io/getting-started.html#simple-usage and expects to work, but it failed with selenium.common.exceptions.WebDriverException: Message: without saying more about that Message.

System info:

  • OS: Arch Linux 6.13.6-arch1-1
  • Python: 3.13.2
  • Firefox: 138.0.4

Backtrace:

Traceback (most recent call last):
  File "/home/hervey_arch/py_crawler_qq/tmp_debug.py", line 10, in <module>
    from selenium import webdriver;driver = webdriver.Firefox()
                                            ~~~~~~~~~~~~~~~~~^^
  File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
    super().__init__(command_executor=executor, options=options)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 260, in __init__
    self.start_session(capabilities)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 357, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
               ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/webdriver.py", line 448, in execute
    self.error_handler.check_response(response)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/remote/errorhandler.py", line 196, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: 

I use pdb to find the problem, the above response is {'status': [13, 'unknown error'], 'value': ''}, caps is same as what the log shows, capabilities is {'browserName': 'firefox', 'acceptInsecureCerts': True, 'moz:debuggerAddress': True, 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'browserVersion': None, 'moz:firefoxOptions': {'binary': '/usr/bin/firefox', 'prefs': {'remote.active-protocols': 1}}} and the rest are the default:

(Pdb) p executor
<selenium.webdriver.firefox.remote_connection.FirefoxRemoteConnection object at 0x74b282e057f0>
(Pdb) p options
<selenium.webdriver.firefox.options.Options object at 0x74b282e05160>

Reproducible Code

from selenium import webdriver;driver = webdriver.Firefox()

Debugging Logs

Selenium Manager binary found at: /home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/common/linux/selenium-manager
Executing process: /home/hervey_arch/main-env/lib/python3.13/site-packages/selenium/webdriver/common/linux/selenium-manager --browser firefox --debug --language-binding python --output json
Found geckodriver 0.36.0 in PATH: /usr/bin/geckodriver
firefox detected at /usr/bin/firefox
Running command: /usr/bin/firefox -v
Output: "Mozilla Firefox 138.0.4"
Detected browser: firefox 138.0.4
Required driver: geckodriver 0.36.0
Driver path: /usr/bin/geckodriver
Browser path: /usr/bin/firefox
Started executable: `/usr/bin/geckodriver` in a child process with pid: 53733 using 0 to output -3
POST http://localhost:38413/session {'capabilities': {'firstMatch': [{}], 'alwaysMatch': {'browserName': 'firefox', 'acceptInsecureCerts': True, 'moz:debuggerAddress': True, 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'browserVersion': None, 'moz:firefoxOptions': {'binary': '/usr/bin/firefox', 'prefs': {'remote.active-protocols': 1}}}}}
Remote response: status=503 | data= | headers=HTTPHeaderDict({'Connection': 'close', 'Proxy-Connection': 'close', 'Content-Length': '0'})
Finished Request
@sci-42ver sci-42ver added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels May 21, 2025
@selenium-ci
Copy link
Member

@sci-42ver, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

@cgoldberg
Copy link
Contributor

@sci-42ver What version of Selenium are you using, and where did you install it from?

It looks like you have geckodriver installed already. Where did you install it from? You might have better luck removing it and letting Selenium install the correct version for you (via selenium-manager).

@cgoldberg cgoldberg added J-awaiting answer Question asked of user; a reply moves it to triage again and removed A-needs-triaging A Selenium member will evaluate this soon! labels May 21, 2025
@sci-42ver
Copy link
Author

sci-42ver commented May 26, 2025

@sci-42ver What version of Selenium are you using

I use the latest 4.32.0 which can be also checked with pip (see the following).

I added that in the original post but that is removed by the github-actions. You can check that in the Edits.

and where did you install it from?

I use pip.

$ source ~/main-env/bin/activate    
(main-env)  $ pip show Selenium
Name: selenium
Version: 4.32.0
Summary: Official Python bindings for Selenium WebDriver
Home-page: https://www.selenium.dev
Author: 
Author-email: 
License: Apache 2.0
Location: /home/hervey_arch/main-env/lib/python3.13/site-packages
Requires: certifi, trio, trio-websocket, typing_extensions, urllib3, websocket-client
Required-by: helium
(main-env)  $ pip --version
pip 24.3.1 from /home/hervey_arch/main-env/lib/python3.13/site-packages/pip (python 3.13)

It looks like you have geckodriver installed already. Where did you install it from?

I installed geckodriver by yay -S geckodriver. You can check https://archlinux.org/packages/extra/x86_64/geckodriver/ for details.

You might have better luck removing it and letting Selenium install the correct version for you (via selenium-manager).

I tried selenium-manager first before using yay but the issue is still there.

@github-actions github-actions bot added A-needs-triaging A Selenium member will evaluate this soon! and removed J-awaiting answer Question asked of user; a reply moves it to triage again labels May 26, 2025
@cgoldberg
Copy link
Contributor

Can you try starting firefox and geckodriver from the command line and verify both launch with no errors?

@cgoldberg cgoldberg added the J-awaiting answer Question asked of user; a reply moves it to triage again label May 26, 2025
@sci-42ver
Copy link
Author

Can you try starting firefox and geckodriver from the command line and verify both launch with no errors?

Yes and the latter has

$ geckodriver
1748336598624   geckodriver     INFO    Listening on 127.0.0.1:4444

which seems to be expected mozilla/geckodriver#510 (comment).

@github-actions github-actions bot removed the J-awaiting answer Question asked of user; a reply moves it to triage again label May 27, 2025
@cgoldberg
Copy link
Contributor

That looks fine. Does firefox launch from the command line without error also?

@sci-42ver
Copy link
Author

sci-42ver commented May 27, 2025

That looks fine. Does firefox launch from the command line without error also?

Yes. At least I can surf the internet there.

Different from Chrome, it has no default logging. I tried to enable all using firefox --MOZ_LOG=all:5 https://superuser.com/a/1642781/1658455 but fails same as the comment there.

@cgoldberg
Copy link
Contributor

If both firefox and geckodriver work fine outside of selenium, I'm not sure what's going wrong. You will most likely have to raise an issue with mozilla/geckodriver since I don't think we are doing anything incorrectly from the selenium side.

https://github.com/mozilla/geckodriver/issues

@sci-42ver
Copy link
Author

sci-42ver commented May 27, 2025

If both firefox and geckodriver work fine outside of selenium, I'm not sure what's going wrong. You will most likely have to raise an issue with mozilla/geckodriver since I don't think we are doing anything incorrectly from the selenium side.

https://github.com/mozilla/geckodriver/issues

OK. I will follow one post of yours mozilla/geckodriver#2224 (comment).

@cgoldberg cgoldberg removed A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended labels May 31, 2025
@cgoldberg
Copy link
Contributor

This was caused by bad environment configuration on the user's system: mozilla/geckodriver#2227 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants