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

sslmode keyword is not recognized by superset #10565

Closed
tiago-as opened this issue Aug 10, 2020 · 7 comments
Closed

sslmode keyword is not recognized by superset #10565

tiago-as opened this issue Aug 10, 2020 · 7 comments
Labels
data:connect:mariadb Related to a specific database enhancement:request Enhancement request submitted by anyone from the community

Comments

@tiago-as
Copy link

I was trying to use mysqldb python module to connect to mariadb as I stated in this issue: #10495
After some research I figured why not try to use pymysql as shown here: https://docs.sqlalchemy.org/en/13/core/engines.html#mysql

I was getting some good feedback since the errors from the server were changing. Eventually Superset gave me an error requesting the pynacl module besause we are using ed25519 on the database I want to connect to. After installing the pynacl module I provided the following parameters to the connection:

URI: mysql+pymysql://username:pwd@host/database
Extra parameters (from here https://superset.incubator.apache.org/installation.html#ssl-access-to-databases ):

{
    "metadata_params": {},
    "engine_params": {
          "connect_args":{
              "sslmode":"require",
              "sslrootcert": "<path_to_file>"
        }
     }
}

When testing the connection, the server gave me this error:

Unexpected error __init__() got an unexpected keyword argument 'sslmode'
ERROR:superset.views.core:Unexpected error __init__() got an unexpected keyword argument 'sslmode'
INFO:werkzeug:127.0.0.1 - - [10/Aug/2020 12:50:25] "POST /superset/testconn HTTP/1.1" 400 -

Am I doing something wrong?

Thanks in advance for any help

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.57. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the !deprecated-label:bug Deprecated label - Use #bug instead label Aug 10, 2020
@tiago-as
Copy link
Author

I was using Ubuntu 20.04 without success. I downgraded the operating system to Ubuntu 18.04 and to use Python 3.6. I was able to connect using PyMySQL with the following URI: mysql+pymysql://USERNAME:PASSWORD@IP_ADDRESS/DATABASE

And with the following JSON in the extra field:

{
    "metadata_params": {},
    "engine_params": {
         "connect_args":{
              "ssl": {
              "sslca": "<PATH_TO_CERT>"
            }
        }
     },
    "metadata_cache_timeout": {},
    "schemas_allowed_for_csv_upload": []
}

@tiago-as
Copy link
Author

I've found this bug report on the Ubuntu launchpad, can be related: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1888101

@stale
Copy link

stale bot commented Oct 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Oct 12, 2020
@mak705
Copy link

mak705 commented Nov 18, 2020

import psycopg2

conn = psycopg2.connect(
dbname='yourdb', user='dbuser', password='abcd1234',
host='server', port='5432',
sslmode='verify-ca', sslrootcert="server-ca.pe"
)

got the same error issue in resolving connect() got an unexpected keyword argument 'sslmode'

@stale stale bot removed the inactive Inactive for >= 30 days label Nov 18, 2020
@villebro
Copy link
Member

We're currently adding native functionality for validating root certs to Postgres (See #11720). Once this gets merged I am happy to collaborate on adding support to other dbs (e.g. MySQL), as it is fairly simple due to the driver taking care of the majority of the heavy lifting.

@junlincc junlincc added the data:connect:mariadb Related to a specific database label Mar 31, 2021
@junlincc
Copy link
Member

@tiago-as please let us know if you need help on adding support to mariadb.
closing it for now.

@junlincc junlincc added enhancement:request Enhancement request submitted by anyone from the community and removed !deprecated-label:bug Deprecated label - Use #bug instead labels Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:connect:mariadb Related to a specific database enhancement:request Enhancement request submitted by anyone from the community
Projects
None yet
Development

No branches or pull requests

4 participants