DwijadasDey opened a new issue #18644:
URL: https://github.com/apache/superset/issues/18644
Hi
I have recently upgraded Superset to 1.14 from 1.13. Most of the
configuration settings for 1.13 are working in 1.14. However, there is
an issue with caching thumbnails for dashboards/charts. Selenium timed out
while requesting dashboard/chart URL with following error.
```
Init selenium driver
Caching dashboard: http://127.0.0.1:8088/superset/dashboard/10/
Processing url for thumbnail: 924d166e089126c4dbe9219bae9f9578
Selenium timed out requesting url
http://127.0.0.1:8088/superset/dashboard/7/?standalone=3
Traceback (most recent call last):
File "/u01/venv/lib/python3.8/site-packages/superset/utils/webdriver.py",
line 122, in get_screenshot
element = WebDriverWait(driver, self._screenshot_locate_wait).until(
File
"/u01/venv/lib/python3.8/site-packages/selenium/webdriver/support/wait.py",
line 89, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
#0 0x55c7f1917113 <unknown>
#1 0x55c7f13df6d8 <unknown>
#2 0x55c7f14158c1 <unknown>
#3 0x55c7f1415a81 <unknown>
#4 0x55c7f1448b84 <unknown>
#5 0x55c7f143308d <unknown>
#6 0x55c7f144690b <unknown>
#7 0x55c7f1432f53 <unknown>
#8 0x55c7f1408bda <unknown>
#9 0x55c7f1409ca5 <unknown>
#10 0x55c7f19488dd <unknown>
#11 0x55c7f1961a9b <unknown>
#12 0x55c7f194a6b5 <unknown>
#13 0x55c7f1962725 <unknown>
#14 0x55c7f193e08f <unknown>
#15 0x55c7f197f188 <unknown>
#16 0x55c7f197f308 <unknown>
#17 0x55c7f1999a6d <unknown>
#18 0x7f307482eea5 <unknown>
Report state: Failed taking a screenshot local variable 'element' referenced
before assignment
```
**superset_config.py**
```
from celery.schedules import crontab
from superset.typing import CacheConfig
FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"THUMBNAILS" : True,
"LISTVIEWS_DEFAULT_CARD_VIEW" : True,
"ENABLE_REACT_CRUD_VIEWS" : True,
"THUMBNAILS_SQLA_LISTENERS": True
}
REDIS_HOST = "localhost"
REDIS_PORT = "6379"
class CeleryConfig:
BROKER_URL = 'redis://%s:%s/0' % (REDIS_HOST, REDIS_PORT)
CELERY_IMPORTS = ('superset.sql_lab', "superset.tasks",
"superset.tasks.thumbnails", )
CELERY_RESULT_BACKEND = 'redis://%s:%s/0' % (REDIS_HOST, REDIS_PORT)
CELERYD_LOG_LEVEL = 'DEBUG'
CELERYD_PREFETCH_MULTIPLIER = 10
CELERY_ACKS_LATE = True
CELERY_ANNOTATIONS = {
'sql_lab.get_sql_results': {
'rate_limit': '100/s',
},
'email_reports.send': {
'rate_limit': '1/s',
'time_limit': 600,
'soft_time_limit': 600,
'ignore_result': True,
},
}
CELERYBEAT_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
SCREENSHOT_LOCATE_WAIT = 100
SCREENSHOT_LOAD_WAIT = 600
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"
]
# This is for internal use, you can keep http
WEBDRIVER_BASEURL="http://localhost:8088"
# This is the link sent to the recipient, change to your domain eg.
https://superset.mydomain.com
WEBDRIVER_BASEURL_USER_FRIENDLY="http://localhost:8088"
#cache config
CACHE_DEFAULT_TIMEOUT = 86400
CACHE_CONFIG = {
'CACHE_TYPE': 'redis',
'CACHE_DEFAULT_TIMEOUT': 86400,
'CACHE_KEY_PREFIX': 'superset_',
'CACHE_REDIS_HOST': 'localhost',
'CACHE_REDIS_PORT': 6379,
'CACHE_REDIS_DB': 1,
'CACHE_REDIS_URL': 'redis://localhost:6379/0'
}
#Result backend
from werkzeug.contrib.cache import RedisCache
RESULTS_BACKEND = RedisCache(
host='localhost', port=6379, key_prefix='superset_results')
# Thumbnail Cache
THUMBNAIL_SELENIUM_USER = "admin"
THUMBNAIL_CACHE_CONFIG: CacheConfig = {
'CACHE_TYPE': 'redis',
'CACHE_DEFAULT_TIMEOUT': 24*60*60,
'CACHE_KEY_PREFIX': 'thumbnail_',
'CACHE_NO_NULL_WARNING': True,
'CACHE_REDIS_URL': 'redis://localhost:6379/0'
}
```
Apache Superset 1.14
Python 3.8.1
Chromedriver 98.0.4758.80
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]