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

   <!-- Answer -->
   This is a coding bug in Superset v6. The error happens because the Celery 
task teardown handler calls `db.session.remove()` without checking for a Flask 
app context, which causes runtime errors during scheduled email reports. This 
bug was introduced in v6 and did not exist in previous versions, which is why 
your reports worked before but fail now. The current master/latest-dev branch 
(v6) is not considered stable for production—it's recommended to use the tagged 
release Superset 5.0.0 for production deployments, as the master branch can 
introduce breaking changes and regressions like this one 
[(source)](https://github.com/apache/superset/issues/35823) [(code 
reference)](https://github.com/apache/superset/blob/master/superset/tasks/celery_app.py).
   
   
   <!-- 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/1818820b-9769-489b-87cf-a222a78afe31?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/1818820b-9769-489b-87cf-a222a78afe31?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/1818820b-9769-489b-87cf-a222a78afe31?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/1818820b-9769-489b-87cf-a222a78afe31?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/1818820b-9769-489b-87cf-a222a78afe31?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/1818820b-9769-489b-87cf-a222a78afe31?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/1818820b-9769-489b-87cf-a222a78afe31?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%20coding%20bug%20in%20Superset%20v6.%20The%20error%20happens%20because%20the%20Celery%20task%20teardown%20handler%20calls%20%60db.session.remove%28%29%60%20without%20checking%20for%20a%20Flask%20app%20context%2C%20which%20causes%20runtime%20errors%20during%20scheduled%20email%20reports.%20This%20bug%20was%20introduced%20in%20v6%20and%20did%20not%20exist%20in%20previous%20versions%2C%20which%20is%20why%20your%20reports%20worked%20before%20but%20fail%20now.%20The%20current%20master/latest-dev%20branch%20%28v6%29%20is%20not%20considered%20stable%20for%20production%E2%80%94it%27s%20recommended%20to%20use%20the%20tagged%20release%20Superset%205.0.0%20for%20production%20deployments%2C%20as%20the%20master%20branch%20can%20introduce%20breakin
 
g%20changes%20and%20regressions%20like%20this%20one%20%5B%28source%29%5D%28https%3A//github.com/apache/superset/issues/35823%29%20%5B%28code%20reference%29%5D%28https%3A//github.com/apache/superset/blob/master/superset/tasks/celery_app.py%29.)&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/37075)


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