Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Can't get ALERTS & REPORTS working. Error: Failed taking a screenshot Message: 'geckodriver' executable needs to be in PATH. #28686

Closed
3 tasks
mujohiddin opened this issue May 24, 2024 · 4 comments
Labels
alert-reports Namespace | Anything related to the Alert & Reports feature

Comments

@mujohiddin
Copy link

Bug description

Hello there. my project is last september version but i have problem with ALERT & REPORTS how to fix it. I don't know how to fix it. help me

How to reproduce the bug

1

Screenshots/recordings

photo_2024-05-24_09-58-21

Could this be the cause of the problem?

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

1

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the alert-reports Namespace | Anything related to the Alert & Reports feature label May 24, 2024
Copy link

dosubot bot commented May 24, 2024

To address the issue with the ALERT & REPORTS feature in your Superset project, follow these steps:

  1. Check the "ALERT_REPORTS" Feature Flag: Ensure it's enabled in your superset_config.py:

    FEATURE_FLAGS = {
        "ALERT_REPORTS": True
    }
  2. Update Celery Beat Schedule: Ensure you have a schedule for reports.scheduler in your Celery configuration:

    from celery.schedules import crontab
    
    class CeleryConfig:
        beat_schedule = {
            "reports.scheduler": {
                "task": "reports.scheduler",
                "schedule": crontab(minute="*", hour="*"),
            },
            "reports.prune_log": {
                "task": "reports.prune_log",
                "schedule": crontab(minute=0, hour=0),
            },
        }
    CELERY_CONFIG = CeleryConfig
  3. Ensure Browser Installation for Screenshots: Confirm a headless browser is installed. For Chrome:

    WEBDRIVER_TYPE = "chrome"
    WEBDRIVER_OPTION_ARGS = [
        "--force-device-scale-factor=2.0",
        "--high-dpi-support=2.0",
        "--headless",
        "--disable-gpu",
        "--disable-dev-shm-usage",
        "--no-sandbox",
        "--disable-setuid-sandbox",
        "--disable-extensions",
    ]
  4. SMTP or Slack Configuration: Ensure your SMTP settings or SLACK_API_TOKEN are correctly configured:

    • Slack:
      SLACK_API_TOKEN = "xoxb-your-slack-token"
    • Email:
      SMTP_HOST = "smtp.sendgrid.net"
      SMTP_PORT = 2525
      SMTP_USER = "your_user"
      SMTP_PASSWORD = "your_password"
      SMTP_MAIL_FROM = "[email protected]"
  5. Review Celery Worker and Beat Logs: Examine the logs of your Celery worker and beat for additional insights.

  6. Fix the "Failed to assign to property 'Path'" Error: Ensure that the properties being assigned are correctly defined and used. For example:

    const updateAlertState = (name: string, value: any) => {
      setCurrentAlert(currentAlertData => ({
        ...currentAlertData,
        [name]: value,
      }));
    };
    
    const onPathChange = (event: React.ChangeEvent<HTMLInputElement>) => {
      const { value } = event.target;
      updateAlertState('path', value);
    };

Ensure all configurations, especially those related to Celery, the headless browser, and notification settings, are correct. For more detailed guidance, refer to the Superset documentation [1][2][3].

Details

About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@fzhan
Copy link

fzhan commented May 24, 2024

@mujohiddin what does your celery status say?

@gaful
Copy link

gaful commented May 24, 2024

Hello,
It seems that you have 2 issue :

  1. issue with sending email : what does your system logs says ? they are usually quite usefull.

  2. issue with capturing image : from the documentation https://superset.apache.org/docs/configuration/alerts-reports/

You must install a headless browser, for taking screenshots of the charts and dashboards. Only Firefox and Chrome are currently supported.
If you choose Chrome, you must also change the value of WEBDRIVER_TYPE to "chrome" in your superset_config.py.

Note: All the components required (Firefox headless browser, Redis, Postgres db, celery worker and celery beat) are present in the dev docker image if you are following Installing Superset Locally. All you need to do is add the required config variables described in this guide (See Detailed Config).

By the way I would recommend to make it works for csv or txt first and then moove to image

@sfirke
Copy link
Member

sfirke commented May 24, 2024

Yes please see the docs that @gaful linked. I'm going to convert this to a Discussion, as it is not a bug report of a problem with Superset but instead a request for help getting the configuration set up. Try searching GitHub Discussions and Issues for that error message, it has come up before, e.g. #23057. It has also been addressed in the Slack chat that is open to the public.

@sfirke sfirke changed the title Superset ALERT & REPORTS not working Can't get ALERTS & REPORTS working. Error: Failed taking a screenshot Message: 'geckodriver' executable needs to be in PATH. May 24, 2024
@apache apache locked and limited conversation to collaborators May 24, 2024
@sfirke sfirke converted this issue into discussion #28698 May 24, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
alert-reports Namespace | Anything related to the Alert & Reports feature
Projects
None yet
Development

No branches or pull requests

4 participants