Bug description

After Upgrading Superset to 5.0.0 (release), I can't query my Apache Doris (3.0.6) Installation - Dashboards are fine.

Error: Apache Doris Error: (MySQLdb.OperationalError) (2013, "Lost connection to server at 'reading authorization packet', system error: 11")

(Background on this error at: https://sqlalche.me/e/14/e3q8)

This may be triggered by: Issue 1002 - The database returned an unexpected error. See less

Screenshots/recordings

Image

Superset version

5.0.0

Python version

3.11

Node version

Not applicable

Browser

Chrome

Additional context

No response

Checklist

  • [ ] 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.
  • [ ] 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]

Hi @wakkorottix! I'm Dosu and I’m helping the superset team.

This error is likely caused by a driver mismatch or missing driver after the upgrade. Superset expects the pydoris driver for Doris connections—if it's missing or not registered, SQLAlchemy may fall back to a MySQL driver like MySQLdb, which can cause handshake/authentication errors like the one you’re seeing (source).

Check that the pydoris package is installed in your environment and that your Doris connection URI uses the correct dialect (e.g., doris:// or pydoris://). If you see mysql:// or mysqldb:// in your connection string, update it to use the Doris driver. There are no breaking changes in Superset 5.0.0 that would affect Doris connections directly, but the environment and installed drivers are critical for compatibility (source).

If pydoris is installed and the URI is correct but the issue persists, try reinstalling the driver or testing the connection outside of Superset to isolate the problem. Let me know if you need help with the exact connection string format or further troubleshooting.

To reply, just mention @dosu.


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

Comment From: wakkorottix

@dosu pydoris is installed - upgraded from 1.0.3 (superset) pi@pi5b:~ $ pip list |grep doris pydoris 1.0.6

Test Database also works with doris://bme280:XXXXXXXXXX@pi5b:9030/bme280 or pydoris://bme280:XXXXXXXXXX@pi5b:9030/bme280

also a fresh install didn't help

Comment From: dosubot[bot]

Thanks for confirming pydoris is installed and the connection string is correct. Superset 5.0.0 is designed to use pydoris for Doris connections, and there are no known compatibility issues or breaking changes in this area—if you see MySQLdb.OperationalError, it usually means Superset is falling back to a MySQL driver, often because pydoris isn’t being picked up by SQLAlchemy as expected12.

A few things to check: - Make sure the Python environment running Superset is the same one where you installed pydoris (sometimes there are multiple environments or virtualenv confusion). - Double-check that the connection URI in Superset’s database config is exactly doris:// or pydoris:// (not mysql://). - Try restarting all Superset processes after upgrading pydoris to ensure the new driver is loaded. - If possible, run a quick SQLAlchemy test outside Superset to confirm pydoris is registered and can connect.

If you can, grab the detailed Superset logs for a failed Doris query—sometimes the stacktrace gives more clues about where the fallback is happening.

To reply, just mention @dosu.


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

Comment From: wakkorottix

@dosu pydoris is installed in the environment, because i can test the connection and it's fine.

The only errors in the log i can found are: Jun 28 14:27:14 pi5b gunicorn[5583]: sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:doris Jun 28 14:27:14 pi5b gunicorn[5583]: 2025-06-28 14:27:14,873:ERROR:superset.views.error_handling:Can't load plugin: sqlalchemy.dialects:doris Jun 28 14:27:14 pi5b gunicorn[5583]: sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:doris

Jul 04 18:04:08 pi5b gunicorn[72297]: superset.exceptions.SupersetErrorsException: [SupersetError(message='(MySQLdb.OperationalError) (2013, "Lost connection to server at \'reading authorization packet\', system error: 11")\n(Background on this error at: https://sqlalche.me/e/14/e3q8)', error_type=, level=, extra={'engine_name': 'Apache Doris', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

Comment From: dosubot[bot]

The error means SQLAlchemy can't find the Doris dialect plugin, even though pydoris is installed. This usually happens if the pydoris package isn't registering the 'doris' dialect correctly with SQLAlchemy's entry_points system, or if Superset and pydoris are in different Python environments. Superset expects pydoris to provide the dialect—if it's missing or misconfigured, you'll see this error, and Superset will fall back to MySQLdb, which can't connect to Doris properly (source).

To troubleshoot: 1. In the same environment where Superset runs, check the entry_points for SQLAlchemy dialects:
python -m importlib.metadata entry_points | grep doris or, for older Python: python -c "import pkg_resources; print([ep for ep in pkg_resources.iter_entry_points('sqlalchemy.dialects') if 'doris' in ep.name])" You should see something like doris = pydoris.sqlalchemy_doris:DorisDialect.

  1. Make sure Superset and pydoris are installed in the same Python environment (which python, pip list).

  2. If the 'doris' entry_point is missing, try reinstalling pydoris (pip install --force-reinstall pydoris). If it still doesn't show up, there may be a packaging issue with pydoris itself.

Superset doesn't register the Doris dialect; it relies on pydoris to do this via its packaging metadata. If the entry_point is missing or broken, that's a pydoris packaging/environment issue, not a Superset bug (source).

Let me know what you find with the entry_points check!

To reply, just mention @dosu.


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

Comment From: wakkorottix

@dosu

with python -m importlib.metadata entry_points | grep doris it get /home/pi/superset/bin/python: No module named importlib.metadata.main; 'importlib.metadata' is a package and cannot be directly executed

Comment From: dosubot[bot]

That error happens because importlib.metadata is a Python module, not a CLI tool—you can't run it with python -m importlib.metadata. To check if the 'doris' dialect is registered, run this Python script in the same environment as Superset:

try:
    # Python 3.8+
    from importlib.metadata import entry_points
    eps = entry_points()
    dialects = eps.select(group='sqlalchemy.dialects') if hasattr(eps, 'select') else eps.get('sqlalchemy.dialects', [])
    print("SQLAlchemy dialect entry_points containing 'doris':")
    for ep in dialects:
        if 'doris' in ep.name:
            print(f"{ep.name} = {ep.value}")
except ImportError:
    # Fallback for older environments
    try:
        import pkg_resources
        print("SQLAlchemy dialect entry_points containing 'doris':")
        for ep in pkg_resources.iter_entry_points('sqlalchemy.dialects'):
            if 'doris' in ep.name:
                print(f"{ep.name} = {ep.module_name}:{ep.attrs[0]}")
    except ImportError:
        print("Neither importlib.metadata nor pkg_resources is available.")

If you see a line like doris = pydoris.sqlalchemy_doris:DorisDialect, the registration is correct. If nothing prints, pydoris isn't registering the dialect—try pip install --force-reinstall pydoris and make sure you're using the same Python environment as Superset. If the entry_point is present but you still get the error, there may be a packaging or environment issue.

To reply, just mention @dosu.


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

Comment From: wakkorottix

@dosu with your code i get doris = pydoris.sqlalchemy.dialect:DorisDialect pydoris = pydoris.sqlalchemy.dialect:DorisDialect

so i think that should be fine?

Comment From: wakkorottix

@dosu after switching back to superset 4.1.2, everything is fine, and it's the same environment

Comment From: rusackas

CC @betodealmeida

Comment From: wakkorottix

in the same environment I installed duckdb-engine, and it's working normal

Comment From: betodealmeida

@wakkorottix This is weird, because the error seems to be coming from the driver, no from Superset. When you say it works with 4.1.2, is that the exact same machine, with the same IP address, or a different machine running 4.1.2 vs. the one running 5.0?

Comment From: betodealmeida

The other thing that could be, it looks like we added support for catalogs to Doris. But looking at the code, it seems that when we don't pass a catalog (when multi-catalog is disabled in the database) then your URL would get rewritten to:

 doris://bme280:XXXXXXXXXX@pi5b:9030/internal.information_schema

Here's the relevant part:

```python
    @classmethod
    def adjust_engine_params(
        cls,
        uri: URL,
        connect_args: dict[str, Any],
        catalog: Optional[str] = None,
        schema: Optional[str] = None,
    ) -> tuple[URL, dict[str, Any]]:
        if catalog:
            pass
        elif uri.database and "." in uri.database:
            catalog, _ = uri.database.split(".", 1)
        else:
            catalog = "internal"

        # In Apache Doris, each catalog has an information_schema for BI tool
        # compatibility. See: https://github.com/apache/doris/pull/28919
        schema = schema or "information_schema"
        database = ".".join([catalog or "", schema])
        uri = uri.set(database=database)
        return uri, connect_args

Since catalog is None, and you don't have a period in your database (specifying a catalog), then the catalog gets assigned to "internal".

A way to test this is to add a default schema catalog to your URI, then it should point to the right place, can you give that a try? Something like:

 doris://bme280:XXXXXXXXXX@pi5b:9030/catalog.bme280

I'll fix the logic in the meantime, and maybe you can give it a try when my PR is ready?

Thanks!

Edit: updated after I learned bme280 is the schema (a "database" for Doris), not the catalog.

Comment From: betodealmeida

Looking at the DB engine spec, I think we now assume that the catalog will be always specified in the URI; if not, it defaults to internal which seems to be the Doris default. I think the expected behavior is:

  1. If you're not planning to use multi-catalog, you need to specify a catalog in the URI (otherwise it will default to internal, which is unlikely to be what you want).
  2. If you're planning to use multi-catalog, then you can have just the schema in the URI, since the the catalog will be set for each query.

@liujiwen-up can you confirm?

I am doing a PR clearing the logic and little bit, and clarifying it.

Comment From: wakkorottix

Just tried with doris://bme280:XXXXXXXXXX@pi5b:9030/internal.bme280 Now it's working, i can query in SQL Lab

doris://bme280:XXXXXXXXXX@pi5b:9030/catalog.bme280 did not work, got an error when testing the connection

Comment From: wakkorottix

Image Image

Comment From: betodealmeida

doris://bme280:XXXXXXXXXX@pi5b:9030/catalog.bme280 did not work, got an error when testing the connection

Oh, I meant replacing catalog with the name of your catalog. :)

Comment From: betodealmeida

It's weird, because if doris://bme280:XXXXXXXXXX@pi5b:9030/internal.bme280 works, then I think that the original URI should work as well.

Comment From: wakkorottix

doris://bme280:XXXXXXXXXX@pi5b:9030/bme280 --> does not work doris://bme280:XXXXXXXXXX@pi5b:9030/internal.bme280 --> works doris://bme280:XXXXXXXXXX@pi5b:9030 --> works

it's weird but i'm fine with doris://bme280:XXXXXXXXXX@pi5b:9030 :-)