GitHub user dosubot[bot] added a comment to the discussion: Rough Edges Setting 
Up Trino

<!-- Greeting -->
Hi @Wetbikeboy2500! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.

<!-- Answer -->
The spinner hangs and the modal stays empty because Superset is synchronously 
processing permissions for every Trino catalog and schema in the backend. With 
hundreds of catalogs, this can take 20–30 minutes, blocking the frontend and 
causing the modal to never finish loading. The JavaScript error (`Cannot read 
properties of null (reading 'dataset')`) happens because the modal expects 
certain DOM elements to be present, but they aren't rendered while the backend 
is busy and the spinner is active, so event handlers fail when they try to 
access them.

The backend warnings and duplicate key errors are from Superset trying to add 
permission entries for catalogs and schemas—if a catalog is misconfigured or 
already exists, you get those errors. This is expected with large Trino 
deployments, but the synchronous processing makes the UI unusable during setup 
or edits 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/database/sync_permissions.py#L51-L359).

To fix this, set `SYNC_DB_PERMISSIONS_IN_ASYNC_MODE = True` in your Superset 
config and make sure you have a Celery worker running. This offloads catalog 
permission syncing to the background, so the modal can close immediately and 
the UI won't hang 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L1954-L1970).
 If you want to speed up migrations and avoid processing every catalog up 
front, you can also set `CATALOGS_SIMPLIFIED_MIGRATION = True` to only sync the 
default catalog initially 
[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L1954-L1970).

**Troubleshooting checklist:**
- Enable async permission syncing: `SYNC_DB_PERMISSIONS_IN_ASYNC_MODE = True`
- Run a Celery worker for background tasks
- (Optional) Set `CATALOGS_SIMPLIFIED_MIGRATION = True` to reduce initial 
migration time
- Restart Superset and try setting up/editing the Trino connection again

This should resolve the spinner and modal issues for large Trino deployments.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/27ed0974-c64a-44f0-9aa7-7731e310a5ed?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/27ed0974-c64a-44f0-9aa7-7731e310a5ed?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/27ed0974-c64a-44f0-9aa7-7731e310a5ed?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/27ed0974-c64a-44f0-9aa7-7731e310a5ed?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/27ed0974-c64a-44f0-9aa7-7731e310a5ed?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/27ed0974-c64a-44f0-9aa7-7731e310a5ed?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/27ed0974-c64a-44f0-9aa7-7731e310a5ed?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20spinner%20hangs%20and%20the%20modal%20stays%20empty%20because%20Superset%20is%20synchronously%20processing%20permissions%20for%20every%20Trino%20catalog%20and%20schema%20in%20the%20backend.%20With%20hundreds%20of%20catalogs%2C%20this%20can%20take%2020%E2%80%9330%20minutes%2C%20blocking%20the%20frontend%20and%20causing%20the%20modal%20to%20never%20finish%20loading.%20The%20JavaScript%20error%20%28%60Cannot%20read%20properties%20of%20null%20%28reading%20%27dataset%27%29%60%29%20happens%20because%20the%20modal%20expects%20certain%20DOM%20elements%20to%20be%20present%2C%20but%20they%20aren%27t%20rendered%20while%20the%20backend%20is%20busy%20and%20the%20spinner%20is%20active%2C%20so%20event%20handlers%20fail%20when%20they%20try%20to%20access%20them.
 
%0A%0AThe%20backend%20warnings%20and%20duplicate%20key%20errors%20are%20from%20Superset%20trying%20to%20add%20permission%20entries%20for%20catalogs%20and%20schemas%E2%80%94if%20a%20catalog%20is%20misconfigured%20or%20already%20exists%2C%20you%20get%20those%20errors.%20This%20is%20expected%20with%20large%20Trino%20deployments%2C%20but%20the%20synchronous%20processing%20makes%20the%20UI%20unusable%20during%20setup%20or%20edits%20%5Bsource%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/database/sync_permissions.py%23L51-L359%29.%0A%0ATo%20fix%20this%2C%20set%20%60SYNC_DB_PERMISSIONS_IN_ASYNC_MODE%20%3D%20True%60%20in%20your%20Superset%20config%20and%20make%20sure%20you%20have%20a%20Celery%20worker%20running.%20This%20offloads%20catalog%20permission%20syncing%20to%20the%20background%2C%20so%20the%20modal%20can%20close%20immediately%20and%20the%20UI%20won%27t%20hang%20%5Bsource%5D%28https%3A//github.com/apache/superset/blob/829e4
 
d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py%23L1954-L1970%29.%20If%20you%20want%20to%20speed%20up%20migrations%20and%20avoid%20processing%20every%20catalog%20up%20front%2C%20you%20can%20also%20set%20%60CATALOGS_SIMPLIFIED_MIGRATION%20%3D%20True%60%20to%20only%20sync%20the%20default%20catalog%20initially%20%5Bsource%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py%23L1954-L1970%29.%0A%0A%2A%2ATroubleshooting%20checklist%3A%2A%2A%0A-%20Enable%20async%20permission%20syncing%3A%20%60SYNC_DB_PERMISSIONS_IN_ASYNC_MODE%20%3D%20True%60%0A-%20Run%20a%20Celery%20worker%20for%20background%20tasks%0A-%20%28Optional%29%20Set%20%60CATALOGS_SIMPLIFIED_MIGRATION%20%3D%20True%60%20to%20reduce%20initial%20migration%20time%0A-%20Restart%20Superset%20and%20try%20setting%20up/editing%20the%20Trino%20connection%20again%0A%0AThis%20should%20resolve%20the%20spinner%20and%20modal%20issues%20for%20large%20Trino%20deployments.)&nbsp;[![Join
 
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/37447)

GitHub link: 
https://github.com/apache/superset/discussions/37447#discussioncomment-15606165

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to