chrony_exporter icon indicating copy to clipboard operation
chrony_exporter copied to clipboard

Serverstats don't work on Chrony 4.5

Open mdavids opened this issue 1 year ago • 6 comments

Am I doing something wrong?

Debug logging shows:

ts=2024-06-12T12:23:23.546Z caller=collector.go:183 level=debug scrape_id=2 msg="Couldn't get serverstats" err="not implemented reply type 25 from &{Version:6 PKTType:reply Res1:0 Res2:0 Command:54 Reply:25 Status:SUCCESS Pad1:0 Pad2:0 Pad3:0 Sequence:2 Pad4:0 Pad5:0}"

Started with:

chrony_exporter --web.config.file=/web-config.yml --web.listen-address=198.51.100.123:9123 --web.listen-address=[2001:db8::123]:9123 --log.level=debug --chrony.address=unix:///run/chrony/chronyd.sock --collector.chmod-socket --collector.sources --collector.serverstats --no-collector.dns-lookups

chronyd (chrony) version 4.5 (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)

on x86_64 Linux.

Probably depends on: https://github.com/facebook/time/issues/363

Also wondering is this should be a debug message or a warning? https://github.com/SuperQ/chrony_exporter/blob/1826c4053073f53d538776203838f79c2ef92085/collector/collector.go#L183

mdavids avatar Jun 12 '24 12:06 mdavids

Yea, that issue looks related. I wonder if we can expose these packet issues in the exporter.

SuperQ avatar Jun 12 '24 12:06 SuperQ

There is now a pull request: https://github.com/facebook/time/pull/367

I assume some work also needs to be done on the chrony_exporter side?

mdavids avatar Jun 18 '24 08:06 mdavids

At a minimum, we will need to update the library version.

SuperQ avatar Jun 18 '24 17:06 SuperQ

Thanks for the work. The errors have changed (which is good, I guess) and no serverstats appear just yet:

ts=2024-06-27T14:06:57.720Z caller=serverstats.go:146 level=debug scrape_id=1 msg="Got 'serverstats' response" serverstats_packet=SUCCESS
ts=2024-06-27T14:06:57.720Z caller=collector.go:183 level=debug scrape_id=1 msg="Couldn't get serverstats" err="got wrong 'serverstats' response: &{{'\\x06' \"reply\" '\\x00' '\\x00' '6' '\\x19' \"SUCCESS\" '\\x00' '\\x00' '\\x00' '\\x02' '\\x00' '\\x00'} {'᧵' '\\x00' 'N' '\\x00' '\\x00' '\\x00' 'É' '\\x00' '\\x00' '\\x03' '\\u0081' '\\x00' '᧵' '᧵' '\\x00' '\\x00' '\\x00'}}"
ts=2024-06-27T14:07:01.794Z caller=serverstats.go:146 level=debug scrape_id=2 msg="Got 'serverstats' response" serverstats_packet=SUCCESS
ts=2024-06-27T14:07:01.794Z caller=collector.go:183 level=debug scrape_id=2 msg="Couldn't get serverstats" err="got wrong 'serverstats' response: &{{'\\x06' \"reply\" '\\x00' '\\x00' '6' '\\x19' \"SUCCESS\" '\\x00' '\\x00' '\\x00' '\\x02' '\\x00' '\\x00'} {'ᨆ' '\\x00' 'S' '\\x00' '\\x00' '\\x00' 'Ë' '\\x00' '\\x00' '\\x03' '\\u0081' '\\x00' 'ᨆ' 'ᨆ' '\\x00' '\\x00' '\\x00'}}"

https://github.com/facebook/time/blob/main/cmd/ntpcheck/checker/chrony.go#L188

chronyd (chrony) version 4.5 (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)

mdavids avatar Jun 27 '24 14:06 mdavids

Still waiting for the pull request to come through.

mdavids avatar Jul 29 '24 13:07 mdavids

Adding comment just to add that I"m affected by this and am waiting for the resolution.

spaullilly avatar Aug 13 '24 16:08 spaullilly

It works - thank you!

mdavids avatar Oct 09 '24 13:10 mdavids