-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging in celery outside of flask context? #207
Comments
This appears to be the same issue as #177 |
Hitting this same problem, but RuntimeError subclasses exception which seems to be caught here, so I'm not sure why this is raising for me. |
Ok, figured out this is a very subtle issue with requests getting imported before patching gevent... yikes! |
Hi, after more testing I'm quite sure this is a bug rather than a question. We have no easy way other than running a local copy of the rollbar code to suppress these warnings. The problem occurs in
Replacing this section with a simple Since py3 keeps a stack of exceptions our exception stacks show these bad exceptions in real logs which causes much confusion and problems when using Rollbar. Is there a real possibility of this being fixed in 0.14.0 and is there an ETA? |
We will be working on v0.14.0 shortly, although I don't have a specific ETA on when it will be released. But within the next few weeks. |
Hello, I got sent here by Rollbar support. We currently use rollbar in both flask (request context) and celery (worker context) and we get exceptions thrown by the rollbar package.
This is how we setup celery:
Running a log.warning() inside a celery task correctly logs the error to rollbar but it also floods our local logs with this exception:
It seems to try to load flask (since it's importable) and inject people data (there's no request to get), but since the code tries to access flask's request context it complains that it isn't in a request context.
Can I somehow turn off the flask parts when we're not actually inside flask? Maybe use a celery request instead (
task.request
).The text was updated successfully, but these errors were encountered: