evolution-api icon indicating copy to clipboard operation
evolution-api copied to clipboard

[PT][BUG] Ativação do rabbitmq Cannot read properties of null (reading 'assertExchange')

Open caaiomendes opened this issue 2 years ago • 8 comments

Título: Erro ao ativar o rabbitmq

Descrição:

Percebi que após algumas vezes que acontece o restart no servidor, quando iniciado as mensagens param de ser encaminhadas ao RabbitMQ e quando vou desativar ou reativar o RabbitMQ, ele dá o seguinte erro: { "status": 500, "error": "Internal Server Error", "response": { "message": "Cannot read properties of null (reading 'assertExchange')" } } Nisso as vezes reiniciando o servidor novamente ele volta ao normal, mas as vezes é preciso fazer downgrade para versão 1.5.4 e depois subir novamente a 1.6.1

Passos para Reproduzir:

  1. Reiniciar Servidor
  2. Tentar ativar ou desativar o RabbitMQ
  3. Aparece o erro

Comportamento Esperado:

Mesmo após reiniciar o servidor, não deveria parar de enviar mensagens ao RabbitMQ

Comportamento Atual:

Após reiniciar servidor, mensagens param de ser enviadas ao RabbitMQ e me dá erro

Capturas de Tela/Vídeos:

image

Ambiente:

  • Servidor: Centos 7.
  • Versão da API: 1.6.1
  • Outras Especificações de Hardware/Software: 64gb ram, 800 SSD, 16 núcleos

Envio de Logs:

Por favor, anexe os logs que possam estar relacionados ao problema. Se os logs contiverem informações sensíveis, considere enviá-los de forma privada para um dos mantenedores do projeto.

Notas Adicionais:

Inclua aqui qualquer outra informação que você ache que possa ser útil para entender ou resolver o bug.

caaiomendes avatar Jan 31 '24 10:01 caaiomendes

Quando acontecer isso verifque se a fila existe no rabbitmq, e crie manualmente que resolve, estaremos verificando uma forma de resolver

DavidsonGomes avatar Feb 16 '24 12:02 DavidsonGomes

@DavidsonGomes não achei na documentação qual nome da fila devo usar no RabbitMQ. Poderia explicar melhor e também explicar qual tipo de fila precisa ser criado pro Evolution API conseguir conectar?

davidalpa avatar Feb 17 '24 14:02 davidalpa

ALguma atualização deste issue?

rafaeljuniorvip avatar Mar 08 '24 03:03 rafaeljuniorvip

Ainda não, continuo com o problema

davidalpa avatar Mar 10 '24 14:03 davidalpa

sigue igual

javargasm avatar May 14 '24 04:05 javargasm

pessoal alguém sabe como resolver ? não consigui também

robinhodemorais avatar May 22 '24 17:05 robinhodemorais

If you are encountering the error { "status": 500, "error": "Internal Server Error", "response": { "message": "Cannot read properties of null (reading 'assertExchange')" } }, you should check whether the exchange evolution_exchange has been created. It appears that the Evolution API is not creating this exchange, which is causing the error. You can create this exchange either through the RabbitMQ Management Interface:

Create the Exchange through the RabbitMQ Management Interface

1. Access the RabbitMQ Management Interface:

  • Go to RabbitMQ Admin Dashboard and log in with your credentials.

2. Navigate to the "Exchanges" Section:

  • Click on the Exchanges tab.

3. Add a New Exchange:

  • Complete the form to create a new exchange:

    • Name: evolution_exchange
    • Type: topic (or the type you prefer)
    • Durability: Durable (to ensure the exchange persists after restarts)
    • Auto delete: No
    • Internal: No
    • Add the Exchange:
    • Click on Add exchange.

Verify it works and enjoy!

fabolivark avatar May 31 '24 23:05 fabolivark

For me what worked was setting the following env variables:

RABBITMQ_ENABLED=true RABBITMQ_EXCHANGE_NAME=evolution_exchange

rafaelheitor avatar Jun 11 '24 18:06 rafaelheitor