-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to add a SQLite DB #9748
Comments
Superset is going to drop support for SQLLite, for now you can override this by setting |
@dpgaspar Thanks. It works! While I looked up the setting, I found the pull request. It seems like it doesn't convert the examples to use another database tho. |
Is there a reason to drop sqlite? |
I installed via docker, any instruction on overwrite |
Happy to clarify some things here, first the project is dropping support for SQLLite as a metadata database, as it's simply not reliable to support a multi-web servers, multi-workers type of setup which is a fairly basic assumption for an application like Superset in production. As soon as you fire off multiple web workers or thread, you're likely to have issues with SQLLite locks. Given that and the fact that we had a fair amount of SQLLite-specific bugs and regressions (namely around database-migrations and DDL in general), we decided that we would not actively support it. Now OP was asking about SQLLite as an analytics database, which may/could work in some capacity, assuming the file is mounted / visible from all the processes in the application. This can be done by flipping the feature flag that @dpgaspar pointed to, but may introduce security risk, where a user may be able to access some other SQLLite database living on the local filesystem (other applications or systems on the local machine could use a SQLLite database in a deterministic location, and a hacker could obtain access to it and potentially modify it if the OS rules allow the |
Hi, Did you find how to do it? |
Wrote a blog post about it, and managed to overwrite |
Hi, facing the same error in Windows but editing the config.py and including CSV doesn't remove the error. Using Python 3.8 and Windows 10 for context and a SQLite database. Does anyone have an idea of what could be causing this? |
It would be helpful to support sqlite databases. I work at a hospital and it would be very helpful to analyze health records data with sqlite rather than hosting my own mysql database. Thank you! |
- superset_config.py flag - Add parent git repo treasury SQLITEDB See issue apache#9748
Well I was pretty excited about superset and spent a lot of time setting it up for a small scale self-hosted solution. Now I'm rather disappointed. Do you know how many of your users use SQLite? |
An ugly (but working) hack for those who want to alter the Docker image:
This only works, because config.py defines the variables on the global level, so the last variable definition wins :) |
This is so helpful! Thank you @kopytjuk Can we please reopen this issue? Desperately need sqlite because we are a small nonprofit and cannot use anything more. |
add line at the bottom |
The excellent news is sqlite connection is still working as of today's date once I added PREVENT_UNSAFE_DB_CONNECTIONS = False. Please keep sqlite as an option and document it as non-production use only. Many use cases where you have a sqlite.db file full of data and want to impress folks by connecting that data to superset. |
@mistercrunch my intent is not to reopen this issue, but more to use this issue for context - It's a bit frustrating to use the official dockerhub image only to have the examples not work/load and having to stumble across the fact that SQLite was removed. Might make sense to remove the examples, or change them such that they work out of the box |
Did something change again? I can't make it work with I agree with @neiz here. It's just frustrating that it is advertised but than once you try to connect it's not allowed. I honestly also don't get this silly security concern if I want to run it locally... |
this link is not working |
Still trying to make SQLite work on the official Docker image, if anyone has a solution. I managed to remove the warning by mounting a modified curl --remote-name https://raw.githubusercontent.com/apache/superset/master/superset/config.py # download config.py file
vi config.py # add the line ~PREVENT_UNSAFE_DB_CONNECTIONS = False~ inside the file, before the line containing "WARNING: STOP EDITING HERE"
docker run -d -p 8080:8088
-e "SUPERSET_SECRET_KEY=your_secret_key_here"
-v /path/to/modified/config.py:/app/superset/config.py # mount local config.py
--name superset apache/superset
docker exec -it superset superset fab create-admin \
--username admin \
--firstname Superset \
--lastname Admin \
--email admin@superset.com \
--password admin
docker exec -it superset superset db upgrade
docker exec -it superset superset init The above removes the SQLite security warning, but trying to connect to the db triggers a I tried to connect with |
Any news? |
@harabat did you figure out that error? I get the same error.
|
@gramakri unfortunately not, had to go with other tools instead. |
Managed to get it to work, am using docker compose for ease of use docker-compose.yaml version: '3'
services:
superset:
image: apache/superset
ports:
- 8088:8088
volumes:
- /home/pjaol/flows/data:/var/data # where my data resides
- superset_db:/app/superset_home # persist config across restarts
environment:
- SUPERSET_CONFIG_PATH=/var/data/superset_config.py
- SUPERSET_SECRET_KEY=something_random
volumes:
superset_db: And superset_config.py # Superset configuration file
PREVENT_UNSAFE_DB_CONNECTIONS=False When using an absolute path ensure you are using 4 forward slashes sqlite:////var/data/data.db in my case |
Hello, I realized there is a way you can upload the sqlite to superset but the issue is that in the SQL Lab you cannot see the tables. Use the following format: Would really appreciate if someone found a way to make the tables in the database readable or visible in the datasets menu, otherwise we are still so close but still so far. Prior to this ensure you have turned |
I tried to add a db located at "/home/hc/superset/db/test.db" to superset via "Sources->Databases->Add a new record". I set "sqlite:////home/hc/superset/db/test.db" as SQLAlchemy URI, and hit "Test Connection". And it says, "ERROR: SQLite database cannot be used as a data source for security reasons."
Make sure these boxes are checked before submitting your issue - thank you!
The text was updated successfully, but these errors were encountered: