cyrilou242 / jnotebook

Notebook for Java.
https://jnotebook.catheu.tech
MIT License
11 stars 3 forks source link

chromedriver error when rendering #14

Closed maxandersen closed 8 months ago

maxandersen commented 8 months ago

i'm on osx and gets this error when rendering a notebook:

INFO: Driver logs no longer sent to console by default; https://www.selenium.dev/documentation/webdriver/drivers/service/#setting-log-output
Nov 04, 2023 2:03:20 PM org.openqa.selenium.manager.SeleniumManager lambda$runCommand$1
WARNING: Error getting version of chromedriver 118. Retrying with chromedriver 117 (attempt 1/5)
Nov 04, 2023 2:03:20 PM org.openqa.selenium.manager.SeleniumManager lambda$runCommand$1
WARNING: Error getting version of chromedriver 117. Retrying with chromedriver 116 (attempt 2/5)
Nov 04, 2023 2:03:20 PM org.openqa.selenium.manager.SeleniumManager lambda$runCommand$1
WARNING: Error getting version of chromedriver 116. Retrying with chromedriver 115 (attempt 3/5)
Nov 04, 2023 2:03:20 PM org.openqa.selenium.manager.SeleniumManager lambda$runCommand$1
WARNING: Error getting version of chromedriver 115. Retrying with chromedriver 114 (attempt 4/5)
java.lang.RuntimeException: Exception rendering notebook jnotebookDemo.jsh: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 114
Current browser version is 118.0.5993.117 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome 
Host info: host: 'goldentiny', ip: 'fe80:0:0:0:1c58:4452:61ad:4a4a%en0'
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.1', java.version: '21.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*, --headless=new], extensions: []}}]}]

do I need some specfic chrome install?

maxandersen commented 8 months ago

running with --no-optimize avoids the error.

cyrilou242 commented 8 months ago

Hey thanks. I'll try to reproduce. Maybe some chrome versions evolved quickly.

cyrilou242 commented 8 months ago

Ok I added a library that is supposed to manage this kind of problem. Hopefully it should fix 90% of the selenium driver issues.

Whenever you have time, could you try with the most recent SNAPSHOT or build from source?

./mvnw clean install -DskipTests
./jnotebook-distribution/target/jnotebook-distribution-*-SNAPSHOT.jar render notebooks/my_notebook.jsh my_notebook.html

I could not reproduce the error on my machine, any chance you could provide a stacktrace? I'll add better error management.

maxandersen commented 8 months ago

that fixes it. thanks.