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

Unable to save database when impersonation is enabled #14377

Closed
octonary opened this issue Apr 27, 2021 · 5 comments
Closed

Unable to save database when impersonation is enabled #14377

octonary opened this issue Apr 27, 2021 · 5 comments
Labels
data:connect:hive Related to Hive data:connect:presto Related to Presto

Comments

@octonary
Copy link

octonary commented Apr 27, 2021

I am getting the following error when I try to enable impersonation for a Presto database...

An error occurred while fetching databases: "Connection failed, please check your connection settings"

Impersonation was previously working before authentication was added to the Presto UI. I found a few other issues related to impersonation but they all appear to be closed or merged so I upgraded to the latest apache-superset version in hopes that these issues were all resolved. I am able to successfully add a database connection if the service account is using the same credentials as the currently logged in user so I thought this may be a similar issue to #7170. However, that issue yielded a 401 response whereas this issue clearly returns a 200 from Presto but then fails when trying to save the details to the superset metadata db.

I am able to successfully add a database connection when impersonation is not enabled. I am also able to successfully test the connection with impersonation enabled but when I try and save I get the error. The logs just show a 422 response...

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): presto_host:8443
DEBUG:urllib3.connectionpool:https://presto_host:8443 "POST /v1/statement HTTP/1.1" 200 606
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): presto_host:8443
DEBUG:urllib3.connectionpool:https://presto_host:8443 "GET /v1/statement/queued/20210427_160205_00092_pvzh9/ya51b2c3a79a6fd2fb82589fdb1a4a5be888e1571/1 HTTP/1.1" 200 806
DEBUG:superset.stats_logger:[stats_logger] (incr) DatabaseRestApi.put.error
DEBUG:superset.stats_logger:[stats_logger] (timing) DatabaseRestApi.put.time | 98.71059656143188 
INFO:werkzeug:10.90.0.229 - - [27/Apr/2021 10:02:05] "PUT /api/v1/database/3 HTTP/1.1" 422 -

How to reproduce the bug:

  1. Login to superset UI
  2. Add a new database or modify an existing one
  3. Check the "Impersonate Logged In User (Presto & Hive)" checkbox found in the EXTRA tab
  4. Click the SAVE button
  5. See the "Connection failed, please check your connection settings" error pop-up on the bottom right of the page

Environment:

  • CentOS Linux release 7.6.1810 (Core)
  • Python 3.8.6
  • apache-superset==1.1.0
  • Starburst Presto 345-e.3
@junlincc junlincc added data:connect:hive Related to Hive data:connect:presto Related to Presto labels Apr 28, 2021
@octonary
Copy link
Author

Just following up to see if anyone else has ran into this and knows of a fix or workaround.

@stale
Copy link

stale bot commented May 2, 2022

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 May 2, 2022
@umsalotagi
Copy link

@octonary
Add user to superset with same username and password that will work on database. So superset username and password should be same as database user and password. Once you done that login to superset with this superset user. You should be able to save database connection when impersonation enabled.
This is more like bypass.

@NickLarsenNZ
Copy link
Contributor

NickLarsenNZ commented Dec 6, 2023

There should be a way to force a connection to save.
Especially since you can import a Connection which doesn't work without impersonation (import doesn't allow setting impersonation, see #14718).

@stale stale bot removed the inactive Inactive for >= 30 days label Dec 6, 2023
@rusackas
Copy link
Member

Closing this since it was reported on Superset 1.x, and we now only support Superset 3.1/4.0. If you're still facing this issue as described, let us know and we can re-open, but this sounds more like a feature request than a bug if I'm interpreting correctly :)

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

No branches or pull requests

5 participants