You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot assign null to property Basis\\Nats\\Connection::$infoMessage of type Basis\\Nats\\Message\\Info in /var/www/app/vendor/basis-company/nats/src/Connection.php:202
#92
Open
webspec2012 opened this issue
Jul 16, 2024
· 2 comments
Hello, this error will occur if the client connects to a server that does not support the Nats protocol, since in the Nats protocol the server must send a special message with information about the connection when connecting
This error will also occur if the server does not respond within the allotted time with an information message after initializing the TCP connection
But there is a bug in the code with the processing of the information message, which can clearly be of type null and is assigned to an attribute that cannot be null
# telnet localhost 4222
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
INFO {"server_id":"NBDH32DTZDVFYXP4MNYQZPAFUDSSJWJH23KYOWSEPSPT6K5LTFPX36BN","server_name":"NBDH32DTZDVFYXP4MNYQZPAFUDSSJWJH23KYOWSEPSPT6K5LTFPX36BN","version":"2.10.18","proto":1,"git_commit":"57d23ac","go":"go1.22.5","host":"0.0.0.0","port":4222,"headers":true,"max_payload":1048576,"client_id":13,"client_ip":"172.16.15.1","cluster":"NATS","connect_urls":["172.16.15.2:4222","172.16.15.3:4222","172.16.15.4:4222"],"xkey":"XAGJSQJ7GFMN4PVB6HW366RII7DMIH44HY7HM6HVZIMQLPXHNFMVK44B"}
^]
telnet> quit
Connection closed.
$infoMessage = $this->getMessage($config->timeout);
if(! $infoMessage) {
throw new Exception('INFO message from the server was not received');
}
assert($infoMessage instanceof Info);
$this->infoMessage = $infoMessage;
No description provided.
The text was updated successfully, but these errors were encountered: