apache/superset

Permission denied for sql access between databases

Habeeb556 opened this issue · 1 comments

I have another inquiry also regarding this. Previously 4.0.1 when I select for example select * from database_name.schema_name.table_name it was working fine.

I applied the fix but still cannot select with database_name access denied. I required to grant full access id: to do that which wasnt before.

image

Dec  8 11:26:10 ef-extsuperset superset[3696623]: 2024-12-08 11:26:10,802:DEBUG:superset.sql_parse:Parsing with sqlparse statement: select * from abcm.dbo.temp ;
Dec  8 11:26:10 ef-extsuperset superset[3696623]: 2024-12-08 11:26:10,816:DEBUG:superset.stats_logger:#033[36m[stats_logger] (incr) SqlLabRestApi.execute_sql_query.error#033[0m
Dec  8 11:26:10 ef-extsuperset superset[3696623]: 2024-12-08 11:26:10,816:DEBUG:superset.stats_logger:#033[36m[stats_logger] (timing) SqlLabRestApi.execute_sql_query.time | 122.99154791980982 #033[0m
Dec  8 11:26:11 ef-extsuperset superset[3696616]: 2024-12-08 11:26:11,842:DEBUG:superset.stats_logger:#033[36m[stats_logger] (incr) log#033[0m

but I am able to select with dbo only:

image

This needed for databases I have in the same instance and calling each other.

Originally posted by @Habeeb556 in #31183 (comment)

I found a similar closed issue regarding database access in SQL Lab, but no solution was found in the comments [1].

Regarding your current issue, it seems that after the update to version 4.0.1, you are encountering permission issues when trying to perform cross-database queries. The error message suggests that you need either all_database_access or all_datasource_access permissions to execute queries like select * from database_name.schema_name.table_name.

To resolve this, you might need to adjust the permissions for the user attempting the query. Here are some steps you can consider:

  1. Check User Roles and Permissions: Ensure that the user has the necessary permissions. If cross-database queries are required, you might need to grant all_database_access or all_datasource_access permissions, although you mentioned this wasn't needed before.

  2. Review Role Changes in Version 4.0.1: Since you mentioned this issue arose after updating to version 4.0.1, review any changes in the release notes or documentation regarding permissions and roles that might affect database access.

  3. SQL Lab Permissions: Ensure that the user has the SQL Lab access permissions, as these are required to execute queries in SQL Lab.

If these steps do not resolve the issue, you may need to investigate further into any specific changes in your Superset configuration or database settings that could be affecting access.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other