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

Dockerfile does not install browser and web driver, preventing emailer from working #7466

Open
Fingerzam opened this issue May 7, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@Fingerzam
Copy link

commented May 7, 2019

Cannot use emailer feature using a container built with contrib/docker/Dockerfile.

Expected results

Emailing dashboards and charts to work with a container built with the provided Dockerfile.

Actual results

Emailer logs about missing browser and/or driver:

 [2019-05-07 14:58:30,786: ERROR/ForkPoolWorker-1] Task email_reports.send[1ee0a6a2-fa7d-47d2-86dc-8bba91da4066] raised unexpected: WebDriverException("'geckodriver' executable needs to be in PATH. ",)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/local/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver': 'geckodriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 382, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 641, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/superset/superset/tasks/schedules.py", line 392, in schedule_email_report
    deliver_dashboard(schedule)
  File "/home/superset/superset/tasks/schedules.py", line 219, in deliver_dashboard
    driver = create_webdriver()
  File "/home/superset/superset/tasks/schedules.py", line 168, in create_webdriver
    driver = driver_class(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
    self.service.start()
  File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

Screenshots

If applicable, add screenshots to help explain your problem.

How to reproduce the bug

  1. build a container with contrib/docker/Dockerfile
  2. set required settings for emailer
  3. click Manage
  4. click Dashboard Emails
  5. make an email schedule (e.g. crontab 5 12 * * *) , check Send Test Email and add your email to Test Email Recipients and Recipients
  6. click save
  7. check worker logs for errors

Environment

  • superset version v0.32.0rc2
  • python, node and npm versions as in the Dockerfile

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.
@issue-label-bot

This comment has been minimized.

Copy link

commented May 7, 2019

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.91. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the #bug label May 7, 2019

@Fingerzam

This comment has been minimized.

Copy link
Author

commented May 7, 2019

This issue can be fixed by adding

RUN apt-get update && apt-get install -y firefox-esr

RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
RUN tar -x geckodriver -zf geckodriver-v0.24.0-linux64.tar.gz -O > /usr/bin/geckodriver
RUN chmod +x /usr/bin/geckodriver
RUN rm geckodriver-v0.24.0-linux64.tar.gz

to the Dockerfile

@mistercrunch

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

I'd suggest layering it in another image to avoid bloating the main image.

@Fingerzam

This comment has been minimized.

Copy link
Author

commented May 8, 2019

It seems to add 400 MB. Current image is 1.64 GB and with these additions ends up at 2.04GB

@mistercrunch

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

Wow that's pretty big. I made a Superset image for internal use that is < 200mb

@theikkila

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

Does that internal image contain also the webdriver?
Emailer is nowadays feature of Superset so probably we should include the webdriver and browser in some distribution for users.

It could be another version or there could be "lite" version for those users that are not using the emailer-feature

@mistercrunch

This comment has been minimized.

Copy link
Contributor

commented May 15, 2019

It does not but it could be layered on top of another derived image. Generally it'd be great to have a lightweight base image that is built upon to create heavier builds with more assumptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.