Skip to content
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

Installed Superset 4.1.0 and trying to create Database Connection for Apache Druid(27.0.0) #32266

Open
3 tasks done
laxmikantbpandhare opened this issue Feb 14, 2025 · 9 comments
Labels
data:connect:druid Related to Druid

Comments

@laxmikantbpandhare
Copy link

laxmikantbpandhare commented Feb 14, 2025

Bug description

Hi Team,

We are facing the below error while connecting to Apache Druid from the Superset Database connections option on UI.

Traceback (most recent call last):
  File "/usr/mware/vsass/lib64/python3.9/site-packages/superset/commands/database/test_connection.py", line 170, in run
    raise DBAPIError(ex_str or None, None, None)
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None
(Background on this error at: https://sqlalche.me/e/14/dbapi)


**superset.exceptions.SupersetErrorsException: [SupersetError(message='(builtins.NoneType) None\n(Background on this error at: https://sqlalche.me/e/14/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Apache Druid', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]**

We manually tried a basic Python script for connection for Druid UI from the Superset server and "Connection is successful" indicates the Druid URL is working.

Is there any issue with the newer version of the superset? Appreciate your help and support.

For your information, below are the installed versions
Apache Superset 4.1.0
Apache Druid 27.0.0
Python 3.9
PyDruid 0.6.9

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

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.
@dosubot dosubot bot added the data:connect:druid Related to Druid label Feb 14, 2025
Copy link

dosubot bot commented Feb 14, 2025

The error you're encountering, GENERIC_DB_ENGINE_ERROR, is a common issue in Superset when the database returns an unexpected error. This error is often related to the database driver or connection handling [1].

To connect Apache Superset to Apache Druid, ensure that you are using the correct connection string format with the pydruid library:

druid://<User>:<password>@<Host>:<Port-default-9088>/druid/v2/sql

Make sure that the username, password, host, and port are correctly specified. Additionally, you can customize the connection by adding certificates in the Root Certificate field or by disabling SSL verification using the Extras field with the following configuration:

engine_params: {
    "connect_args": {
        "scheme": "https",
        "ssl_verify_cert": false
    }
}

This setup should help in configuring your Druid database within Superset [2].

If the connection works with a basic Python script but not within Superset, it might be worth checking the Superset logs for more detailed error messages. Also, ensure that the PyDruid version is compatible with Superset 4.1.0, which should be version 0.6.9 [3].

If these steps do not resolve the issue, consider reviewing the Superset logs for any additional error messages that might provide more insight into the problem.

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

@rusackas
Copy link
Member

Pinging the Druid folks from the Rolodex:

@betodealmeida
@sujiplr
@nytai
@villebro

@laxmikantbpandhare
Copy link
Author

Any help or suggestion here please.

@sujiplr
Copy link
Contributor

sujiplr commented Feb 21, 2025

@laxmikantbpandhare , are you using https url for Druid ? can you share the connection string by masking host address and user credentials ?

@laxmikantbpandhare
Copy link
Author

@sujiplr we are using https only

Please find below Druid link we are trying

druid://admin_User_ID:admin_password@server_router:9088/druid/v2/sql

Let me know if anything else is required.

@sujiplr
Copy link
Contributor

sujiplr commented Feb 23, 2025

@laxmikantbpandhare try connection string as below.

druid+https://admin_User_ID:admin_password@server_router:443/druid/v2/sql

@laxmikantbpandhare
Copy link
Author

laxmikantbpandhare commented Feb 24, 2025

@sujiplr - I tried as mentioned above but it still failed with same error.

@sujiplr
Copy link
Contributor

sujiplr commented Feb 24, 2025

@laxmikantbpandhare does your druid deployment on https has valid ssl certificate installed ? Does it have SSL error when you try from browser?

@laxmikantbpandhare
Copy link
Author

@sujiplr Druid is up and running with valid certificates.

I tested both the strings and it worked with below python code

engine = create_engine(druid_uri)

try:
connection = engine.connect()
print("Connection to Druid successful!")
connection.close()
except Exception as e:
print(f"Failed to connect to Druid: {e}")

So, Druid is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:connect:druid Related to Druid
Projects
None yet
Development

No branches or pull requests

3 participants