You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/10/09 01:09:54 UTC

[GitHub] [incubator-superset] hitesh-goel opened a new issue #8359: I am keep on getting the Results backend isn't configured while using redis celery

hitesh-goel opened a new issue #8359: I am keep on getting the Results backend isn't configured while using redis celery
URL: https://github.com/apache/incubator-superset/issues/8359
 
 
   Error:
   
   ```
   [2019-10-09 00:51:50,804: ERROR/ForkPoolWorker-1] Results backend isn't configured.
   Traceback (most recent call last):
     File "/usr/local/lib/python3.6/dist-packages/superset/sql_lab.py", line 144, in get_sql_results
       start_time=start_time,
     File "/usr/local/lib/python3.6/dist-packages/superset/sql_lab.py", line 249, in execute_sql_statements
       raise SqlLabException("Results backend isn't configured.")
   superset.sql_lab.SqlLabException: Results backend isn't configured.
   ```
   
   my superset_config.py file contains:
   
   ```
   # Licensed to the Apache Software Foundation (ASF) under one
   # or more contributor license agreements.  See the NOTICE file
   # distributed with this work for additional information
   # regarding copyright ownership.  The ASF licenses this file
   # to you under the Apache License, Version 2.0 (the
   # "License"); you may not use this file except in compliance
   # with the License.  You may obtain a copy of the License at
   #
   #   http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing,
   # software distributed under the License is distributed on an
   # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   # KIND, either express or implied.  See the License for the
   # specific language governing permissions and limitations
   # under the License.
   import os
   from celery.schedules import crontab
   
   
   def get_env_variable(var_name, default=None):
       """Get the environment variable or raise exception."""
       try:
           return os.environ[var_name]
       except KeyError:
           if default is not None:
               return default
           else:
               error_msg = 'The environment variable {} was missing, abort...'\
                           .format(var_name)
               raise EnvironmentError(error_msg)
   
   
   POSTGRES_USER = get_env_variable('POSTGRES_USER')
   POSTGRES_PASSWORD = get_env_variable('POSTGRES_PASSWORD')
   POSTGRES_HOST = get_env_variable('POSTGRES_HOST')
   POSTGRES_PORT = get_env_variable('POSTGRES_PORT')
   POSTGRES_DB = get_env_variable('POSTGRES_DB')
   
   # The SQLAlchemy connection string.
   SQLALCHEMY_DATABASE_URI = 'postgresql://%s:%s@%s:%s/%s' % (POSTGRES_USER,
                                                              POSTGRES_PASSWORD,
                                                              POSTGRES_HOST,
                                                              POSTGRES_PORT,
                                                              POSTGRES_DB)
   
   REDIS_HOST = get_env_variable('REDIS_HOST')
   REDIS_PORT = get_env_variable('REDIS_PORT')
   
   class CeleryConfig(object):
       BROKER_URL = 'redis://%s:%s/0' % (REDIS_HOST, REDIS_PORT)
       CELERY_IMPORTS = ('superset.sql_lab', 'superset.tasks',)
       CELERY_RESULT_BACKEND = 'redis://%s:%s/1' % (REDIS_HOST, REDIS_PORT)
       CELERY_ANNOTATIONS = {
           'tasks.add': {
               'rate_limit': '10/s'
           },
           'sql_lab.get_sql_results': {
               'rate_limit': '100/s'
           }
       }
       CELERY_TASK_PROTOCOL = 1
   
   CELERY_CONFIG = CeleryConfig
   ```
   
   Log on running celery worker is 
   
   ```
   # celery worker --app=superset.sql_lab:celery_app --pool=prefork -Ofair -c 4
   Loaded your LOCAL configuration at [/usr/local/lib/python3.6/dist-packages/superset/superset_config.py]
   2019-10-09 01:06:55,044:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
   /usr/local/lib/python3.6/dist-packages/celery/platforms.py:801: RuntimeWarning: You're running the worker with superuser privileges: this is
   absolutely not recommended!
   
   Please specify a different user using the --uid option.
   
   User information: uid=0 euid=0 gid=0 egid=0
   
     uid=uid, euid=euid, gid=gid, egid=egid,
   
    -------------- celery@ip-xxx-xx-xx-xx v4.3.0 (rhubarb)
   ---- **** -----
   --- * ***  * -- Linux-4.15.0-1044-aws-x86_64-with-Ubuntu-18.04-bionic 2019-10-09 01:06:55
   -- * - **** ---
   - ** ---------- [config]
   - ** ---------- .> app:         __main__:0x7f94fd163ac8
   - ** ---------- .> transport:   redis://ec2-host:6379/0
   - ** ---------- .> results:     redis://ec2-host:6379/1
   - *** --- * --- .> concurrency: 4 (prefork)
   -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
   --- ***** -----
    -------------- [queues]
                   .> celery           exchange=celery(direct) key=celery
   
   
   
   ```
   
   with all the environment variables setup. it keeps on giving me error.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org