Bug 2075535

Summary: net-snmp does not start with new rpm SQLite DB
Product: Red Hat Enterprise Linux 9 Reporter: Daniel Juarez <djuarezg>
Component: net-snmpAssignee: Josef Ridky <jridky>
Status: ASSIGNED --- QA Contact: CS System Management SST QE <rhel-cs-system-management-subsystem-qe>
Severity: high Docs Contact:
Priority: high    
Version: CentOS StreamCC: alex.iribarren, bstinson, casl, jcastran, jridky, jwboyer, lionel.cons, ovasik, zguo
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Juarez 2022-04-14 13:14:35 UTC
Description of problem:


After https://fedoraproject.org/wiki/Changes/Sqlite_Rpmdb, rpm changed from Berkeley DB to SQLite. SNMP is using these hardcoded paths to determine where RPM info is, so for example net-snmp-5.9.1-7.el9 [1] is trying to search for /var/lib/rpm/Packages and fails with the following error otherwise 


Can't find directory of RPM packages


[1] https://fossies.org/linux/net-snmp/agent/mibgroup/host/data_access/swinst_rpm.c

Version-Release number of selected component (if applicable):

net-snmp-5.9.1-7.el9


Steps to Reproduce:
1. yum install net-snmp net-snmp-utils
2. systemctl enable snmpd
3. systemctl start snmpd

Basically you get a different rpm dir struct, so code should take this into account:

[root@juarezcs9 ~]# ls /var/lib/rpm
rpmdb.sqlite  rpmdb.sqlite-shm  rpmdb.sqlite-wal

Comment 1 Josef Ridky 2022-07-07 08:06:32 UTC
*** Bug 2094235 has been marked as a duplicate of this bug. ***

Comment 2 Josef Ridky 2022-07-18 10:05:36 UTC
You're still getting set of installed packages correctly, the error message is the only redundant information in snmpd log.

I'll contact upstream authors and try to find some solution.

Comment 3 lionel.cons 2023-03-16 13:38:46 UTC
Josef, six months have passed now. Do you have any update?

Comment 4 Josef Ridky 2023-06-23 07:36:25 UTC
Hi,

I'll ping upstream for the update.