dosubot[bot] commented on issue #36980: URL: https://github.com/apache/superset/issues/36980#issuecomment-3723655444
<!-- Greeting --> Hi @ukeswani! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> This issue is almost certainly caused by malformed UUIDs in your Superset metadata database. Superset expects UUID fields (like those on slices, dashboards, or filter state) to be 16-byte binary values. If a filter or slice references a UUID that isn't valid (for example, a string that's not 16 bytes), SQLAlchemy will immediately raise a `ValueError: bytes is not a 16-char string` before any query is sent to Trino, which matches your symptoms: immediate "Network error" in the UI and no query reaching Trino ([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/models/helpers.py#L167-L1977)). This can happen if there was a recent migration, import, or data corruption event in the affected environment. The randomness is likely due to which filter or dashboard references a bad UUID at any given time. To resolve: 1. Check your Superset metadata DB (e.g., Postgres/MySQL) for malformed UUIDs in tables like `slices`, `dashboards`, and any filter state tables. Look for UUIDs that are not 16 bytes or are obviously invalid. 2. Compare the affected environment's metadata with a healthy one to spot differences. 3. Fix or regenerate any malformed UUIDs you find (e.g., update them with valid UUIDs). 4. After fixing, restart Superset and verify that the errors are gone. If you want to dig deeper, examine your Superset logs for the exact UUID values causing the error, then trace those back to the corresponding records in your metadata DB. Let me know if you want example SQL queries for finding malformed UUIDs or more details on how to repair them. <!-- 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/0e543d5a-007d-4e9b-b72c-6638408607bf?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0e543d5a-007d-4e9b-b72c-6638408607bf?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0e543d5a-007d-4e9b-b72c-6638408607bf?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0e543d5a-007d-4e9b-b72c-6638408607bf?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0e543d5a-007d-4e9b-b72c-6638408607bf?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0e543d5a-007d-4e9b-b72c-6638408607bf?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0e543d5a-007d-4e9b-b72c-6638408607bf?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=This%20issue%20is%20almost%20certainly%20caused%20by%20malformed%20UUIDs%20in%20your%20Superset%20metadata%20database.%20Superset%20expects%20UUID%20fields%20%28like%20those%20on%20slices%2C%20dashboards%2C%20or%20filter%20state%29%20to%20be%2016-byte%20binary%20values.%20If%20a%20filter%20or%20slice%20references%20a%20UUID%20that%20isn%27t%20valid%20%28for%20example%2C%20a%20string%20that%27s%20not%2016%20bytes%29%2C%20SQLAlchemy%20will%20immediately%20raise%20a%20%60ValueError%3A%20bytes%20is%20not%20a%2016-char%20string%60%20before%20any%20query%20is%20sent%20to%20Trino%2C%20which%20matches%20your%20symptoms%3A%20immediate%20%22Network%20error%22%20in%20the%20UI%20and%20no%20query%20reaching%20Trino%C2%A0%28%5Bsource%5D%28https%3A//github.com/ap ache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/models/helpers.py%23L167-L1977%29%29.%0A%0AThis%20can%20happen%20if%20there%20was%20a%20recent%20migration%2C%20import%2C%20or%20data%20corruption%20event%20in%20the%20affected%20environment.%20The%20randomness%20is%20likely%20due%20to%20which%20filter%20or%20dashboard%20references%20a%20bad%20UUID%20at%20any%20given%20time.%0A%0ATo%20resolve%3A%0A%0A1.%20Check%20your%20Superset%20metadata%20DB%20%28e.g.%2C%20Postgres/MySQL%29%20for%20malformed%20UUIDs%20in%20tables%20like%20%60slices%60%2C%20%60dashboards%60%2C%20and%20any%20filter%20state%20tables.%20Look%20for%20UUIDs%20that%20are%20not%2016%20bytes%20or%20are%20obviously%20invalid.%0A2.%20Compare%20the%20affected%20environment%27s%20metadata%20with%20a%20healthy%20one%20to%20spot%20differences.%0A3.%20Fix%20or%20regenerate%20any%20malformed%20UUIDs%20you%20find%20%28e.g.%2C%20update%20them%20with%20valid%20UUIDs%29.%0A4.%20After%20fixing%2C%20restart%20Superset %20and%20verify%20that%20the%20errors%20are%20gone.%0A%0AIf%20you%20want%20to%20dig%20deeper%2C%20examine%20your%20Superset%20logs%20for%20the%20exact%20UUID%20values%20causing%20the%20error%2C%20then%20trace%20those%20back%20to%20the%20corresponding%20records%20in%20your%20metadata%20DB.%0A%0ALet%20me%20know%20if%20you%20want%20example%20SQL%20queries%20for%20finding%20malformed%20UUIDs%20or%20more%20details%20on%20how%20to%20repair%20them.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36980) -- 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]
