Lemmynjash opened a new issue #13666:
URL: https://github.com/apache/superset/issues/13666


   Hi Guys
   Just configured celery but when I run it, it gives me this error
   
   [```
   2021-03-17 13:38:23,830: ERROR/ForkPoolWorker-3] Failed at generating 
thumbnail Instance <User at 0x7fbb4b1b8220> is not bound to a Session; 
attribute refresh operation cannot proceed (Background on this error at: 
http://sqlalche.me/e/13/bhk3)
   Failed at generating thumbnail Instance <User at 0x7fbb4b295fa0> is not 
bound to a Session; attribute refresh operation cannot proceed (Background on 
this error at: http://sqlalche.me/e/13/bhk3)
   ```
   
   I do have a user on superset database by the username as **admin**
   
   This is my config.py
   ```
   FEATURE_FLAGS = { "THUMBNAILS" : True, "LISTVIEWS_DEFAULT_CARD_VIEW" : 
False, "ALERT_REPORTS": True}
   CACHE_CONFIG: CacheConfig = {
       'CACHE_TYPE': 'redis',
       'CACHE_DEFAULT_TIMEOUT': 24*60*60, # 1 day
       'CACHE_KEY_PREFIX': 'superset_',
       'CACHE_REDIS_URL': 'redis://localhost:6379/3'
   }
   DATA_CACHE_CONFIG: CacheConfig = {
       'CACHE_TYPE': 'redis',
       'CACHE_DEFAULT_TIMEOUT': 24*60*60, # 1 day
       'CACHE_KEY_PREFIX': 'data_',
       'CACHE_REDIS_URL': 'redis://localhost:6379/3'
   }
   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/3'
   }
   # Used for thumbnails and other api: Time in seconds before selenium
   # times out after trying to locate an element on the page and wait
   # for that element to load for an alert screenshot.
   SCREENSHOT_LOCATE_WAIT = 100
   SCREENSHOT_LOAD_WAIT = 600
   class CeleryConfig:  # pylint: disable=too-few-public-methods
       # BROKER_URL = "sqla+sqlite:///celerydb.sqlite"
       BROKER_URL = "redis://localhost:6379/4"
       CELERY_IMPORTS = ("superset.sql_lab", "superset.tasks", 
"superset.tasks.thumbnails")
       CELERY_RESULT_BACKEND = "redis://localhost:6379/4"
       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),
           },
           'cache-warmup-hourly': {
               'task': 'cache-warmup',
               'schedule': crontab(minute='*/30', hour='*'),
               'kwargs': {
                   'strategy_name': 'top_n_dashboards',
                   'top_n': 10,
                   'since': '7 days ago',
               },
          },
       }
   CELERY_CONFIG = CeleryConfig  # pylint: disable=invalid-name
   ```
    What am I missing!!
   Kindly assist?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to