[ZBX-22678] Agent2 item system.sw.packages.get is unsupported Created: 2023 Apr 14 Updated: 2024 Apr 10 Resolved: 2023 Dec 19 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G), Agent2 plugin (G) |
Affects Version/s: | 6.4.1 |
Fix Version/s: | 6.4.9rc1, 7.0.0alpha8, 7.0 (plan) |
Type: | Problem report | Priority: | Major |
Reporter: | Svyatoslav Ignatev | Assignee: | Juris Lambda |
Resolution: | Fixed | Votes: | 4 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Debian Buster 10 (4.19.0-17-amd64 #1 SMP Debian 4.19.194-2 (2021-06-21) x86_64 GNU/Linux) |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
||||||||||||
Issue Links: |
|
||||||||||||
Team: | |||||||||||||
Sprint: | Product delivery backlog | ||||||||||||
Story Points: | 1 |
Description |
On some linux servers system.sw.packages.get is unsupported with error "[Sw] Failed to parse 'dpkg --get-selections' output, err: strconv.ParseUint: parsing "": invalid syntax" Steps to reproduce:
Result: Expected: |
Comments |
Comment by Jurijs Klopovskis [ 2023 Apr 17 ] |
Seems like a regression caused by |
Comment by Juris Lambda [ 2023 Apr 20 ] |
Hi, signatev! I tried reproducing this on both systems with a build from packages, and everything appears to work as expected. See the command and info logs below:
Are these agents you're using from packages? CLOSING for now. If you do identify a scenario in which this occurs reliably, or the cause, and believe it to be a bug in Zabbix, feel free to reopen this issue. |
Comment by Svyatoslav Ignatev [ 2023 Apr 21 ] |
Found a package that will break system.sw.packages.get functionality so hopefully you will be able to reproduce it. It's a mongodb-org from mongo repository https://www.mongodb.com/docs/v6.0/tutorial/install-mongodb-on-ubuntu/ Change in environment: Ubuntu 22.04.2 LTS (5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux), mongodb-org 6.0.5 amd64. Change in reproduce steps:
The result is same. Also noticed two things. First, in those dpkg-query lists that I've sent you before some packages does not have "Installed-Size" value. You can look them up by regular expression ",$". You can also find that kind of packages by running a command: LC_ALL=C dpkg-query -W -f='${Status},${Package},${Version},${Architecture},${Installed-Size}\n' | grep -e ',$' from shell. One of those packages is supposed to be "mongodb-database-tools". Second, that package does not break that functionality on zabbix_agentd - it just ignores that package from result output |
Comment by Juris Lambda [ 2023 Apr 24 ] |
I managed to reproduce this, as per signatev's last comment, last Friday (April 21st, 2023), and it did fail as described, but today I can no longer get the mongodb packages to install as they previously did, because a dependency on libssl3 cannot be fulfilled. The packages this is failing for are meta-packages (there are a few such packages provided by the upstream developer, mongodb-org-unstable, mongodb-org-unstable-tools, mongodb-org-unstable-database-tools-extra and others), which do not have an Installed-Size attribute, hence the dpkg output field is either "unknown" or just absent, and we fail to parse it as a number. root@aa63c8d7d963:~# apt info mongodb-database-tools Package: mongodb-database-tools Version: 100.7.0 Priority: optional Section: database Maintainer: MongoDB Connectors Team <[email protected]> Installed-Size: unknown Provides: mongodb-database-tools Depends: libc6, libgssapi-krb5-2, libkrb5-3, libk5crypto3, libcomerr2, libkrb5support0, libkeyutils1 Conflicts: mongodb-database-tools Breaks: mongodb-org-tools (<= 4.3.2), mongodb-org-tools-unstable (<= 4.3.2), mongodb-enterprise-tools (<= 4.3.2), mongodb-enterprise-tools-unstable (<= 4.3.2) Replaces: mongodb-database-tools (<= 100.7.0), mongodb-org-tools (<= 4.3.2), mongodb-org-tools-unstable (<= 4.3.2), mongodb-enterprise-tools (<= 4.3.2), mongodb-enterprise-tools-unstable (<= 4.3.2) Homepage: http://www.mongodb.com Download-Size: 50.6 MB APT-Sources: https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0/multiverse amd64 Packages Description: ... Generally, metapackages from Debian contain at least a Debian changelog (changelog.Debian.gz), which allows calculating their Installed-Size. This doesn't appear to be the case for the packages in the MongoDB repository, where the meta-packages only declare dependencies. For example, the emacs metapackage looks like this: root@aa63c8d7d963:~# apt info emacs Package: emacs Version: 1:26.3+1-1ubuntu2 Priority: optional Section: universe/editors Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Rob Browning <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 77.8 kB Depends: emacs-gtk (>= 1:26.3) | emacs-lucid (>= 1:26.3) | emacs-nox (>= 1:26.3) Homepage: https://www.gnu.org/software/emacs/ Download-Size: 12.7 kB APT-Manual-Installed: yes APT-Sources: http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages Description: GNU Emacs editor (metapackage) Although uncommon, this is a valid package and valid behaviour. We should probably verify if we have the data before converting them into values. Due to the recent addition of Portage support ( I didn't immediately find a way to ignore meta-packages in dpkg's usage. |
Comment by Jason [ 2023 May 15 ] |
I'd like to add some additional details from my environment. I am encountering this exact bug on 2 of my 25 linux servers, specifically on Zabbix Agent 2 (6.4.2) on Debian 11 (5.10.0-22-amd64 #1 SMP Debian 5.10.178-3 (2023-04-22). I am using the system.sw.packages.get key in my discover rule, which means the entire discovery process fails because of this bug. In addition to the mongodb-database-tools package, the matrix keyring package also has the problem.
# LC_ALL=C dpkg-query -W -f='${Status},${Package},${Version},${Architecture},${Installed-Size}\n' | grep -e ',$' install ok installed,matrix-org-archive-keyring,1.3,all,
Details about the matrix server install in my environment: ii matrix-org-archive-keyring 1.3 all The matrix.org package repository keyring ii matrix-synapse-py3 1.83.0+bullseye1 amd64 Open federated Instant Messaging and VoIP server Just to add the mongo line as well. # LC_ALL=C dpkg-query -W -f='${Status},${Package},${Version},${Architecture},${Installed-Size}\n' | grep -e ',$' install ok installed,mongodb-database-tools,100.7.0,amd64,
Hope this gets fixed in the next release!
|
Comment by Oleg Gawriloff [ 2023 Sep 13 ] |
Experiencing the same error on appliance (debian 9 based) with some 'vendor custom' packages: So it seems that not all packages have 'installed-size' field, but as it is an appliance we can not fix that packages. |
Comment by James Howe [ 2023 Nov 06 ] |
Can confirm a missing Installed-Size appears to be the cause. In my case it's due to dcism-osc from Dell. |
Comment by Juris Lambda [ 2023 Nov 08 ] |
Fix for 7.0.0alpha8 available in feature/ZBX-22678-6.5. This patch applies without issues to 6.4. |
Comment by Juris Lambda [ 2023 Dec 18 ] |
Available in: |
Comment by Arturs Dancis [ 2023 Dec 19 ] |
Documentation updated: |