keerthanaturlapati opened a new issue #11600:
URL: https://github.com/apache/incubator-superset/issues/11600


   I am trying to install superset using k8s with PostgreSQL as backend 
database and redis as cache layer.
   
   Superset is up and running but when i try to run SQL queries, I am getting 
the following error
   
   "ERROR: relation "tab_state" does not exist at character 79"
   
   Below is are my config files and .yaml. I am a total beginner to the SRE 
world and unable to figure out what am I doing wrong. Any help is appreciated, 
thank you!
   
   ```
   #Source: superset/templates/secret.yaml
   apiVersion: v1
   kind: Secret
   metadata:
     name: superset
     labels:
       app: superset
       chart: superset-1.1.11
       release: superset
       heritage: Helm
       namespace: test
   type: Opaque
   data:
     superset_config.py: "attached seperately"
   ---
   # Source: superset/templates/svc.yaml
   apiVersion: v1
   kind: Service
   metadata:
     name: superset
     labels:
       app: superset
       chart: superset-1.1.11
       release: superset
       heritage: Helm
       namespace: test
   spec:
     type: ClusterIP
     ports:
       - name: http
         port: 9000
         targetPort: 8088
         protocol: TCP
     selector:
       app: superset
       release: superset
   ---
   # Source: superset/templates/deployment.yaml
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: superset 
     labels:
       app: superset
       chart: superset-1.1.11
       release: superset
       heritage: Helm
       namespace: test
   spec:
     replicas: 1
     selector:
       matchLabels:
         app: superset
         release: superset
     strategy:
       rollingUpdate:
         maxSurge: 25%
         maxUnavailable: 25%
       type: RollingUpdate
     template:
       metadata:
         name: superset
         labels:
           app: superset
           chart: superset-1.1.11
           release: superset
           heritage: Helm
         annotations:
           checksum/secrets: 
6dd9c87c415d8a5a00981f36d8dca6ad69a2fdeae29d0caa3a02633be4acff07
       spec:
         securityContext:
           runAsUser: 1000
           fsGroup: 1000
         volumes:
           - name: superset-configs
             secret:
               secretName: superset
           - name: storage-volume
             persistentVolumeClaim:
               claimName: superset-storage
         containers:
           - env:
             - name: PYTHONPATH
               value: "${PYTHONPATH}:/home/superset/superset/"
             image: amancevice/superset:0.36.0
             name: superset
             volumeMounts:
             - name: superset-configs
               mountPath: /home/superset/superset
             - name: storage-volume
               mountPath: /var/lib/superset
             ports:
             - name: http
               containerPort: 8088
               protocol: TCP
             livenessProbe:
               failureThreshold: 2
               httpGet:
                 path: /health
                 port: http
               initialDelaySeconds: 80
               periodSeconds: 10
               timeoutSeconds: 5
             readinessProbe:
               failureThreshold: 2
               httpGet:
                 path: /health
                 port: http
               initialDelaySeconds: 30
               periodSeconds: 10
               timeoutSeconds: 5
   ---
   
    #PVC
   
   apiVersion: v1
   kind: PersistentVolumeClaim
   metadata:
     name: superset-storage
     namespace: test
   spec:
     accessModes:
     - ReadWriteOnce
     resources:
       requests:
         storage: 1Gi
   ```
   
   
   **superset config file**
   
   ```
   import os
   
   def get_env_variable(var_name, default=None):
       """Get the environment variable or raise exception.
   
       Args:
           var_name (str): the name of the environment variable to look up
           default (str): the default value if no env is found
       """
       try:
           return os.environ[var_name]
       except KeyError:
           if default is not None:
               return default
           raise RuntimeError(
               'The environment variable {} was missing, abort...'
               .format(var_name)
           )
   
   # Postgres
   
   POSTGRES_USER =  '**'
   POSTGRES_PASSWORD = '**'
   POSTGRES_HOST = '**'
   POSTGRES_PORT = '**'
   POSTGRES_DB = '**'
   
   SQLALCHEMY_DATABASE_URI = 'postgresql://{0}:{1}@{2}:{3}/{4}'.format(
       POSTGRES_USER,
       POSTGRES_PASSWORD,
       POSTGRES_HOST,
       POSTGRES_PORT,
       POSTGRES_DB,
   )
   
   
   # Redis
   
   REDIS_HOST = '**' 
   REDIS_PORT = '**'
   
   
   # Celery
   
   class CeleryConfig:
       BROKER_URL = 'redis://{0}:{1}/0'.format(REDIS_HOST, REDIS_PORT)
       CELERY_IMPORTS = ('superset.sql_lab',)
       CELERY_RESULT_BACKEND = 'redis://{0}:{1}/1'.format(REDIS_HOST, 
REDIS_PORT)
       CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}}
       CELERY_TASK_PROTOCOL = 1
   
   
   CELERY_CONFIG = CeleryConfig
   
   FLASK_APP=superset
   ```
   
   
   **ERROR**
   
   ```
   [25038] ERROR:  relation "tab_state" does not exist at character 79
   [25038] STATEMENT:  SELECT tab_state.id AS tab_state_id, tab_state.label AS 
tab_state_label 
    FROM tab_state 
    WHERE tab_state.user_id = '2'
   ```


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