Bug 1156256

Summary: rhevh 7.0: Throw traceback error info when using "sosreport" command
Product: Red Hat Enterprise Virtualization Manager Reporter: haiyang,dong <hadong>
Component: ovirt-nodeAssignee: Anatoly Litovsky <tlitovsk>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 3.5.0CC: aberezin, cshao, dfediuck, ecohen, fdeutsch, gklein, gouyang, hadong, huiwa, iheim, leiwang, lsurette, ycui
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: node
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-11 21:05:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1094719    

Description haiyang,dong 2014-10-24 02:51:58 UTC
Description of problem:
using "sosreport" command to collect diagnostic and configuration information from rhevh 7.0
failed with thrown traceback error info like follow:
[root@dhcp-66-73-195 admin]# sosreport 
Traceback (most recent call last):
  File "/sbin/sosreport", line 23, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1174, in main
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 538, in __init__
  File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 196, in get_tmp_dir
NameError: global name 'tempfile' is not defined


Version-Release number of selected component (if applicable):
rhev-hypervisor7-7.0-20141006.0.el7ev
ovirt-node-3.1.0-0.20.20141006gitc421e04.el7.noarch.rpm
sos-3.0-23.el7.noarch

How reproducible:
100% 
 
Steps to Reproduce:

Actual result:

Expect result:


Additional info:

Comment 1 Anatoly Litovsky 2014-11-06 20:54:34 UTC
Here is the problem .
This is the code that serach the correct policy
def _find_plugins_in_dir(self, path):
        if os.path.exists(path):
            py_files = list(find("*.py", path))
            pnames = self._get_plugins_from_list(py_files)
            if pnames:
                return pnames
            else:
                return []

It searches for .py modules
We have only .pyc modules.

Whats our policy ? 
return .py / fix code of sos / move the bug to sos people .

Comment 2 Anatoly Litovsky 2014-11-06 20:56:51 UTC
I see the patch in our code that adds pyc , checking if its still working in build

Comment 3 Anatoly Litovsky 2014-11-10 06:11:00 UTC
found the answer

Comment 7 haiyang,dong 2014-12-18 01:55:56 UTC
Test version:
rhev-hypervisor7-7.0-20141212.0.iso
ovirt-node-3.1.0-0.34.20141210git0c9c493.el7.noarch
sos-3.0-23.el7_0.4.noarch

Test Steps:
1.using "sosreport" command to collect diagnostic and configuration information from rhevh 7.0
[root@dhcp-9-55 admin]# sosreport 

sosreport (version 3.0)

This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.

An archive containing the collected information will be generated in
/var/tmp and may be provided to a Red Hat support representative.

Any information provided to Red Hat will be treated in accordance with
the published support policies at:

  https://access.redhat.com/support/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.

Press ENTER to continue, or CTRL-C to quit.

Please enter your first initial and last name [dhcp-9-55.nay.redhat.com]: 
Please enter the case number that you are generating this report for: 

glusterfs: no process found
glusterfsd: no process found
 Running plugins. Please wait ...

  Running 56/67: system...        system     
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 974, in collect
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 603, in collect
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 338, in do_copy_file_or_dir
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 294, in copy_dir
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 338, in do_copy_file_or_dir
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 294, in copy_dir
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 338, in do_copy_file_or_dir
  File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 293, in copy_dir
OSError: [Errno 19] No such device: '/proc/sys/fs/binfmt_misc'

  Running 67/67: yum...              
Creating compressed archive...

Your sosreport has been generated and saved in:
  /var/tmp/sosreport-dhcp-9-55.nay.redhat.com-20141218014645.tar.xz

The checksum is: 45a44bdea3b9c2465139bc5c2e36859d

Please send this file to your support representative.


Test results:
No NameError: global name 'tempfile' is not defined error info was thrown ,also
using "sosreport" command to collect diagnostic and configuration information from rhevh 7.0 successfully.

For error issue info "OSError: [Errno 19] No such device: '/proc/sys/fs/binfmt_misc'" was print during collecting diagnostic and configuration information by using "sosreport" command. I have report a new bug 1174133 to track it.

So this bug has been fixed, changed the status into "VERIFIED".

Comment 9 errata-xmlrpc 2015-02-11 21:05:01 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://rhn.redhat.com/errata/RHEA-2015-0160.html