apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.31k stars 13.68k forks source link

Dashboards Will Not Load with GLOBAL_ASYNC_QUERIES #14303

Closed ddxdental closed 3 years ago

ddxdental commented 3 years ago

Fresh install of superset 1.0.1. Dashboards will not open. I have GLOBAL_ASYNC_QUERIES enabled, but the client side poll never resolved. This is similar to issue #14138, but that issue is when global_async is off

Expected results

Dashboard opens ;)

Actual results

Attempting to open a dashboard leaves you stuck on the loader. The async poll process runs indefinately. There is no error recorded in the browser console, or the server log.

Screenshots

https://user-images.githubusercontent.com/14878744/115754678-d3350a80-a372-11eb-908a-304782229ddb.mp4

Environment

superset version: 1.0.1 python version: 3.8.8 node.js version: not installed

Checklist

Make sure to follow these steps before submitting your issue - thank you!

Additional context

superset_config.py template from ansible

from celery.schedules import crontab

FLASK_APP = '{{ superset_app_name }}'
APP_NAME = '{{ superset_app_name }}'

# Superset specific config
ROW_LIMIT = 5000

# Superset webserver port
SUPERSET_WEBSERVER_PORT = {{ superset_port }}
# Superset webserver address
SUPERSET_WEBSERVER_ADDRESS = '{{ superset_address }}'
# Superset upload folder
UPLOAD_FOLDER = '{{ superset_upload_folder_path }}'
IMG_UPLOAD_FOLDER = '{{ superset_upload_img_folder_path }}'

# Flask App Builder configuration
# Your App secret key
SECRET_KEY = '\2\{{ superset_flask_app_secret_key }}\1\2\e\y\y\h'

# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
SQLALCHEMY_DATABASE_URI = '{{ superset_sqlalchemy_database_uri }}'

# Flask-WTF flag for CSRF
WTF_CSRF_ENABLED = False
# Add endpoints that need to be exempt from CSRF protection
WTF_CSRF_EXEMPT_LIST = []
# A CSRF token that expires in 1 year
WTF_CSRF_TIME_LIMIT = 60 * 60 * 24 * 365

APP_ICON = "https://www.ddxdental.com/images/marketing/logo-ddx-small.png"
APP_ICON_WIDTH = 70
MAPBOX_API_KEY = "{{ mabbox_api }}"
FAVICONS = [{"href": "https://www.ddxdental.com/wp-content/uploads/2017/05/DDXOS_Favicon2.jpg"}]

CACHE_CONFIG = {
    'CACHE_TYPE': 'redis',
    'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24, # 1 day default (in secs)
    'CACHE_KEY_PREFIX': 'superset_results',
    'CACHE_REDIS_URL': 'redis://localhost:6379/0',
}

DATA_CACHE_CONFIG = {
    'CACHE_TYPE': 'redis',
    'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24, # 1 day default (in secs)
    'CACHE_KEY_PREFIX': 'superset_results',
    'CACHE_REDIS_URL': 'redis://localhost:6379/0',
}

class CeleryConfig:  # pylint: disable=too-few-public-methods
    BROKER_URL = "redis://localhost:6379/0"
    CELERY_IMPORTS = ("superset.sql_lab", "superset.tasks")
    CELERY_RESULT_BACKEND = "redis://localhost:6379/0"
    CELERYD_LOG_LEVEL = "DEBUG"
    CELERYD_PREFETCH_MULTIPLIER = 1
    CELERY_ACKS_LATE = False
    CELERY_ANNOTATIONS = {
        "sql_lab.get_sql_results": {"rate_limit": "100/s"},
        "email_reports.send": {
            "rate_limit": "1/s",
            "time_limit": 120,
            "soft_time_limit": 150,
            "ignore_result": True,
        },
    }
    CELERYBEAT_SCHEDULE = {
        "email_reports.schedule_hourly": {
            "task": "email_reports.schedule_hourly",
            "schedule": crontab(minute=1, hour="*"),
        },
        "reports.scheduler": {
            "task": "reports.scheduler",
            "schedule": crontab(minute="*", hour="*"),
        },
        "reports.prune_log": {
            "task": "reports.prune_log",
            "schedule": crontab(minute=0, hour=0),
        },
        'cache-warmup-hourly': {
            'task': 'cache-warmup',
            'schedule': crontab(minute=0, hour='*'),  # hourly
            'kwargs': {
                'strategy_name': 'top_n_dashboards',
                'top_n': 5,
                'since': '7 days ago',
            },
        },
    }

CELERY_CONFIG = CeleryConfig  # pylint: disable=invalid-name

GLOBAL_ASYNC_QUERIES_JWT_SECRET = "{{ superset_flask_app_secret_key }}"

FEATURE_FLAGS = {
    "GLOBAL_ASYNC_QUERIES": True,
    "DASHBOARD_NATIVE_FILTERS": True,
    "ALERTS_REPORTS": True,
    "DYNAMIC_PLUGINS": True
}

EMAIL_NOTIFICATIONS = True
SMTP_HOST = "smtp.sparkpostmail.com"
SMTP_STARTTLS = True
SMTP_SSL = False
SMTP_USER = "SMTP_Injection"
SMTP_PORT = 587
SMTP_PASSWORD = "{{ sparkpost }}"
SMTP_MAIL_FROM = "team@ddxdental.com"
ddxdental commented 3 years ago

Updated to 1.1.0 This resolved the issue