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

<Style> element cannot be found by WebDriver bug #10488

Closed
3 tasks done
JasonD28 opened this issue Jul 31, 2020 · 4 comments
Closed
3 tasks done

<Style> element cannot be found by WebDriver bug #10488

JasonD28 opened this issue Jul 31, 2020 · 4 comments
Labels
!deprecated-label:bug Deprecated label - Use #bug instead

Comments

@JasonD28
Copy link
Contributor

JasonD28 commented Jul 31, 2020

https://github.com/apache/incubator-superset/blob/16459ad401d916d0ce7ca6ffa6775fdcb8a37ae8/superset-frontend/src/explore/components/ExploreChartPanel.jsx#L131 In #10302 this element was changed from <div> to <Styles> and now it cannot be located by WebDrivers. Specifically causing errors in the celery task alerts.run_query at https://github.com/apache/incubator-superset/blob/c9cb723cab321b82c3153f1a2b9fde27e9270106/superset/utils/screenshots.py#L162

Expected results

Celery task to find the element in the DOM without error

Actual results

[2020-07-30 16:24:16,303: ERROR/ForkPoolWorker-1] Selenium timed out
Stacktrace is abstracted behind https://github.com/apache/incubator-superset/blob/c9cb723cab321b82c3153f1a2b9fde27e9270106/superset/utils/screenshots.py#L171

[2020-07-30 17:40:23,038: ERROR/ForkPoolWorker-2] Task alerts.run_query[40817edc-ac3e-4f5c-899b-59a5f07fbf6e] raised unexpected: TimeoutException('', None, None)
Traceback (most recent call last):
  File "/Users/--/src/incubator-superset/super_venv/lib/python3.7/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/Users/--/src/incubator-superset/superset/app.py", line 115, in __call__
    return task_base.__call__(self, *args, **kwargs)
  File "/Users/--/src/incubator-superset/super_venv/lib/python3.7/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/Users/--/src/incubator-superset/superset/tasks/schedules.py", line 559, in schedule_alert_query
    if run_alert_query(schedule, dbsession):
  File "/Users/--/src/incubator-superset/superset/tasks/schedules.py", line 655, in run_alert_query
    deliver_alert(alert)
  File "/Users/--/src/incubator-superset/superset/tasks/schedules.py", line 591, in deliver_alert
    user=user, cache=thumbnail_cache, force=True,
  File "/Users/--/src/incubator-superset/superset/utils/screenshots.py", line 298, in compute_and_cache
    payload = self.get_screenshot(user=user, window_size=window_size)
  File "/Users/--/src/incubator-superset/superset/utils/screenshots.py", line 220, in get_screenshot
    self.screenshot = driver.get_screenshot(self.url, self.element, user)
  File "/Users/--/src/incubator-superset/superset/utils/screenshots.py", line 163, in get_screenshot
    EC.presence_of_element_located((By.CLASS_NAME, element_name))
  File "/Users/--/src/incubator-superset/super_venv/lib/python3.7/site-packages/selenium/webdriver/support/wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 

How to reproduce the bug

  1. install chromedriver
  2. set up config.py to enable alerting
ENABLE_ALERTS = True
FEATURE_FLAGS = {"THUMBNAILS": True}

THUMBNAIL_SELENIUM_USER = "Admin"
celery_alerting = {'alerts.schedule_check': {
        'task': 'alerts.schedule_check',
        'schedule': crontab(minute='*/1'),
    }}
CeleryConfig.CELERYBEAT_SCHEDULE.update(celery_alerting)
CELERY_CONFIG = CeleryConfig
  1. Go to Manage -> Alerts
  2. Create an alert
  3. Start a celery worker
  4. See error

Environment

  • superset version: 0.37
  • python version: 3.7.7

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.
@JasonD28 JasonD28 added the !deprecated-label:bug Deprecated label - Use #bug instead label Jul 31, 2020
@issue-label-bot
Copy link

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

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

@JasonD28 JasonD28 changed the title <Style> element cannot be found my WebDriver <Style> element cannot be found by WebDriver bug Jul 31, 2020
@mistercrunch
Copy link
Member

Screen Shot 2020-07-30 at 9 07 39 PM

Still turns into a <div> ... I'm not sure what is happening.

@willbarrett
Copy link
Member

@JasonD28 did you find a workaround? Did a recent change resolve this?

@JasonD28
Copy link
Contributor Author

@willbarrett I believe a recent change resolved this since I'm no longer experiencing this issue. I'm having trouble finding the exact change however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

No branches or pull requests

3 participants