Bug 222331 - net-mgmt/net-snmp: HOST-RESOURCES-MIB::hrSWInstalled* entries become unavailable after some time
Summary: net-mgmt/net-snmp: HOST-RESOURCES-MIB::hrSWInstalled* entries become unavaila...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
Depends on:
Reported: 2017-09-14 15:44 UTC by Mathieu Arnold
Modified: 2020-07-31 12:50 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (zi)


Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer 2017-09-14 15:44:47 UTC
It appears that this MIB becomes unaccessible after a few minutes of starting snmpd.

If I restart it, I can get all the informations that are in it:

# snmpwalk -c local42 -v2c .|head

But after a few minutes, (less than 10), it becomes unavailable:

# snmpwalk -c local42 -v2c .
HOST-RESOURCES-MIB::hrSWInstalledEntry = No Such Object available on this agent at this OID
Comment 1 Ryan Steinmetz freebsd_committer freebsd_triage 2017-09-14 15:52:44 UTC
Can you provide me with some additional details on this?

This works fine for me using SNMPv3.  These are the details of one of the hosts:


net-snmp was built with:
Comment 2 Mathieu Arnold freebsd_committer 2017-09-14 15:56:45 UTC
The options I have are:

Options        :
        AX_DISABLE_TRAP: off
        AX_SOCKONLY    : off
        DOCS           : on
        DUMMY          : on
        IPV6           : on
        JAIL           : off
        MFD_REWRITES   : on
        MYSQL          : off
        PERL           : on
        PERL_EMBEDDED  : on
        PYTHON         : off
        SMUX           : on
        TKMIB          : off
        TLS            : off
        UNPRIVILEGED   : off

It happens on 10.3, 11.0 and 11.1.

and net-snmp-5.7.3_17.
Comment 3 Ryan Steinmetz freebsd_committer freebsd_triage 2017-09-14 20:31:08 UTC
Please try rebuilding without MFD_REWRITES.

Most people think that this option enables 64-bit interface counters, etc., but this isn't actually the case.  Those counters will still be there without it.

Your environment seems to match mine exactly with the only differences being the following:
- SNMPv2c vs SNMPv3

Once we narrow down which combination is causing the issue, I'll have an easier time getting this resolved with the upstream developers.

Comment 4 Mathieu Arnold freebsd_committer 2017-09-14 21:07:12 UTC
Mmmm, it is exactly what it says it does:

 │ │ [x] MFD_REWRITES     Build with 64-bit Interface Counters    │ │

If it does not do that, then the option description should reflect what it actually does :-)
Comment 5 Mathieu Arnold freebsd_committer 2017-09-14 21:08:15 UTC
I will try to disable that option though.
Comment 6 commit-hook freebsd_committer 2017-09-14 21:23:42 UTC
A commit references this bug:

Author: zi
Date: Thu Sep 14 21:23:14 UTC 2017
New revision: 449855
URL: https://svnweb.freebsd.org/changeset/ports/449855

  - Update MFD description

  PR:		222331

Comment 7 Ryan Steinmetz freebsd_committer freebsd_triage 2017-09-14 21:23:54 UTC
Fantastic point.  Committed!
Comment 8 Mathieu Arnold freebsd_committer 2017-09-14 21:34:44 UTC
So, rebuilt it:


I still have the same problem. It works for a few minutes, and then I get:

# snmpwalk -c local42 -v2c .
HOST-RESOURCES-MIB::hrSWInstalledEntry = No Such Object available on this agent at this OID
Comment 9 Ryan Steinmetz freebsd_committer freebsd_triage 2017-09-15 11:49:05 UTC
After investigating the debug log you provided, we're seeing this error:
SWInst: error opening pkgng db

Which means that this call to open the pkgdb is failing:
pkgdb_open(&db, PKGDB_DEFAULT)

We will need to figure out why the call to pkgdb_open() isn't returning EPKG_OK to solve this.
Comment 10 Dan Langille freebsd_committer 2020-07-31 12:50:06 UTC
I've encountered this situation on FreeBSD 12.1 with net-snmp-5.7.3_20,1