robocorp / rpaframework

Collection of open-source libraries and tools for Robotic Process Automation (RPA), designed to be used with both Robot Framework and Python
https://www.rpaframework.org/
Apache License 2.0
1.17k stars 227 forks source link

RPA.Browser.Selenium fails in cloud workers if download=TRUE #949

Closed orlof closed 1 year ago

orlof commented 1 year ago

2023-05-08 12:47:36: ============================================================================== 2023-05-08 12:47:36: Tasks
2023-05-08 12:47:36: ============================================================================== 2023-05-08 12:47:46: Minimal task | FAIL | 2023-05-08 12:47:46: BrowserNotFoundError: Failed to start a browser: 2023-05-08 12:47:46: - Chrome: Message: session not created: This version of ChromeDriver only supports Chrome version 113 2023-05-08 12:47:46: Current browser version is 105.0.5195.102 with binary path /usr/bin/chromium-browser 2023-05-08 12:47:46: Stacktrace: 2023-05-08 12:47:46: #0 0x55e4a398c133 2023-05-08 12:47:46: #1 0x55e4a36c0966 2023-05-08 12:47:46: #2 0x55e4a36ee5ec 2023-05-08 12:47:46: #3 0x55e4a36e98da 2023-05-08 12:47:46: #4 0x55e4a36e607b 2023-05-08 12:47:46: #5 0x55e4a37259ad 2023-05-08 12:47:46: #6 0x55e4a372518f 2023-05-08 12:47:46: #7 0x55e4a371c9a3 2023-05-08 12:47:46: #8 0x55e4a36f146a 2023-05-08 12:47:46: #9 0x55e4a36f255e 2023-05-08 12:47:46: #10 0x55e4a394bcae 2023-05-08 12:47:46: #11 0x55e4a394f8fe 2023-05-08 12:47:46: #12 0x55e4a3958f20 2023-05-08 12:47:46: #13 0x55e4a3950923 2023-05-08 12:47:46: [ Message content over the limit has been removed. ] 2023-05-08 12:47:46: #0 0x55c657673273 2023-05-08 12:47:46: #1 0x55c65738e7a1 2023-05-08 12:47:46: #2 0x55c6573babeb 2023-05-08 12:47:46: #3 0x55c6573b5fdc 2023-05-08 12:47:46: #4 0x55c6573f7695 2023-05-08 12:47:46: #5 0x55c6573ee723 2023-05-08 12:47:46: #6 0x55c6573c17d1 2023-05-08 12:47:46: #7 0x55c6573c2a0e 2023-05-08 12:47:46: #8 0x55c657641390 2023-05-08 12:47:46: #9 0x55c657643a9e 2023-05-08 12:47:46: #10 0x55c6576434b9 2023-05-08 12:47:46: #11 0x55c6576441a5 2023-05-08 12:47:46: #12 0x55c65764ae0b 2023-05-08 12:47:46: #13 0x55c65764456e 2023-05-08 12:47:46: #14 0x55c657625373 2023-05-08 12:47:46: #15 0x55c65765fc58 2023-05-08 12:47:46: #16 0x55c65765fd94 2023-05-08 12:47:46: #17 0x55c65766d5c6 2023-05-08 12:47:46: #18 0x7f8de95b36db start_thread 2023-05-08 12:47:46: ------------------------------------------------------------------------------ 2023-05-08 12:47:46: Tasks | FAIL | 2023-05-08 12:47:46: 1 task, 0 passed, 1 failed 2023-05-08 12:47:46: ==============================================================================

cmin764 commented 1 year ago

According to these versions our core web-driver downloader should detect the right version and download it.

Screenshot 2023-05-10 at 16 05 34

We can test the behaviour by evaluating in a robot ran in the cloud code like:

from webdriver_manager.chrome import ChromeDriverManager as CDM; print(CDM().driver.get_driver_download_url())

which should print an URL like:

https://chromedriver.storage.googleapis.com/105.0.5195.52/chromedriver_....zip
cmin764 commented 1 year ago

I confirm the issue, which looks to come from our outdated Chrome browser found in the Cloud Worker.

@kariharju Do you think we can do ourselves a favor and provide the latest Chrome (or a version that has a web-driver available)? (the current browser dates back from Aug 30, 2022)

cmin764 commented 1 year ago

We concluded that the real problem was actually trying to get the Chromium browser version in a Chrome way, which led to no version being discovered at all, which led to downloading the latest chromedriver, which of course is incompatible with the current version of Chromium we have in the container.

The fix was to detect when we have Chromium only in the system and go that route with the web-driver management instead, if by any non-recommended reason downloading is explicitly enabled.