Debian collectd NTP plugin logging stacktraces

Bug #1998503 reported by Al Bailey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Al Bailey

Bug Description

Brief Description
-----------------
ON a Debian system with NTP enabled, collectd log shows stacktraces.

Severity
--------
Minor

Steps to Reproduce
------------------
Setup a Debian system
Enable NTP before unlocking. ex: system ntp-modify ntpservers=0.pool.ntp.org,1.pool.ntp.org
Check /var/log/collectd.log

Expected Behavior
------------------
collectd logs should not show NTP related stacktraces

Actual Behavior
----------------
Logs stacktraces related to the failed NTP collectd plugin.

Reproducibility
---------------
100% (if you setup the system with NTP enabled on Debian)

System Configuration
--------------------
Debian. NTP. controller type does not matter.

Branch/Pull Time/Commit
-----------------------
Nov 17, 2022

Last Pass
---------
N/A

Timestamp/Logs
--------------
2022-11-17T18:35:11.526 controller-0 collectd[83599]: info Unhandled python exception in read callback: FileNotFoundError: [Errno 2] No such file or directory: '/usr/sbin/ntpq'
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info Traceback (most recent call last):
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info File "/opt/collectd/extensions/python/ntpq.py", line 718, in read_func
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info data = subprocess.check_output([PLUGIN_EXEC, PLUGIN_EXEC_OPTIONS], encoding='utf-8')
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info File "/usr/lib/python3.9/subprocess.py", line 505, in run
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info with Popen(*popenargs, **kwargs) as process:
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info File "/usr/lib/python3.9/subprocess.py", line 951, in _init_
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info self._execute_child(args, executable, preexec_fn, close_fds,
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info raise child_exception_type(errno_num, err_msg, err_filename)
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info FileNotFoundError: [Errno 2] No such file or directory: '/usr/sbin/ntpq'
2022-11-17T18:35:11.532 controller-0 collectd[83599]: info read-function of plugin `python.ntpq' failed. Will suspend it for 600.000 seconds.

Test Activity
-------------
Developer Testing

Workaround
----------
None. I am uploading a fix

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to monitoring (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/monitoring/+/866346

Changed in starlingx:
status: New → In Progress
Al Bailey (albailey1974)
Changed in starlingx:
assignee: nobody → Al Bailey (albailey1974)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to monitoring (master)

Reviewed: https://review.opendev.org/c/starlingx/monitoring/+/866346
Committed: https://opendev.org/starlingx/monitoring/commit/c9a017b1d77e9edb1582dffc037831c3ff1612aa
Submitter: "Zuul (22348)"
Branch: master

commit c9a017b1d77e9edb1582dffc037831c3ff1612aa
Author: Al Bailey <email address hidden>
Date: Thu Dec 1 15:43:26 2022 +0000

    Fix Debian NTP path used by collectd plugin

    The collectd log was showing stacktraces on Debian
    when attempting to invoke the ntp plugin.

    ntpq is located at /usr/bin/ntpq on Debian.

    The plugin will now use that location when running
    on Debian. This will prevent the stacktraces, and
    fixes how collect monitors NTP.

    Test Plan:
      Build / Install / Provision AIO-SX. Enable NTP.
      Verify collectd logs are clean.

    Closes-Bug: #1998503
    Signed-off-by: Al Bailey <email address hidden>
    Change-Id: I23130022c92023773ace22b674845761e0ff23ec

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.8.0 stx.monitor
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.