nats-io / nats-top

A top-like tool for monitoring NATS servers.
https://nats.io
MIT License
355 stars 30 forks source link

nats-top: /varz smoke test failed: could not get stats from server #103

Open jackylouying opened 4 weeks ago

jackylouying commented 4 weeks ago

What version were you using?

v2.10.22

What environment was the server running in?

oracle linux 9

Is this defect reproducible?

yes

Given the capability you are leveraging, describe your expectation?

nats-top: /varz smoke test failed: could not get stats from server: Get "http://127.0.0.1:4222/varz": malformed HTTP status code "{\"server_id\":\"NBBDDMM6A6F5EPDX7VCQTJCAI3626GPAGDC7OPNYQSI26HEP77BY35LI\",\"server_name\":\"NBBDDMM6A6F5EPDX7VCQTJCAI3626GPAGDC7OPNYQSI26HEP77BY35LI\",\"version\":\"2.10.22\",\"proto\":1,\"git_commit\":\"240e9a4\",\"go\":\"go1.22.8\",\"host\":\"0.0.0.0\",\"port\":4222,\"headers\":true,\"max_payload\":1048576,\"client_id\":16,\"client_ip\":\"127.0.0.1\",\"xkey\":\"XCUZNSLI73VMSSWZ3BGH54RKBB5ZGJZ3BIY5WA2B4CPWKYNZOMKWD22G\"}"

Given the expectation, what is the defect you are observing?

[v2.10.22](nats-top: /varz smoke test failed: could not get stats from server: Get "http://127.0.0.1:4222/varz": malformed HTTP status code "{\"server_id\":\"NBBDDMM6A6F5EPDX7VCQTJCAI3626GPAGDC7OPNYQSI26HEP77BY35LI\",\"server_name\":\"NBBDDMM6A6F5EPDX7VCQTJCAI3626GPAGDC7OPNYQSI26HEP77BY35LI\",\"version\":\"2.10.22\",\"proto\":1,\"git_commit\":\"240e9a4\",\"go\":\"go1.22.8\",\"host\":\"0.0.0.0\",\"port\":4222,\"headers\":true,\"max_payload\":1048576,\"client_id\":16,\"client_ip\":\"127.0.0.1\",\"xkey\":\"XCUZNSLI73VMSSWZ3BGH54RKBB5ZGJZ3BIY5WA2B4CPWKYNZOMKWD22G\"}")

federicocagnola commented 3 days ago

@jackylouying I had the same issue until i noticed that the monitoring port should be different from the server port. From your logs I see you had the same configuration i had. Try this instead:

Launch the server process with:

nats-server -p 4222 -m 8222

this will start the server on the regular port (-p) but also open the monitoring port so you can use nats-top

Then you run nats top with:

nats-top -m 8222

It should work

jackylouying commented 3 days ago

it works. thanks federicocagnola