Skip to content

[🐛 Bug]: Failed to set preferences: unknown error when specify a profile. #14652

Closed as not planned
@heckad

Description

@heckad

What happened?

Expected Behavior -
Firefox run withprovided profile

Actual Behavior -
Firefox is not running

How can we reproduce the issue?

from selenium import webdriver
from selenium.webdriver.firefox.options import Options

firefox_options = Options()
firefox_options.add_argument("--profile D:\\path\\to\\profile\\dir")
driver = webdriver.Firefox(options=firefox_options)

Python's traceback

Traceback (most recent call last):
  File "/app/tmp/t.py", line 24, in <module>
    driver = webdriver.Firefox(options=firefox_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
    self.start_session(capabilities)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Failed to set preferences: unknown error

Relevant log output

1729892750450	geckodriver	INFO	Listening on 127.0.0.1:58119
1729892753487	webdriver::server	DEBUG	-> POST /session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts": true, ... .active-protocols": 3}, "args": ["--profile D:\\path\\to\\profile\\dir"]}}}}
1729892753487	geckodriver::capabilities	DEBUG	Trying to read firefox version from ini files
1729892753488	geckodriver::capabilities	DEBUG	Found version 131.0.3
1729892753488	webdriver::server	DEBUG	<- 500 Internal Server Error {"value":{"error":"session not created","message":"Failed to set preferences: unknown error","stacktrace":""}}

Operating System

Windows 11

Selenium version

python 3.12

What are the browser(s) and version(s) where you see this issue?

131.0.3

What are the browser driver(s) and version(s) where you see this issue?

GecoDriver 0.35.0

Are you using Selenium Grid?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-pyPython BindingsI-defectSomething is not working as intendedJ-awaiting answerQuestion asked of user; a reply moves it to triage again

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions