Bug 707079

Summary: tuned crashes due to nic bonding
Product: Red Hat Enterprise Linux 6 Reporter: Troels Arvin <troels>
Component: tunedAssignee: Jan Vcelak <jvcelak>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: azelinka, djuran, frank.swasey, kyoshida, pkovar, psklenar, rvokal, syamazak, tsmetana, twoerner
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, using NIC bonding could have led to an unexpected termination of "tuned". With this update, the network device type determination has been fixed by handling more error conditions so that the aforementioned bug no longer occurs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-18 06:43:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Troels Arvin 2011-05-23 22:40:44 UTC
Description of problem:
tuned cannot start; seems to be related to NIC bonding

Version-Release number of selected component (if applicable):
tuned-0.2.19-4.el6.noarch

How reproducible:
Every time

Steps to Reproduce:
1. /sbin/service tuned start
2. /sbin/service tuned status
  
Actual results:
"tuned dead but subsys locked"

Expected results:
Should see that tuned is running.

Additional info:
When trying to start tuned manually:
[root@hostname net]# /usr/sbin/tuned -c /etc/tuned.conf
Traceback (most recent call last):
  File "/usr/sbin/tuned", line 103, in <module>
    tuned.init(TUNEDDIR, cfgfile, debug = debug)
  File "/usr/share/tuned/tuned.py", line 82, in init
    self.__initplugins__(path, "monitorplugins", self.mp)
  File "/usr/share/tuned/tuned.py", line 43, in __initplugins__
    exec _cmd
  File "<string>", line 1, in <module>
  File "/usr/share/tuned/monitorplugins/net.py", line 135, in <module>
    _plugin = NetMonitor()
  File "/usr/share/tuned/monitorplugins/net.py", line 33, in __init__
    tunable = self._tunable_devices()
  File "/usr/share/tuned/monitorplugins/net.py", line 44, in _tunable_devices
    tunable = filter(self._device_is_tunable, devices)
  File "/usr/share/tuned/monitorplugins/net.py", line 48, in _device_is_tunable
    if self._device_type(name) in "virtual":
  File "/usr/share/tuned/monitorplugins/net.py", line 56, in _device_type
    path = os.path.join(os.path.dirname(path), os.readlink(path))
OSError: [Errno 22] Invalid argument: '/sys/class/net/bonding_masters'


And in /var/log/messages:
May 24 00:40:00 hostname python: abrt: detected unhandled Python exception in /usr/sbin/tuned

Comment 2 Jan Vcelak 2011-05-24 08:29:26 UTC
Easy to fix. Patch committed upstream.
http://git.fedorahosted.org/git/?p=tuned.git;a=commit;h=ba38290

Comment 5 Kazu Yoshida 2011-07-28 03:40:32 UTC
Any updates on this issue?

Comment 8 Frank Swasey 2011-07-28 13:25:49 UTC
I have to report that I have pulled tuned from the git repository and built the RPM and installed it on an RHEL6.1 system and it still fails with the errors as originally reported:

backtrace
-----
net.py:57:_device_type:OSError: [Errno 22] Invalid argument: '/sys/class/net/bonding_masters'

Traceback (most recent call last):
  File "/usr/sbin/tuned", line 129, in <module>
    tuned.init(TUNEDDIR, cfgfile, debug = debug)
  File "/usr/share/tuned/tuned.py", line 82, in init
    self._initplugins(path, "monitorplugins", self.mp)
  File "/usr/share/tuned/tuned.py", line 43, in _initplugins
    exec _cmd
  File "<string>", line 1, in <module>
  File "/usr/share/tuned/monitorplugins/net.py", line 134, in <module>
    _plugin = NetMonitor()
  File "/usr/share/tuned/monitorplugins/net.py", line 33, in __init__
    tunable = self._tunable_devices()
  File "/usr/share/tuned/monitorplugins/net.py", line 44, in _tunable_devices
    tunable = filter(self._device_is_tunable, devices)
  File "/usr/share/tuned/monitorplugins/net.py", line 48, in _device_is_tunable
    if self._device_type(name) in "virtual":
  File "/usr/share/tuned/monitorplugins/net.py", line 57, in _device_type
    path = os.path.join(os.path.dirname(path), os.readlink(path))
OSError: [Errno 22] Invalid argument: '/sys/class/net/bonding_masters'

Local variables in innermost frame:
path: '/sys/class/net/bonding_masters'
self: <monitorplugins.net.NetMonitor instance at 0x7ffe77b8fe18>
name: 'bonding_masters'

and in /var/log/messages:

Jul 28 09:18:39 hostname python: abrt: detected unhandled Python exception in /usr/sbin/tuned

Comment 9 Thomas Woerner 2011-07-28 14:26:49 UTC
Please change the line
  except (IOError, AttributeError):
to 
  except (IOError, AttributeError, OSError):
in the patch.

Comment 11 Frank Swasey 2011-07-28 14:42:30 UTC
Tested and confirmed that it works now!

Thanks!
  Frank Swasey

Comment 12 Petr Kovar 2011-07-29 14:14:44 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, using NIC bonding could have led to an unexpected termination of "tuned". With this update, the network device type determination has been fixed by handling more error conditions so that the aforementioned bug no longer occurs.

Comment 18 errata-xmlrpc 2011-08-18 06:43:01 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1176.html