-
-
Notifications
You must be signed in to change notification settings - Fork 817
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Cant see traceback #1340
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
Comments
I'm having the same issue: if anything inside the socket fails there's no stacktrace in the logs. @LukenAgile42 We've implemented a really simple class decorator (just for easier debugging locally) that basically catches any exception inside the current class and prints the stacktrace:
However it would be great if someone take a look ! 🙂 |
We just ran into a comparable issue. On a test system, it was due to a missing HOSTS entry for the Redis server. We're seeing the same behavior on a prototype production system but it sounds like what we're seeing is so non-specific that the actual error could be pretty much anything in the consumer. EDIT: To be clear, we're getting the slightly more interesting:
EDIT2: In our prototype production instance (AWS), the problem was that TransitEncyption defaults to "true" in the Elasticache Redis template we were using. We weren't using Obviously, the details are less important than the fact that none of these error are bubbling up into logging (Django or otherwise). |
OK, so there's clearly logging lacking here. Question: if you dig-in, or use @Ivo-Donchev's suggestion, where are the errors occurring? Can we add logging in the right places there to surface the issues? (Anyone want to put together a minimal project that replicates this that we can play with?) |
OK. If I wrap my If I watch the error, it reaches
I'm not clear why a production runner doesn't behave the same way. |
Hey guys 🙂 , I think I found what's the issue 🔥 🎉 So, what I did:
I searched in the other issues and found this - #1193 (there's a suggested quickfix there) I started debugging the django-debug-toolbar code to find the root of the problem and turned out that this class is causing it - https://github.com/jazzband/django-debug-toolbar/blob/87eb27ffb2d0aea60b8b139360ece4d9fc91b47e/debug_toolbar/utils.py#L222 It's used by a code hooked to the python logging module and collects only the logs from the current thread (which channels is not part from) 😞 #1340 (comment) - this was solving the problem because the Hope this will help someone ^ |
We're not using the debug toolbar. However, it certainly could be an issue with other middleware. |
Hi @Ivo-Donchev — Thanks for the follow-up! Super. |
This issue still persists. Anyone who found a workaround? Not using the debug toolbar and this makes it working blindly. |
@Ivo-Donchev I also removed |
Something else that worked for me is to set the root logger explicitly in settings:
|
@LukenAgile42 Hmm. Can I see your code? (if It's open source of course 😄) |
Its closed source, but my usage was just
I tried it while inheriting from |
I stripped away all middleware and apps, except for some core django ones, but the logging was still broken. Must be an infrastructure issue somehow. |
If this is really a logging issue, try installing logging_tree https://pypi.org/project/logging_tree/ and then inspecting the actual loggers in the connect function. Put a breakpoint in. Log something, is it displayed? (Sometimes a dictConfig will override all the existing loggers, so you don't get the config you thought you were.)
The decorator is Without a minimal reproduce it's really hard to see what can be happening. |
No stdout. Just
as before. |
@LukenAgile42 Can you setup a minimal django app so we can see it reproduced in isolation? I'd love to play with it and help fixing it. |
+1 have problem |
I keep hoping to actually build an example of this for testing, but haven't found time yet. I wonder if it's enough to analyze the stack trace I posted above. Shouldn't we expect to log (and possibly re In this case, channels.utils.await_many_dispatch seems to wrap activities from other modules (
If one of the tasks error, isn't this method a logical place to catch and log it?
To ensure all of the cancels are attempted ASAP, I suspect the block should look more like this:
|
P.S. this is the caller. There isn't a logger at this level either, but at least a message here is put into the context of the |
Is there any progress on this issue. I am also facing this. Unable to see any sort of logs. |
Same here backend:
frontend:
|
I also had this issue, but finally, I figured out that I simply forgot to set
|
Doesn't play nice with django channels Silences exceptions in consumers See: django/channels#1340 django/channels#1193 django-commons/django-debug-toolbar#1300
Doesn't play nice with django channels Silences exceptions in consumers See: django/channels#1340 django/channels#1193 django-commons/django-debug-toolbar#1300
Doesn't play nice with django channels Silences exceptions in consumers See: django/channels#1340 django/channels#1193 django-commons/django-debug-toolbar#1300
Doesn't play nice with django channels Silences exceptions in consumers See: django/channels#1340 django/channels#1193 django-commons/django-debug-toolbar#1300
Thank you @Pithikos. This actually helped me to show the traceback in the console. Is there a way to find out which logger handled the exception? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Uh oh!
There was an error while loading. Please reload this page.
produces
With no traceback
When I try to reproduce this with a minimal setup, it gives traceback
as expected.
Adding a print
inside
daphne.server.Server.application_checker
allows me to see the output, so it seems daphne swallows the errors somehow.
The text was updated successfully, but these errors were encountered: