superset: Superset 3.0 - Example charts throw SQLite Error - no such table: main.FCC 2018 Survey
I have deployed Apache Superset 3.0 using Helm charts. The Helm chart version is superset-0.10.11, and the app version is 3.0.1. I’ve configured Superset to load example data (loadExamples set to true), but I’m encountering an issue on the dashboard with the error message ‘no such table: main.FCC 2018 Survey’ while opening one of the example charts. Below is the stack strace from app pods.
2023-11-01 14:46:36,834:WARNING:superset.connectors.sqla.models:Query SELECT country_live AS country_live
FROM main."FCC 2018 Survey"
GROUP BY country_live
LIMIT 1000
OFFSET 0 on schema main failed
Traceback (most recent call last):
File "/app/superset/connectors/sqla/models.py", line 1214, in query
df = self.database.get_df(sql, self.schema, mutator=assign_column_label)
File "/app/superset/models/core.py", line 611, in get_df
self.db_engine_spec.execute(cursor, sqls[-1])
File "/app/superset/db_engine_specs/base.py", line 1535, in execute
raise cls.get_dbapi_mapped_exception(ex) from ex
File "/app/superset/db_engine_specs/base.py", line 1533, in execute
cursor.execute(query)
sqlite3.OperationalError: no such table: main.FCC 2018 Survey
How to reproduce the bug
- Install Apache Superset Helm chart with version 0.10.11 and set loadExamples to true
- Login to Superset to app and open FCC New Coder Survey 2018 chart
Expected results
- It should load chart data
Actual results
- It throws error - no such table: main.FCC 2018 Survey
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 5
- Comments: 37 (12 by maintainers)
I think this is some regression in helm setup.
The
superset load_examplescommand that populatesexamples.dbis executed insuperset_init.shscript which is only run by init job. Init job spawnssuperset-init-dbwhich createsexamples.dbbut only in its own file system, so the file dies with it as pod exits.Workaround: Manually exec into
supersetpod and runsuperset load_examplesinside it to populateexamples.db.I think the proper solution here is not to use SQLite in k8s setup at all and populate examples into Postgres (by reusing existing DB or creating a new one), but this is a bit beyond what I feel comfortable contributing.
@dpgaspar Could you please take a look at this. I am not able to access any of the charts and getting no such table error. When I exec into superset pod, I can see that superset_home/examples.db file has zero size. When I run superset load_examples within pod, examples.db file gets recreated and then I am able to access all the charts.
This helped me. I cleaned superset: removed docker images, volumes and after running
docker-compose upwith fresh 3.1.1 version I logged into container using commanddocker exec -it superset_app /bin/bashand invoked commandsuperset load_examples. This recreated examples db.Re-opening the issue…
We’re trying to get to a sustainable Issues backlog, and it’s extremely helpful when Issues cover one reproducible bug, which would preferably be fixed by one PR. When issues contain two bugs and multiple PRs, it gets confusing, long discussion threads ensue, and tend not to get closed (we’re currently tidying up antique issues and are seeing a lot of this).
I also hit this issue on latest chart
0.10.14.If you go to
Settings / Database connectionsand doTest connectiononexamplesdatabase you will see an SQLite-related error saying it’s not a secure source.Per #17551 I added the following into my
values.yaml:This made connection test pass, however I was still getting
no such tableerrors.When I exec into
supersetpod I see thatsuperset_home/examples.dbfile has size of zero. I suspect thatsuperset-init-dbpod that according to logs seems to be setting up all the example tables is not writing to the same file superset pod is reading from…