fleet
fleet copied to clipboard
only use software collection queries for the approriate distrobutions of Linux
Fleet version: 4.29.1 Operating system: RHEL 8.7
🧑💻 Expected behavior
Fleet uses OSQuery to determine which package format table (rpm_packages vs deb_packages) to run on each endpoint.
💥 Actual behavior
When collecting software on Linux endpoints Fleet appears to try and query both rpm_packages and deb_packages. This results in error messages for the opposite packaging manager.
For example on a RHEL endpoint I see.
osqueryd.WARNING.20230516-220048.2565318:E0517 08:59:01.680903 2565457 glog_logger.cpp:26] deb_packages: Failed to open the dpkg database: InvalidAdminDirPath (admindir='/var/lib/dpkg') osqueryd.WARNING.20230516-220048.2565318:E0517 09:19:51.085424 2565457 glog_logger.cpp:26] deb_packages: Failed to open the dpkg database: InvalidAdminDirPath (admindir='/var/lib/dpkg') osqueryd.WARNING.20230516-220048.2565318:E0517 09:40:38.888865 2565457 glog_logger.cpp:26] deb_packages: Failed to open the dpkg database: InvalidAdminDirPath (admindir='/var/lib/dpkg') osqueryd.WARNING.20230516-220048.2565318:E0517 10:01:24.586581 2565457 glog_logger.cpp:26] deb_packages: Failed to open the dpkg database: InvalidAdminDirPath (admindir='/var/lib/dpkg') osqueryd.WARNING.20230516-220048.2565318:E0517 10:22:07.588660 2565457 glog_logger.cpp:26] deb_packages: Failed to open the dpkg database: InvalidAdminDirPath (admindir='/var/lib/dpkg') osqueryd.WARNING.20230516-220048.2565318:E0517 10:42:52.475329 2565457 glog_logger.cpp:26] deb_packages: Failed to open the dpkg database: InvalidAdminDirPath (admindir='/var/lib/dpkg')
👣 Reproduction steps
Enroll a RPM system and watch WARNING log for deb_package errors.
More info
Use the results from os_version to determine which package manager is present on the endpoint and only use that one.
@kswagler-rh I apologize for the delay in responding and I thank you for submitting a ticket for this issue.
I was just able to reproduce this locally with a CentOS machine. We'll get this seen by the engineering team and prioritized for a fix.
Reproduce
- Install a CentOS machine into Fleet.
- On the CentOS host run
tail -f /var/log/messagesin a terminal window. - Watch the logs for the reported error
Failed to open the dpkg database: InvalidAdminDirPath (admindir='var/lib/dpkg')
https://github.com/osquery/osquery/issues/8055
This bug has aged out. Moving back to drafting.
Bug has aged out. Moved back to drafting
https://github.com/osquery/osquery/issues/8055 has been fixed in 5.12.0. Such change fixes the noisy logs in CentOS hosts shown in the description.
PS: As a future optimization Fleet should not send the deb_packages query to CentOS devices.