'Error deploying the apache:superset image on Kubernetes

I am trying to deploy the latest docker image apache:superset on Kubernetes. When I deploy the YAML I get below error:

[2021-04-29 01:34:10 +0000] [8] [INFO] Starting gunicorn 20.0.4
[2021-04-29 01:34:10 +0000] [8] [INFO] Listening at: http://0.0.0.0:8088 (8)
[2021-04-29 01:34:10 +0000] [8] [INFO] Using worker: gthread
[2021-04-29 01:34:10 +0000] [11] [INFO] Booting worker with pid: 11
logging was configured successfully
2021-04-29 01:34:12,332:INFO:superset.utils.logging_configurator:logging was configured successfully
2021-04-29 01:34:12,340:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
100.106.25.194 - - [29/Apr/2021:01:34:20 +0000] "GET / HTTP/1.1" 302 243 "-" "kube-probe/1.18"
/usr/local/lib/python3.7/site-packages/flask_caching/__init__.py:192: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
  "Flask-Caching: CACHE_TYPE is set to null, "
2021-04-29 01:34:20,145:WARNING:root:Class 'werkzeug.local.LocalProxy' is not mapped
2021-04-29 01:34:20,147:ERROR:root:DBEventLogger failed to log event(s)
2021-04-29 01:34:20,147:ERROR:root:(sqlite3.OperationalError) no such table: logs
[SQL: INSERT INTO logs (action, slice_id, json, dttm, duration_ms, referrer) VALUES (?, ?, ?, ?, ?, ?)]
[parameters: ('welcome', 0, '{"path": "/superset/welcome/", "object_ref": "Superset.welcome"}', '2021-04-29 01:34:20.147331', 0, 'http://100.106.25.213:8088/')]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
    cursor, statement, parameters, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: logs

It seems it is trying to connect to default SQLLite. I am trying to give postgres credentials in config.py but not able to modify the file in the image. I have below command in my Docker file:

USER root
COPY updated_config.py /app/superset/config.py
USER superset

the command runs fine but not updating the file.How can I update the config.py. I also tried using Config Map in YAML but that also gave error:

"ModuleNotFoundError: No module named 'superset.app'" 


Solution 1:[1]

  1. The error which you shared should happen only when we didn't run superset db upgrade.
  2. You should not replace complete default config file. Instead create new file and added necessary variables with export SUPERSET_CONFIG_PATH.

Here Dockerfile

FROM apache/superset
USER root

USER superset
EXPOSE 8088

RUN superset fab create-admin \
               --username admin \
               --firstname Superset \
               --lastname Admin \
               --email [email protected] \
               --password admin

COPY updated_config.py /app/config.py
RUN export SUPERSET_CONFIG_PATH=/app/config.py
RUN superset db upgrade

RUN superset init

I'll better suggest install superset through helm chart as you already using kubernetes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jagamts1