Selenium or libdbus-glib-1-2 or Firefox malfunction(?): Couldn't load XPCOM.

251 views
Skip to first unread message

Tomasz Sasiak

unread,
Mar 27, 2023, 4:25:10 AM3/27/23
to Selenium Users
Hi!

I have just switched to MX 21 Wildflower and encountered an issue as follows:

I ran a simple python script based on selenium package (www.selenium.dev, version 4.8.3):
from selenium import webdriver
from time import sleep
from selenium.webdriver.firefox.options import Options 

options = Options() 
# options.binary_location = '/usr/bin/firefox' - unfortunately this shortcut cannot be executed as binary 
options.binary_location = '/opt/firefox/firefox' 
browser = webdriver.Firefox(options=options) 
browser.get('http://selenium.dev/') 
sleep(4) 
browser.quit()


I received:

Traceback (most recent call last): File "/home/tomasz/PycharmProjects/main.py", line 24, in <module> browser = webdriver.Firefox(options=options) File "/home/tomasz/PycharmProjects/venv/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py", line 199, in __init__ super().__init__(command_executor=executor, options=options, keep_alive=True) File "/home/tomasz/PycharmProjects/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__ self.start_session(capabilities, browser_profile) File "/home/tomasz/PycharmProjects/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/home/tomasz/PycharmProjects/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute self.error_handler.check_response(response) File "/home/tomasz/PycharmProjects/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 255

and in the Geckodriver log:

1679763829017 mozrunner::runner INFO Running command: "/opt/firefox/firefox" "--marionette" "--remote-debugging-port" "41735" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "/run/user/1000/app/com.jetbrains.PyCharm-Community/rust_mozprofilemdUudC" XPCOMGlueLoad error for file /opt/firefox/libxul.so: libdbus-glib-1.so.2: cannot open shared object file: No such file or directory Couldn't load XPCOM.

The path /opt/firefox/libxul.so clearly exists.

The info from the log file let me think that's the matter of permissions so i changed /opt to chmod -r 777. It didn't work so i reinstalled libdbus by

sudo apt-get reinstall libdbus-glib-1-2 and uninstalled and installed Firefox once again [keeping chmod 777]. Sadly, the traceback and logs are still the same.

What to do? :) Feel a bit confused because selenium worked perfectly fine with MX 19 :)

Tomasz Sasiak

unread,
Mar 29, 2023, 1:33:02 PM3/29/23
to Selenium Users
Reply all
Reply to author
Forward
0 new messages