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

A user with Gamma + sql_lab role cannot open a new editor tab #24228

Closed
3 tasks done
mdeshmu opened this issue May 26, 2023 · 4 comments
Closed
3 tasks done

A user with Gamma + sql_lab role cannot open a new editor tab #24228

mdeshmu opened this issue May 26, 2023 · 4 comments
Labels
#bug Bug report

Comments

@mdeshmu
Copy link
Contributor

mdeshmu commented May 26, 2023

We did Superset upgrade from 1.5.3 version to 2.1.0 version.
Post upgrade in version 2.1.0, a user with Gamma + sql_lab role cannot open a new editor tab

How to reproduce the bug

  1. Go to 'SQL'
  2. Click on 'SQL Lab' and then Click on 'Add a new tab'
  3. See the error "unable to add a new table to the backend"

Expected results

A new table should be added allowing to select databases to query

Actual results

"unable to add a new table to the backend" error pops up

Screenshots

image

Backend logs:

Traceback (most recent call last):

File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1517, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1503, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 181, in wraps
return f(self, *args, **kwargs)
File "/app/superset/views/sql_lab/views.py", line 150, in post
database_id=query_editor["dbId"],
KeyError: 'dbId'

Environment

  • browser type and version:
  • superset version: 2.1.0
  • python version: 3.8
  • node.js version: NA
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

We are testing Superset upgrade from 1.5.3 version to 2.1.0 version

@mdeshmu mdeshmu added the #bug Bug report label May 26, 2023
@mdeshmu
Copy link
Contributor Author

mdeshmu commented May 26, 2023

@dpgaspar @eschutho can you please help me identify the root cause of this?

@mdeshmu
Copy link
Contributor Author

mdeshmu commented May 30, 2023

User didn't had access to any database, hence superset wasn't able to map any dbId to editor.
After giving database access on xxxx permissions, the issue is resolved.

@mdeshmu mdeshmu closed this as completed May 30, 2023
@smisch
Copy link

smisch commented Mar 14, 2024

In case someone finds this issue years later and had the same issue as me: This also happens when you try to open SQL Lab without having first created a database connector. Create one first. Then SQL Lab will work just fine. ;-)

@rusackas
Copy link
Member

@smisch if you want to make an edit somewhere on the documentation site to help others, we always appreciate that :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants