davidMcneil / rants

An async NATS client library for the Rust programming language.
Apache License 2.0
81 stars 11 forks source link

Received invalid server message, invalid control line #1

Closed Kvikal closed 5 years ago

Kvikal commented 5 years ago

Hello,

I have run into an issue connecting to the official NATS server (gnatsd).

Each connection attempt fails with following message:

Received invalid server message, err: invalid control line "INFO {\"server_id\":\"EIcTs1hcrlywWCrsUATcqP\",\"version\":\"1.1.0\",\"git_commit\":\"add6d79\",\"go\":\"go1.9.4\",\"host\":\"0.0.0.0\",\"port\":4222,\"auth_required\":false,\"tls_required\":false,\"tls_verify\":false,\"max_payload\":1048576} \r\n"

The server version is quite old now, so it might be a gnatsd bug.

Kvikal commented 5 years ago

This issue does not seem to occur with gnatsd 1.4.0.

davidMcneil commented 5 years ago

Thank you for opening an issue.

I believe the specific reason this INFO message did not parse is that it is missing the proto field. This field was added in version 1.2 of the server. I am working on improving the parser to make the error message more informative and will also make the proto field optional to support older servers.

davidMcneil commented 5 years ago

Resolved in version 0.3.0 by commit 4e9929.