geckodriver icon indicating copy to clipboard operation
geckodriver copied to clipboard

Unable to find a matching set of capabilities - Gecko 0.19.1, Ubuntu 16, FF 58, Selenium 3.9.0

Open bkovacev opened this issue 8 years ago • 10 comments

System

  • Version: 0.19.1
  • Platform: Ubuntu 16 (heroku-16)
  • Firefox: 58.0.1
  • Selenium: Python 3.9.0

Testcase

It crashes on driver = webdriver.Firefox()

PATH=/app/.heroku/python/bin:/usr/local/bin:/usr/bin:/bin:/app/vendor/firefox:/app/vendor/firefox:/app/vendor/geckodriver:/app/vendor/phantomjs/bin as per https://github.com/mozilla/geckodriver/issues/1119

Not loading any capability or whatsoever.

Stacktrace

SessionNotCreatedException: Message: Unable to find a matching set of capabilities

POST http://127.0.0.1:50565/session {"desiredCapabilities": {"browserName": "firefox", "acceptInsecureCerts": true}, "capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts": true}}}

bkovacev avatar Feb 15 '18 15:02 bkovacev

Please provide a trace log as requested when filing an issue. Without it there is nothing we can help with. Please see https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/TraceLogs.html in how to do that. Thanks.

whimboo avatar Feb 16 '18 09:02 whimboo

I am getting the same behavior.

JonathanSeguin avatar Feb 19 '18 21:02 JonathanSeguin

I am also seeing this issue. I tried to get a trace log, however for some reason nothing populates in the log file.

selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

Beherrit avatar Feb 20 '18 11:02 Beherrit

We’re unable to provide any useful feedback without a trace-level log. By default this is written to stdout, but may of course be redirected by the client you use. Read more about reporting actionable bugs in our contribution guidelines.

andreastt avatar Feb 20 '18 11:02 andreastt

@Beherrit @JonathanSeguin @bkovacev One possible reason for getting the generic SessionNotCreatedException is when geckodriver can't find the Firefox binary.

Are you sure Firefox is installed? or maybe installed, but in a non-standard location that is not on your PATH?

Here is an attempt to Launch Firefox on a machine with geckodriver installed, but not Firefox:


$ which firefox
which: no firefox in ... [snip]

$ python3
>>> from selenium import webdriver
>>> driver = webdriver.Chrome()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    keep_alive=True)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

cgoldberg avatar Feb 20 '18 14:02 cgoldberg

Ends up I had a mangled Firefox install (I made a mistake linking the libs in /usr/lib/firefox when doing a manual install). Sorry for the noise!

JonathanSeguin avatar Feb 20 '18 14:02 JonathanSeguin

That was the exact case for me and I just didn't have the time to update the question, sorry.

Firefox installation was not present. After I've gotten Firefox to install, a lot of libraries were missing so after trying for 3 days to get it right on heroku's heroku-16 stack I gave up and switched to PhantomJS and just adjusted my scrapper to work with it.

On Tue, Feb 20, 2018 at 3:12 PM, Jonathan Séguin [email protected] wrote:

Ends up I had a mangled Firefox install (I made a mistake linking the libs in /usr/lib/firefox when doing a manual install). Sorry for the noise!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla/geckodriver/issues/1178#issuecomment-366989037, or mute the thread https://github.com/notifications/unsubscribe-auth/AFL9_M9MPic_5qYBLF5wxBdeHfZeV7Opks5tWtK-gaJpZM4SHBW3 .

bkovacev avatar Feb 20 '18 14:02 bkovacev

Well it would appear reinstalling Firefox did the trick for me. Not sure why I got the problem to begin with since everything was working until I downloaded .19 Gecko. All is good now though. Funky stuff!

Thanks!

Beherrit avatar Feb 20 '18 15:02 Beherrit

This is essentially a duplicate of https://github.com/mozilla/geckodriver/issues/832, to provide better error messages from New Session.

andreastt avatar Feb 21 '18 13:02 andreastt

I also found this error how to solve SessionNotCreatedException: Message: Unable to find a matching set of capabilities this error.

pu-tu avatar Dec 27 '18 03:12 pu-tu