Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Bad error message when firefox fails to start #12738

Open
LiterallyUniqueLogin opened this issue Jan 13, 2023 · 1 comment
Open

[BUG] Bad error message when firefox fails to start #12738

LiterallyUniqueLogin opened this issue Jan 13, 2023 · 1 comment
Milestone

Comments

@LiterallyUniqueLogin
Copy link

LiterallyUniqueLogin commented Jan 13, 2023

Software versions

Python version : 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53)
IPython version : (not installed)
Tornado version : 6.2
Bokeh version : 2.4.3
BokehJS static path : /opt/conda/envs/ukb/lib/python3.7/site-packages/bokeh/server/static
node.js version : (not installed)
npm version : (not installed)
Operating system : Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-debian-11.6

Browser name and version

firefox                   108.0.2              hcb278e6_0    conda-forge
geckodriver               0.32.0               h4b87306_0    conda-forge
selenium                  4.7.2              pyhd8ed1ab_0    conda-forge

Jupyter notebook / Jupyter Lab version

No response

Expected behavior

bokeh.io.export_png to succeed

Observed behavior

Traceback (most recent call last):
  File "/cromwell-executions/main/4ebbd285-2b3a-4794-b1bc-51f7fabcf33e/call-main/main/4d38da92-20e0-42ec-bc58-cab21a23c8b4/call-fig_4a/inputs/1414132764/cbl_allele_histo.py", line 130, in <module>
    bokeh.io.export_png(fig, filename=f'{args.outdir}/cbl.png')
  File "/opt/conda/envs/ukb/lib/python3.7/site-packages/bokeh/io/export.py", line 111, in export_png
    image = get_screenshot_as_png(obj, width=width, height=height, driver=webdriver, timeout=timeout)
  File "/opt/conda/envs/ukb/lib/python3.7/site-packages/bokeh/io/export.py", line 236, in get_screenshot_as_png
    web_driver = driver if driver is not None else webdriver_control.get()
  File "/opt/conda/envs/ukb/lib/python3.7/site-packages/bokeh/io/webdriver.py", line 153, in get 
    self.current = self.create()
  File "/opt/conda/envs/ukb/lib/python3.7/site-packages/bokeh/io/webdriver.py", line 157, in create
    driver = self._create(kind)
  File "/opt/conda/envs/ukb/lib/python3.7/site-packages/bokeh/io/webdriver.py", line 175, in _create
    raise RuntimeError("Neither firefox and geckodriver nor a variant of chromium browser and " \ 
RuntimeError: Neither firefox and geckodriver nor a variant of chromium browser and chromedriver are available on system PATH. You can install the former with 'conda install -c conda-forge firefox geckodriver'.

Example code

It turns out that despite having firefox and geckodriver installed via conda and accessible on the PATH, firefox was still missing some dependencies. I confirmed this via:

> firefox --headless
XPCOMGlueLoad error for file /opt/conda/envs/ukb/bin/FirefoxApp/libmozgtk.so:
libgtk-3.so.0: cannot open shared object file: No such file or directory
Couldn't load XPCOM.

and fixed it via apt-get install -y libgtk-3-0 libasound2 libdbus-glib-1-2 libx11-xcb-dev libpci-dev libgl1-mesa-glx

So it's not Bokeh's fault that firefox wasn't working or that export_png failed. But Bokeh swallows all error messages here and so instead of reporting that my firefox installation was broken with the appropriate error message, it gave an incorrect error message suggesting that firefox wasn't installed at all. This led me down multiple hours of incorrect debugging. And I've seen many similar message board posts revolving around this issue. Instead of swallowing that error - can bokeh surface it so the user knows how to debug this?

Stack traceback or browser console output

No response

Screenshots

No response

@bryevdv
Copy link
Member

bryevdv commented Jan 27, 2023

@LiterallyUniqueLogin Would you be interested to submit a PR to improve error reporting during wedbriver creation?

@bryevdv bryevdv added type: task and removed TRIAGE labels Jan 27, 2023
@bryevdv bryevdv added this to the 3.x milestone Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants