Tuesday, November 6, 2018

Re: Django Channels - core.py error

I've just had trouble with exactly the same error. In my case I was building from the tutorial ChatConsumer with my own XChatConsumer and I hadn't referenced it in the routing.py. As a result the tutorial async chat consumer was receiving a scope that did not contain a room_name in its url_route kwargs. Very obscure! I think the channel gets closed by an error and then this 500 error comes up rather than anything helpful for the original error.

On Friday, 12 October 2018 07:06:13 UTC+10, itsnate_b wrote:
Hi Simon,

Sorry to hear that you are having the same problem! Channels can be a blessing and a curse. I find it very finicky with very poor documentation & poor error handling. As for the fix: I had an AsyncWebsocketConsumer class in consumers.py within which I had a custom __init__ function. I believe I was setting the scope incorrectly within the init. I realized that I had no need to override/augment the init and removed it. The result was that the error disappeared. That was it for me. I have since updated to all the latest builds for the channels & redis infrastructure.

Hope that helps.

Cheers,
Nathan

On Tuesday, October 9, 2018 at 9:59:33 AM UTC-4, Simon Vézina wrote:
Hi itsnate_b,

Would you mind elaborating on your fix?

I'm getting this exact error and I'm at a complete loss.   Everything works fine in local, but on my live server, after a couple of minutes/hours of working fine, I start getting this error in the logs.

Thanks!

Le dimanche 2 septembre 2018 13:26:29 UTC-4, itsnate_b a écrit :
Turns out there was an erroneous init function in the AsyncWebsocketConsumer class. Removing it fixed the issue.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e1ebd5c9-5326-4d03-9512-f6f1deec28a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment