apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
63.06k stars 13.96k forks source link

Problem with docker image for mysql and posgresql drivers #31162

Closed squalou closed 5 days ago

squalou commented 5 days ago

Bug description

I'm not sure if this is a bug, or intended behavior. Using Dockerfile, built image wont start, missing DB connectors.

What I do

Result

Superset will not start, I get the error

ModuleNotFoundError: No module named 'MySQLdb'

Workaround

I did edit Dockerfile added some packages to image (pkg-config python3-dev default-libmysqlclient-dev build-essential)

I added mysqclient to requirements/base.txt

Then rebuild image => superset starts.

In order to have my posgresql connections work, I added psycopg2 to requirements/base.txt too.

And finally things work.

Question

Is it expected (and if so, no problem, I'll keep doing it at each upgrade, not an issue), or am I missing something ?

Thanks for reading !

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.10

Node version

18 or greater

Browser

Firefox

Additional context

No response

Checklist

dosubot[bot] commented 5 days ago

@squalou Hello there! I'm here to assist you with any bugs, questions, or contributions related to Superset. Let's tackle this issue together!

Yes, it is expected behavior that you need to manually add MySQL and PostgreSQL drivers to the Docker image for Superset. Starting from version 4.1.0, the Docker image does not include these drivers by default. You need to install the necessary drivers for your metadata database (MySQL or PostgreSQL) and any other databases you connect to. This can be done by adding the required packages to a requirements-local.txt file or directly modifying the Dockerfile as you have done [1].

For your specific case, adding mysqlclient and psycopg2 to your Docker setup is the correct approach. This change is due to updates in the lean Docker image that official releases are based on [1].

To continue talking to Dosu, mention @dosu.