nigzak opened a new issue, #20843: URL: https://github.com/apache/superset/issues/20843
Sending emails does not work - does not mind if firefox or chrome is used #### How to reproduce the bug create custom dockerfile with adding firefox or chrome (same issue if you only add one of them) and config having redis active and reachable from docker start docker init image, load example and add a job for sending a report every minute start cronery ``` celery --app=superset.tasks.celery_app:app worker --pool=prefork -O fair -c 4 ``` HINT: featureflag alert_reports is active  ### Expected results email is sent ### Actual results error is shown in logfile, no email is sent HINT: source for dockerfile is https://superset.apache.org/docs/installation/alerts-reports/ #### firefox dockerfile ``` FROM apache/superset:2.0.0 USER superset:superset COPY custom_sso_security_manager.py /app/pythonpath/custom_sso_security_manager.py COPY superset_config.py /app/pythonpath/superset_config.py USER root:root RUN chown superset:superset /app/pythonpath/custom_sso_security_manager.py RUN chown superset:superset /app/pythonpath/superset_config.py RUN chmod +x /app/pythonpath/custom_sso_security_manager.py RUN chmod +x /app/pythonpath/superset_config.py RUN apt-get update && \ apt-get install --no-install-recommends -y firefox-esr ENV GECKODRIVER_VERSION=0.29.0 RUN wget -q https://github.com/mozilla/geckodriver/releases/download/v${GECKODRIVER_VERSION}/geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz && \ tar -x geckodriver -zf geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz -O > /usr/bin/geckodriver && \ chmod 777 /usr/bin/geckodriver && \ rm geckodriver-v${GECKODRIVER_VERSION}-linux64.tar.gz RUN pip install --no-cache authlib gevent psycopg2 redis USER superset:superset ``` error ``` logging was configured successfully 2022-07-25 09:25:43,392:INFO:superset.utils.logging_configurator:logging was configured successfully 2022-07-25 09:25:43,399:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'> -------------- celery@7db8236e4201 v5.2.2 (dawn-chorus) --- ***** ----- -- ******* ---- Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.2.5 2022-07-25 09:25:45 - *** --- * --- - ** ---------- [config] - ** ---------- .> app: __main__:0x7ff39e8a2040 - ** ---------- .> transport: redis://redis:6379/5 - ** ---------- .> results: redis://redis:6379/5 - *** --- * --- .> concurrency: 4 (prefork) -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker) --- ***** ----- -------------- [queues] .> celery exchange=celery(direct) key=celery SQLite Database support for metadata databases will be removed in a future version of Superset. [2022-07-25 09:25:47,477: WARNING/ForkPoolWorker-4] SQLite Database support for metadata databases will be removed in a future version of Superset. Init selenium driver [2022-07-25 09:25:47,565: INFO/ForkPoolWorker-4] Init selenium driver A downstream exception occurred while generating a report: f7372ee4-3c4d-4b6a-8b78-930926d4ba4f Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/superset/reports/commands/execute.py", line 234, in _get_screenshots image = screenshot.get_screenshot(user=user) File "/app/superset/utils/screenshots.py", line 74, in get_screenshot self.screenshot = driver.get_screenshot(self.url, self.element, user) File "/app/superset/utils/webdriver.py", line 109, in get_screenshot driver = self.auth(user) File "/app/superset/utils/webdriver.py", line 87, in auth driver = self.create() File "/app/superset/utils/webdriver.py", line 84, in create return driver_class(**kwargs) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__ self.service.start() File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/superset/tasks/scheduler.py", line 79, in execute AsyncExecuteReportScheduleCommand( File "/app/superset/reports/commands/execute.py", line 659, in run raise ex File "/app/superset/reports/commands/execute.py", line 655, in run ReportScheduleStateMachine( File "/app/superset/reports/commands/execute.py", line 624, in run state_cls( File "/app/superset/reports/commands/execute.py", line 525, in next raise first_ex File "/app/superset/reports/commands/execute.py", line 503, in next self.send() File "/app/superset/reports/commands/execute.py", line 408, in send notification_content = self._get_notification_content() File "/app/superset/reports/commands/execute.py", line 334, in _get_notification_content screenshot_data = self._get_screenshots() File "/app/superset/reports/commands/execute.py", line 239, in _get_screenshots raise ReportScheduleScreenshotFailedError( superset.reports.commands.exceptions.ReportScheduleScreenshotFailedError: Failed taking a screenshot Message: 'geckodriver' executable needs to be in PATH. [2022-07-25 09:25:47,881: ERROR/ForkPoolWorker-4] A downstream exception occurred while generating a report: f7372ee4-3c4d-4b6a-8b78-930926d4ba4f Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/superset/reports/commands/execute.py", line 234, in _get_screenshots image = screenshot.get_screenshot(user=user) File "/app/superset/utils/screenshots.py", line 74, in get_screenshot self.screenshot = driver.get_screenshot(self.url, self.element, user) File "/app/superset/utils/webdriver.py", line 109, in get_screenshot driver = self.auth(user) File "/app/superset/utils/webdriver.py", line 87, in auth driver = self.create() File "/app/superset/utils/webdriver.py", line 84, in create return driver_class(**kwargs) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__ self.service.start() File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/superset/tasks/scheduler.py", line 79, in execute AsyncExecuteReportScheduleCommand( File "/app/superset/reports/commands/execute.py", line 659, in run raise ex File "/app/superset/reports/commands/execute.py", line 655, in run ReportScheduleStateMachine( File "/app/superset/reports/commands/execute.py", line 624, in run state_cls( File "/app/superset/reports/commands/execute.py", line 525, in next raise first_ex File "/app/superset/reports/commands/execute.py", line 503, in next self.send() File "/app/superset/reports/commands/execute.py", line 408, in send notification_content = self._get_notification_content() File "/app/superset/reports/commands/execute.py", line 334, in _get_notification_content screenshot_data = self._get_screenshots() File "/app/superset/reports/commands/execute.py", line 239, in _get_screenshots raise ReportScheduleScreenshotFailedError( superset.reports.commands.exceptions.ReportScheduleScreenshotFailedError: Failed taking a screenshot Message: 'geckodriver' executable needs to be in PATH. ``` #### chrome #### Screenshots If applicable, add screenshots to help explain your problem. ### Environment (please complete the following information): - browser type and version: - superset version: `superset version` - python version: `python --version` - node.js version: `node -v` - any feature flags active: ### Checklist Make sure to follow these steps 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. ### Additional context Add any other context about the problem here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org