Bug description

I was trying Superset 5.0.0-rc2 on WSL while connecting to a MySQL database, but the MySQL database option was not available in the selection list and trying to manually add mysqlclient from requirements-local.txt but ended as exited,looking at the Docker Compose logs, the issue stems from uv failing to build mysqlclient.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

superset_init | Reinstalling the app in editable mode superset_init | Resolved 149 packages in 1.24s superset_init | Building apache-superset @ file:///app superset_init | Built apache-superset @ file:///app superset_init | Prepared 1 package in 1.45s superset_init | Uninstalled 1 package in 0.61ms superset_init | warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance. superset_init | If the cache and target directories are on different filesystems, hardlinking may not be supported. superset_init | If this is intentional, set export UV_LINK_MODE=copy or use --link-mode=copy to suppress this warning. superset_init | Installed 1 package in 1ms superset_init | ~ apache-superset==5.0.0 (from file:///app) superset_init | Installing postgres requirements superset_init | Resolved 150 packages in 1.18s superset_init | Building apache-superset @ file:///app superset_init | Built apache-superset @ file:///app superset_init | Prepared 1 package in 1.44s superset_init | Uninstalled 1 package in 0.73ms superset_init | warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance. superset_init | If the cache and target directories are on different filesystems, hardlinking may not be supported. superset_init | If this is intentional, set export UV_LINK_MODE=copy or use --link-mode=copy to suppress this warning. superset_init | Installed 1 package in 1ms superset_init | ~ apache-superset==5.0.0 (from file:///app) superset_init | Installing local overrides at /app/docker/requirements-local.txt superset_init | Resolved 1 package in 693ms superset_init | Building mysqlclient==2.2.7 superset_init | × Failed to build mysqlclient==2.2.7 superset_init | ├─▶ The build backend returned an error superset_init | ╰─▶ Call to setuptools.build_meta.build_wheel failed (exit status: 1) superset_init | superset_init | [stdout] superset_init | Trying pkg-config --exists mysqlclient superset_init | Command 'pkg-config --exists mysqlclient' returned non-zero exit status superset_init | 127. superset_init | Trying pkg-config --exists mariadb superset_init | Command 'pkg-config --exists mariadb' returned non-zero exit status 127. superset_init | Trying pkg-config --exists libmariadb superset_init | Command 'pkg-config --exists libmariadb' returned non-zero exit status superset_init | 127. superset_init | Trying pkg-config --exists perconaserverclient superset_init | Command 'pkg-config --exists perconaserverclient' returned non-zero exit superset_init | status 127. superset_init | superset_init | [stderr] superset_init | /bin/sh: 1: pkg-config: not found superset_init | /bin/sh: 1: pkg-config: not found superset_init | /bin/sh: 1: pkg-config: not found superset_init | /bin/sh: 1: pkg-config: not found superset_init | Traceback (most recent call last): superset_init | File "", line 14, in superset_init | File superset_init | "/tmp/.tmpF1jJXV/builds-v0/.tmpbUFA86/lib/python3.10/site-packages/setuptools/build_meta.py", superset_init | line 331, in get_requires_for_build_wheel superset_init | return self._get_build_requires(config_settings, requirements=[]) superset_init | File superset_init | "/tmp/.tmpF1jJXV/builds-v0/.tmpbUFA86/lib/python3.10/site-packages/setuptools/build_meta.py", superset_init | line 301, in _get_build_requires superset_init | self.run_setup() superset_init | File superset_init | "/tmp/.tmpF1jJXV/builds-v0/.tmpbUFA86/lib/python3.10/site-packages/setuptools/build_meta.py", superset_init | line 317, in run_setup superset_init | exec(code, locals()) superset_init | File "", line 156, in superset_init | File "", line 49, in get_config_posix superset_init | File "", line 28, in find_package_name superset_init | Exception: Can not find valid pkg-config name. superset_init | Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually superset_init | superset_init | hint: This usually indicates a problem with the package or the build superset_init | environment. superset_init exited with code 1 Gracefully stopping... (press Ctrl+C again to force) service "superset-init" didn't complete successfully: exit 1

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

Hello @WibowoS26! I'm here to help you solve bugs, answer questions, and navigate your way to becoming a contributor. While you're waiting for a human maintainer, feel free to ask me anything you need assistance with!

To resolve the issue of the missing MySQL connector in Superset 5.0.0-rc2 due to a failure to build mysqlclient because of missing pkg-config, you need to ensure that pkg-config is installed in the Docker container. You can modify your Dockerfile to include the installation of pkg-config as follows:

# Ensure pkg-config is installed
RUN /app/docker/apt-install.sh pkg-config

# Ensure mysqlclient is installed
RUN pip install mysqlclient

Make sure to rebuild your Docker image after making these changes.

Additionally, if you are deploying Superset in a Kubernetes environment, you can modify your values.yaml file to include a bootstrap script that installs the necessary system-level dependencies and Python packages for MySQL support:

bootstrapScript: |
  #!/bin/bash

  # Install system-level dependencies
  apt-get update && apt-get install -y \
    python3-dev \
    default-libmysqlclient-dev \
    build-essential \
    pkg-config

  # Install required Python packages
  pip install \
    authlib \
    psycopg2-binary \
    mysqlclient

  # Create bootstrap file if it doesn't exist
  if [ ! -f ~/bootstrap ]; then
    echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap
  fi

This script will ensure that both the system-level dependencies and the required Python packages are installed, enabling MySQL support in Superset [1][2][3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Comment From: rusackas

I'm not sure if this is Windows-specific, but @eschutho was asking to hear what sort of trouble Windows folks run into in hopes that we might one day officially support it.

Comment From: WibowoS26

@rusackas this is my first time find this issue on wsl, last time i run version 4.0.0 on wsl it run without a problem. Need to check it on my linux box

Comment From: rusackas

@dosu

Comment From: dosubot[bot]

The missing MySQL connector in Superset 5.0.0-rc2 on WSL is caused by a change in the Dockerfile: system dependencies like pkg-config and default-libmysqlclient-dev—needed to build mysqlclient—are now only installed in the dev image, not the main image. This means if you’re not using the dev image, adding mysqlclient to requirements-local.txt will fail unless those system packages are present in your Docker environment. This is why it worked in 4.x but not in 5.x, where dependency handling became stricter and more explicit source.

To fix this, make sure your Dockerfile (or build process) installs both pkg-config and default-libmysqlclient-dev before installing mysqlclient. For example:

RUN /app/docker/apt-install.sh pkg-config default-libmysqlclient-dev

Then rebuild your image. If you’re using Docker Compose, you can also switch to the dev image, which already includes these dependencies source.

On WSL/Windows, common pitfalls include missing system packages, filesystem quirks, and issues with Docker volume mounts. Using WSL2 with Ubuntu and sticking to the dev image or ensuring all required apt packages are installed inside your container will help avoid most problems source.

If you need more details or want to discuss Windows-specific workarounds, let me know!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: rusackas

I believe the bot is quite right, and this should be sufficient to close the issue, but let me know if you feel otherwise :D