dosubot[bot] commented on issue #35030:
URL: https://github.com/apache/superset/issues/35030#issuecomment-3792909413

   <!-- Answer -->
   This is a known regression in Superset 4.1.1 and 5.0.0: when switching a 
dataset's database, the schema list and permission metadata (like `catalog`, 
`schema_perm`, `catalog_perm`) can become inconsistent or stale, sometimes 
referencing the previous database or showing schemas that don't exist. This is 
caused by incomplete state reset and cache invalidation in the frontend and 
backend, and sometimes by missing Alembic migrations for new permission columns 
like `catalog_perm` during upgrades from 4.0.2 to 4.1.1 
[[source]](https://github.com/apache/superset/issues/32846).
   
   The issue is fixed in 6.0.0-RC1 and later, thanks to several PRs that 
improved schema/table list refresh and permission handling when switching 
databases [[source]](https://github.com/apache/superset/pull/29638) 
[[source]](https://github.com/apache/superset/pull/29681) 
[[source]](https://github.com/apache/superset/pull/30082) 
[[source]](https://github.com/apache/superset/issues/32429). In affected 
versions, you can force a schema list update using the refresh icon next to the 
schema selector, or manually update the metadata fields in the Superset DB if 
permissions get out of sync.
   
   If you upgrade from 4.0.2 to 4.1.1+, make sure all DB migrations are 
applied, especially the one adding `catalog_perm` to the `tables` and `slices` 
tables. If you see permission errors after switching sources, also check that 
the DB user and Superset roles have the right privileges on the new 
database/schema [[source]](https://github.com/apache/superset/issues/36021).
   
   Upgrading to 6.0.0-RC1 or later is the best way to resolve these issues 
permanently.
   
   
   <!-- 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/8146f10c-95f3-4cf0-859d-fa940ef10ce5?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/8146f10c-95f3-4cf0-859d-fa940ef10ce5?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/8146f10c-95f3-4cf0-859d-fa940ef10ce5?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/8146f10c-95f3-4cf0-859d-fa940ef10ce5?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/8146f10c-95f3-4cf0-859d-fa940ef10ce5?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/8146f10c-95f3-4cf0-859d-fa940ef10ce5?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/8146f10c-95f3-4cf0-859d-fa940ef10ce5?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=This%20is%20a%20known%20regression%20in%20Superset%204.1.1%20and%205.0.0%3A%20when%20switching%20a%20dataset%27s%20database%2C%20the%20schema%20list%20and%20permission%20metadata%20%28like%20%60catalog%60%2C%20%60schema_perm%60%2C%20%60catalog_perm%60%29%20can%20become%20inconsistent%20or%20stale%2C%20sometimes%20referencing%20the%20previous%20database%20or%20showing%20schemas%20that%20don%27t%20exist.%20This%20is%20caused%20by%20incomplete%20state%20reset%20and%20cache%20invalidation%20in%20the%20frontend%20and%20backend%2C%20and%20sometimes%20by%20missing%20Alembic%20migrations%20for%20new%20permission%20columns%20like%20%60catalog_perm%60%20during%20upgrades%20from%204.0.2%20to%204.1.1%20%5B%5Bsource%5D%5D%28https%3A//github.com/apache/superset/
 
issues/32846%29.%0A%0AThe%20issue%20is%20fixed%20in%206.0.0-RC1%20and%20later%2C%20thanks%20to%20several%20PRs%20that%20improved%20schema/table%20list%20refresh%20and%20permission%20handling%20when%20switching%20databases%20%5B%5Bsource%5D%5D%28https%3A//github.com/apache/superset/pull/29638%29%20%5B%5Bsource%5D%5D%28https%3A//github.com/apache/superset/pull/29681%29%20%5B%5Bsource%5D%5D%28https%3A//github.com/apache/superset/pull/30082%29%20%5B%5Bsource%5D%5D%28https%3A//github.com/apache/superset/issues/32429%29.%20In%20affected%20versions%2C%20you%20can%20force%20a%20schema%20list%20update%20using%20the%20refresh%20icon%20next%20to%20the%20schema%20selector%2C%20or%20manually%20update%20the%20metadata%20fields%20in%20the%20Superset%20DB%20if%20permissions%20get%20out%20of%20sync.%0A%0AIf%20you%20upgrade%20from%204.0.2%20to%204.1.1%2B%2C%20make%20sure%20all%20DB%20migrations%20are%20applied%2C%20especially%20the%20one%20adding%20%60catalog_perm%60%20to%20the%20%60tables%60%20and%2
 
0%60slices%60%20tables.%20If%20you%20see%20permission%20errors%20after%20switching%20sources%2C%20also%20check%20that%20the%20DB%20user%20and%20Superset%20roles%20have%20the%20right%20privileges%20on%20the%20new%20database/schema%20%5B%5Bsource%5D%5D%28https%3A//github.com/apache/superset/issues/36021%29.%0A%0AUpgrading%20to%206.0.0-RC1%20or%20later%20is%20the%20best%20way%20to%20resolve%20these%20issues%20permanently.)&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/issues/35030)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to