d.braun1991
d.braun1991

Reputation: 515

NATS throwing "protocol exception, INFO not received"

This is about NATS messaging

One NATS instance was deployed on our docker server. For testing purposes I try to connect to it via terminal/bash.


ping hostname

NATS-tools is installed locally on my machine.

nats --server hostname:5333 rtt
nats: error: nats: no servers available for connection

Thats fine & just as expected


nats --server hostname:4222 rtt
nats: error: nats: protocol exception, INFO not received

This leaves me questinong what went wrong. It feels like NATS was reached and thereafter something went wrong, which ends in an 'unfinished' state for the local NATS tools.


The https://docs.nats.io/ 'search help' tries to "AI-hallucinate" its way out of the situation.

The error message nats: error: nats: protocol exception, INFO not received indicates that the NATS client expected to receive an INFO message from the server upon connection, but did not. In the NATS cluster protocol, when a server accepts a connection from another server, it sends an INFO message containing its configuration and security details. Not receiving this message can signal a protocol exception, causing the error - This error might occur if there is a misconfiguration, network issue, or the server is not sending the expected INFO message immediately as per the protocol requirements.


We haven't had time to dig deeper into the topic. Still, if there is any explanation beyond the AI-generated network explanation, please feel free to answer.


You may wonder: Why do I write this before checking the network?

Best wishes and keep coding :)

Upvotes: 1

Views: 29

Answers (1)

d.braun1991
d.braun1991

Reputation: 515

After some research we managed to find the issue. :)

tl;dr: NATS was configured behind another port we missed to address correctly.

Wrong port (not assigned)

The first reply ..

nats --server hostname:5333 rtt
nats: error: nats: no servers available for connection

.. was given due to the Port was not mapped to anything on the host server. A default TCP-Reset ended the connection.

Wrong port (not NATS)

The second reply ..

nats --server hostname:4222 rtt
nats: error: nats: protocol exception, INFO not received

.. was given due to some other service listening to the port. The first handshake was accepted, but the other service - obviously - did not follow the NATS protocoll.

Now that we see this, we recover the lost company knowledge from 'back then' and remember the reason, why we used another port for our NATS instance.

Correct port (NATS is here)

Finally using the correct port ..

nats --server hostname:12345 rtt
nats://hostname:12345:
   nats://IpAdress:12345: 678.876µs

.. the call passes smoothly all previous network issues.

Yaaay :D

Upvotes: 0

Related Questions