GitHub user dosubot[bot] added a comment to the discussion: Unable to activate 
async querying in superset 5.0.0

<!-- Answer -->
The error means the Celery worker can't find the Query record in the metadata 
DB when it tries to fetch it. This is almost always a timing or DB visibility 
issue, not a problem with your async flags or Celery config. Superset's async 
workflow commits the Query to the DB before the worker starts, but if the 
worker runs before the commit finishes (or before the row is visible due to 
MySQL replication lag or transaction isolation), you'll see this error—even if 
both processes use the same DB URI and can connect fine. The code retries a few 
times to handle this race, but if the Query is still missing, something is 
wrong with DB commit timing or visibility 
[source](https://github.com/apache/superset/blob/2e9939baf253e607a54722b1996baaf625e72133/superset/commands/sql_lab/execute.py).

Check your MySQL transaction isolation level (should be READ COMMITTED), make 
sure there’s no replication lag, and confirm that the web server logs show the 
Query being committed before the worker tries to fetch it. Also, Superset 5.0 
removed GLOBAL_ASYNC_QUERIES_REDIS_CONFIG in favor of 
GLOBAL_ASYNC_QUERIES_CACHE_BACKEND and included new migrations—double-check 
that all migrations ran and your config matches the new requirements 
[source](https://github.com/apache/superset/issues/31842).

If you still see this after confirming the above, enable SQLAlchemy debug 
logging to see the exact timing of Query creation/commit and Celery fetch 
attempts. This will help pinpoint if it’s a race or a deeper DB/config issue.


<!-- 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/4bb6a049-3914-409e-8890-8597bd13e110?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/4bb6a049-3914-409e-8890-8597bd13e110?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/4bb6a049-3914-409e-8890-8597bd13e110?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/4bb6a049-3914-409e-8890-8597bd13e110?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/4bb6a049-3914-409e-8890-8597bd13e110?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/4bb6a049-3914-409e-8890-8597bd13e110?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/4bb6a049-3914-409e-8890-8597bd13e110?feedback_type=other)</sup>&nbsp;&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Sh
 are 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/33920)

GitHub link: 
https://github.com/apache/superset/discussions/33920#discussioncomment-13603975

----
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