toolkit fails to detect NTP (chrony) and errors out without details
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 37
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
Just faced this : I moved all my servers to chronyd (ntpd is not an CentOS8 thing for instance, be warned), and the check-mk ps-etf monitoring pages were saying (and are still saying, but hopefuilly for 1 hour only) :
CRITICAL - Connection failed (500 Server Error: Internal Server Error)
=> Connection failed != Error 500, but whatever.
Looking at our host web url : toolkit/services/host.cgi?method=get_summary I indeed got errors 500.
Running as apache # perl /usr/lib/perfsonar/web-ng/root/services/host.cgi 'method=get_summary' , I got :
/usr/lib/perfsonar/web-ng/root/services/host.cgi 'method=get_summary'
2019/11/18 14:50:38 (275477) ERROR> Host.pm:286 perfSONAR_PS::NPToolkit::DataService::Host::get_details - Found host record in LS using 192.54.207.250
2019/11/18 14:50:39 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking owamp
2019/11/18 14:50:40 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking twamp
2019/11/18 14:50:40 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking psconfig
2019/11/18 14:50:40 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking pscheduler
Alarm clock
Further debugging showed that this line was in cause :
perfSONAR_PS::NPToolkit::DataService::Host::get_details(/usr/lib/perfsonar/web-ng/root/services/../../../lib/perfSONAR_PS/NPToolkit/DataService/Host.pm:330):
330: $status->{ntp}->{synchronized} = $ntp->is_synced();
I then tried to configure chronyd to listen on localhost on port 123 and allowed our public facing IP in an "allow x.y.z" statement : bingo : the script runs and the cgi returns a json.
Looks like ntp query error handling isn't working as expected, is it ?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/perfSONAR_PS/NPToolkit/DataService/Host.pm, especially get_details around line 330 and the is_synced call. Run toolkit/services/host.cgi with method=get_summary as apache while reproducing the chronyd setup, then verify that an NTP query failure produces useful error details and does not terminate the request with HTTP 500 or an alarm.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- centos, perl
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100