Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

132
Visualizações
django websockets cannot dispatch message on channel

I am using web sockets with Redis on Django. Django is running fine on macOS server but I started running it on Redhat Linux server and now the server gives me this error whenever I send a package over websockets:

ERROR - server - HTTP/WS send decode error:
    Cannot dispatch message on channel
    u'daphne.response.fzdRCEVZkh!nqhIpaLfWb' (unknown)

Note: while I get the error, the package will be received correctly.

I couldn't find any resources for this error.

I followed official instructions for channels.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

According to Andrew Godwin (the developer of the channels package), this message is logged when you have a channel that was disconnected, but not removed from channel group(s):

Ah yes, that's Daphne being a little bit more verbose than before, I need to remove that. Don't worry about it - it's perfectly normal after you disconnect a channel that's still in a group. You might want to add a Group.discard call in a disconnect handler to stop it, though.

Source.

I had the same error, using a custom impl of channels.generic.websockets.WebsocketConsumer. After cleaning up channels from groups in disconnect callback, the message disappeared.

A short example with a class-based consumer: assuming you add clients to the broadcast group named foo on connection establishing. Then, on client disconnect, remove its channel from the group:

from channels import Group
from channels.generic.websockets import JsonWebsocketConsumer

class MyConsumer(JsonWebsocketConsumer):

    groupname = 'foo'

    def connect(self, message, **kwargs):
        # send an accept or the connection will be dropped automatically
        self.message.reply_channel.send({"accept": True})
        # add the channel to the broadcast group
        Group(self.groupname).add(message.reply_channel)
        # do the rest of logic that should happen on connection established
        ...

    def disconnect(self, message, **kwargs):
        Group(self.groupname).discard(message.reply_channel)
        # do the rest of logic that should happen on disconnect
        ...
about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda