Bug 696791

Summary: No such file or directory: '/sys/devices/system/cpu//cpu1/topology/physical_package_id'
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.7CC: alikins, cduryee, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 08:45:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 675214    

Description John Sefler 2011-04-14 20:18:23 UTC
Description of problem:
I just attempted the automated tests against a s390x client and the logs contain register attempt results in this:

ssh root.eng.bos.redhat.com subscription-manager register --username=testuser1 --password=password
Stdout:
Stderr: [Errno 2] No such file or directory: '/sys/devices/system/cpu//cpu1/topology/physical_package_id'
ExitCode: 255


Version-Release number of selected component (if applicable):
201104141546:04.830 - INFO: Candlepin server 'jsefler-f14-5beakerpin.usersys.redhat.com' is running version: 0.2.16
201104141546:04.830 - INFO: Installed version of subscription-manager...
201104141546:04.830 - FINE: ssh root.eng.bos.redhat.com rpm -q subscription-manager
201104141546:04.882 - FINE: Stdout: subscription-manager-0.95.5.7-1.el5


How reproducible:


Steps to Reproduce:
1. attempt to register

  
Actual results:


Expected results:


Additional info:

Comment 1 John Sefler 2011-04-14 20:26:41 UTC
I suspect an error in the sm code that is being used to determine the number of sockets on the system because i know that alikins taught me an algorithim that marches through the /sys/devices/system/cpu subdirectories to determine the number of socket for rhel5 since lscpu (which was used in rhel6) does not exist on rhel5.

Comment 2 John Sefler 2011-04-25 22:33:12 UTC
Additional Info:
For what it's worth, here is the command line algorithm that I am running on rhel5.7 to get a value for sockets that I will then compare to what subscription-manager facts returns so that I can make a test assertion.  Note that my algorithm is also failing with "No such file or directory" on s390x:

201104181332:11.475 - FINE: ssh root.eng.bos.redhat.com for cpu in `ls -1 /sys/devices/system/cpu/ | egrep cpu[[:digit:]]`; do echo "cpu `cat /sys/devices/system/cpu/$cpu/topology/physical_package_id`"; done | grep cpu | uniq | wc -l
201104181332:11.645 - FINE: Stdout: 1
201104181332:11.646 - FINE: Stderr: 
cat: /sys/devices/system/cpu/cpu0/topology/physical_package_id: No such file or directory
cat: /sys/devices/system/cpu/cpu1/topology/physical_package_id: No such file or directory
201104181332:11.647 - FINE: ExitCode: 0


Reference: http://hudson.rhq.lab.eng.bos.redhat.com:8080/hudson/view/Entitlement/job/rhsm-beaker-on-premises-RHEL5.7/20/

Comment 3 Adrian Likins 2011-05-12 17:34:57 UTC
commit 41435ad8bd68e4845b139e7b988b1260a50b55c4
Author: Adrian Likins <alikins>
Date:   Thu May 12 12:11:17 2011 -0400

    696791: Handle exceptions thrown in hardware detection modules.
    
    Original bug was a  failure on s390x for detecting cpu sockets, but
    we need to handle the more general case of hardware detection failing
    better.


cb31dc3e0437c054449a3292c4d108a21775afd9 in master

Still need to revisit how to actually gather useful info from s390x, but this
will fix the crash.

Comment 4 John Sefler 2011-05-20 21:51:51 UTC
Verifying Version....

[root@ibm-z10-05 ~]# rpm -q subscription-manager
subscription-manager-0.95.5.18-1.el5
[root@ibm-z10-05 ~]# rpm -q subscription-manager --changelog | grep 696791
- 696791: Handle exceptions thrown in hardware detection modules.
[root@ibm-z10-05 ~]# uname -a
Linux ibm-z10-05.rhts.eng.bos.redhat.com 2.6.18-262.el5 #1 SMP Mon May 16 17:52:56 EDT 2011 s390x s390x s390x GNU/Linux

[root@ibm-z10-05 ~]# subscription-manager register --username=qa
Password: 
a9c96915-7304-4571-b0cc-ec0c682b7a37 ibm-z10-05.rhts.eng.bos.redhat.com
[root@ibm-z10-05 ~]# 


^^^ VERIFIED that we can now register without a crash on s390x


[root@ibm-z10-05 ~]# subscription-manager facts --list
distribution.id: Tikanga
distribution.name: Red Hat Enterprise Linux Server
distribution.version: 5.7
memory.memtotal: 508952
memory.swaptotal: 1048568
net.interface.eth0.broadcast: 10.16.71.255
net.interface.eth0.hwaddr: 02:de:ad:be:ef:05
net.interface.eth0.ipaddr: 10.16.66.196
net.interface.eth0.netmask: 255.255.248.0
net.interface.lo.broadcast: 0.0.0.0
net.interface.lo.hwaddr: 00:00:00:00:00:00
net.interface.lo.ipaddr: 127.0.0.1
net.interface.lo.netmask: 255.0.0.0
net.interface.sit0.broadcast: unknown
net.interface.sit0.hwaddr: 00:00:00:00:00:00
net.interface.sit0.ipaddr: unknown
net.interface.sit0.netmask: unknown
network.hostname: ibm-z10-05.rhts.eng.bos.redhat.com
network.ipaddr: 10.16.66.196
system.entitlements_valid: False
uname.machine: s390x
uname.nodename: ibm-z10-05.rhts.eng.bos.redhat.com
uname.release: 2.6.18-262.el5
uname.sysname: Linux
uname.version: #1 SMP Mon May 16 17:52:56 EDT 2011
virt.host_type: ibm_systemz
ibm_systemz-zvm
virt.is_guest: True
[root@ibm-z10-05 ~]# 


^^^ Notice that the detected hardware facts (e.g. cpu.* and dmi.*) that are normally detected on other hardware is excluded from this s390x list.

As alikins said, "Still need to revisit how to actually gather useful info from s390x..."

Comment 5 errata-xmlrpc 2011-07-21 08:45:18 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/RHEA-2011-1078.html

Comment 6 errata-xmlrpc 2011-07-21 12:30:12 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/RHEA-2011-1078.html