Bug 1580480

Summary: ironic-dbsync.log has errors related to loading classic drivers and pysnmp_mibs
Product: Red Hat OpenStack Reporter: Bob Fournier <bfournie>
Component: python-proliantutilsAssignee: Ilya Etingof <ietingof>
Status: CLOSED ERRATA QA Contact: mlammon
Severity: low Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: bfournie, hbrock, ietingof, joflynn, jschluet, jslagle, jtrowbri, mburns, srevivo
Target Milestone: z2Keywords: Triaged, ZStream
Target Release: 13.0 (Queens)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-proliantutils-2.5.0-4.el7ost Doc Type: Bug Fix
Doc Text:
When the ironic-dbsync utility tried to load the ironic drivers and when a driver imported the proliantutils.ilo client module, the proliantutils library tried to load all of the pysnmp MIBs. If the ironic-dbsync process resided in an unreadable CWD, pysnmp failed when trying to search for MIBs in CWD. This results in the following error messages in ironic-dbsync.log on deployment: Unable to load classic driver fake_drac: MIB file pysnmp_mibs/CPQIDA-MIB.pyc access error: [Errno 13] Permission denied: 'pysnmp_mibs': MibLoadError: MIB file pysnmp_mibs/CPQIDA-MIB.pyc access error: [Errno 13] Permission denied: 'pysnmp_mibs' An update to proliantutils ensures that pysnmp does not load all MIBs on module import. This avoids the situation when an MIB search is attempted prior to the moment of being explicitly requested by the application.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-29 16:32:35 UTC 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:
Attachments:
Description Flags
ironic-dbsync.log none

Description Bob Fournier 2018-05-21 14:49:25 UTC
Created attachment 1439644 [details]
ironic-dbsync.log

Description of problem:

Following a deployment the ironic-dbsync.log has these error messages:

ironic/ironic-dbsync.log:2018-04-12 14:35:39.947 23662 WARNING ironic.common.driver_factory [req-75bb0eae-6c3e-47b3-afe1-5a2b91a04d5b - - - - -] Unable to load classic driver fake_drac: MIB file pysnmp_mibs/CPQIDA-MIB.pyc access error: [Errno 13] Permission denied: 'pysnmp_mibs': MibLoadError: MIB file pysnmp_mibs/CPQIDA-MIB.pyc access error: [Errno 13] Permission denied: 'pysnmp_mibs'


This does not appear to be causing any functional problems.

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

(undercloud) [stack@host01 log]$ rpm -qa | grep ironic
openstack-ironic-conductor-10.1.2-0.20180326121311.ef08927.el7ost.noarch
puppet-ironic-12.3.1-0.20180326225303.3956a4c.el7ost.noarch
python-ironic-lib-2.12.0-1.el7ost.noarch
openstack-ironic-common-10.1.2-0.20180326121311.ef08927.el7ost.noarch
openstack-ironic-api-10.1.2-0.20180326121311.ef08927.el7ost.noarch
python2-ironicclient-2.2.0-1.el7ost.noarch

(undercloud) [stack@host01 log]$ rpm -qa | grep pysnmp
python-pysnmp-4.3.2-3.el7ost.noarch

How reproducible:

Seems to be logged each deployment.

Comment 1 Ilya Etingof 2018-05-24 11:04:23 UTC
Just to share my thoughts on this...

It seems that this business has something to do with the `proliantutils` package. Whilst migrating the database, ironic tries to load its drivers. Whenever a driver imports `proliantutils.ilo.client` while being in an unreadable CWD, pysnmp fails on EACCESS.

Here is a quite artificial but concise reproducer:

[stack@host01 ~]$ cd /tmp/unreadable/
[stack@host01 unreadable]$ chmod 666 .
[stack@host01 unreadable]$ python -c 'import proliantutils.ilo.client'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/proliantutils/ilo/client.py", line 21, in <module>
    from proliantutils.ilo.snmp import snmp_cpqdisk_sizes as snmp
  File "/usr/lib/python2.7/site-packages/proliantutils/ilo/snmp/snmp_cpqdisk_sizes.py", line 33, in <module>
    mibBuilder = mBuilder.loadModules('CPQIDA-MIB', 'CPQSCSI-MIB')
  File "/usr/lib/python2.7/site-packages/pysnmp/smi/builder.py", line 337, in loadModules
    self.loadModule(modName, **userCtx)
  File "/usr/lib/python2.7/site-packages/pysnmp/smi/builder.py", line 283, in loadModule
    modData, sfx = mibSource.read(modName)
  File "/usr/lib/python2.7/site-packages/pysnmp/smi/builder.py", line 68, in read
    pycData = self._getData(f + pycSfx, pycMode)
  File "/usr/lib/python2.7/site-packages/pysnmp/smi/builder.py", line 211, in _getData
    raise error.MibLoadError('MIB file %s access error: %s' % (p, why))
pysnmp.smi.error.MibLoadError: MIB file pysnmp_mibs/CPQIDA-MIB.pyc access error: [Errno 13] Permission denied: 'pysnmp_mibs'

I believe that `proliantutils` could be patched up not to load MIBs on import as well as not to search for `pysnmp-mibs` which is likely to be absent on the system (proliantutils carries its own copy of these MIBs).

On the other hand, is it that `ironic-dbsync` is being invoked from an unreadable directory? The easiest immediate (and dirty) fix perhaps would be to make CWD readable...

Comment 2 Bob Fournier 2018-06-22 10:40:29 UTC
Just moving back to to ON_DEV until patch merges in stable/queens since this is targeted to 13.z.

Comment 3 Bob Fournier 2018-06-22 12:00:23 UTC
Forgot there were no branches for proliantutils, moving back to POST.

Comment 13 mlammon 2018-08-08 22:06:56 UTC
Deployed osp13 UC + OC (3 controller, 2 compute, 3 ceph) using puddle 2018-08-03.3

Environment:
python-proliantutils-2.5.0-4.el7ost.noarch

Could not duplicate issue. No errors or warnings as described in description.

Comment 14 Joanne O'Flynn 2018-08-13 11:19:01 UTC
This bug is marked for inclusion in the errata but does not currently contain draft documentation text. To ensure the timely release of this advisory please provide draft documentation text for this bug as soon as possible.

If you do not think this bug requires errata documentation, set the requires_doc_text flag to "-".


To add draft documentation text:

* Select the documentation type from the "Doc Type" drop down field.

* A template will be provided in the "Doc Text" field based on the "Doc Type" value selected. Enter draft text in the "Doc Text" field.

Comment 16 errata-xmlrpc 2018-08-29 16:32:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2573