Bug 204666 - Installation of Solaris 10 patch cluster patches fails with python traceback
Installation of Solaris 10 patch cluster patches fails with python traceback
Status: CLOSED WONTFIX
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Solaris (Show other bugs)
500
All Linux
medium Severity medium
: ---
: ---
Assigned To: Clifford Perry
Red Hat Satellite QA List
:
Depends On:
Blocks: 172657
  Show dependency treegraph
 
Reported: 2006-08-30 14:32 EDT by Clifford Perry
Modified: 2014-05-09 05:50 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-09 05:50:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Clifford Perry 2006-08-30 14:32:30 EDT
Description of problem:
It was discovered that when performing an installation of patches, as part of a
patch cluster, that has been uploaded to a Satellite, that most will install or,
if not install, give a warning, and proceed to the next patch. Every now and
then though, up2date will instead throw a python traceback and exit the process.

This is because within file:
/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py

we have (starting at line 104):
            status, output = commands.getstatusoutput(cmd)

            if status != 0:
                raise PatchaddException("status: %d, output: %s" % (status, output))

If you add a 'print status' line just before the comparison, you will see for
nearly every failed patch that the value of status is set to 256, which then
makes you wonder, why did it not fail sooner? My first test got through to 87%
of installation before generating a traceback.

The cause, is pythons lose typing, some times, more often than not, it seems
that 'status' is being seen as a string, and not an integer.

If I add to the code 'status = int(status)' before the comparison, to force the
status to be of type int, then the code will fail straight away, every time.

I also determined that the 'PatchaddException' is not needed. This is legacy
code, prior to the 410 code, where we changed up2date/smartpm because we did not
want up2date to exit due to one failed patch in a patch cluster, but instead to
proceed to the next patch within the patch cluster, similar behavior as found
when installing a patch cluster manually.

The short term solution for a customer hitting this traceback would be to edit
the
/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py
file, go to roughly line 106 and comment out the two lines, as shown below:

            status, output = commands.getstatusoutput(cmd)

#            if status != 0:
#                raise PatchaddException("status: %d, output: %s" % (status,
output))

This bug is being created to track a review and cleanup of the solaris code
which will need to take place to:
1) deprecate/remove the no longer needed PatchaddException call
2) review the solaris up2date/smartpm client code for references to 'status' or
other return codes and most likely force the type to int - when needed, prior to
making a comparison of it. Mostly where when we look at the return status of
having called 'getstatusoutput()'.


Version-Release number of selected component (if applicable):
bash-3.00# pkginfo -l RHATsmart RHATrpush RHATrhnc
   PKGINST:  RHATrhnc
      NAME:  rhnclient 4.1.0
  CATEGORY:  utility
      ARCH:  sparc
   VERSION:  4.1.0,REV=32
    VENDOR:  Red Hat
      DESC:  Red Hat Network Client Utilities and Libraries
    PSTAMP:  RHAT_RHN
  INSTDATE:  Aug 30 2006 10:14
    STATUS:  completely installed
     FILES:       68 installed pathnames
                  17 shared pathnames
                  23 directories
                  40 executables
                 476 blocks used (approx)

   PKGINST:  RHATrpush
      NAME:  rhnpush 4.1.0
  CATEGORY:  utility
      ARCH:  noarch
   VERSION:  4.1.0,REV=83.rhel4
    VENDOR:  Red Hat
      DESC:  Package uploader for the Red Hat Network Satellite Server
    PSTAMP:  RHAT_RHN
  INSTDATE:  Aug 30 2006 10:14
    STATUS:  completely installed
     FILES:       54 installed pathnames
                  18 shared pathnames
                  20 directories
                   1 executables
                 526 blocks used (approx)

   PKGINST:  RHATsmart
      NAME:  smartpm 4.1.0
  CATEGORY:  utility
      ARCH:  sparc
   VERSION:  4.1.0,REV=36
    VENDOR:  Red Hat
      DESC:  Next generation package handling tool
    PSTAMP:  RHAT_RHN
  INSTDATE:  Aug 30 2006 10:14
    STATUS:  completely installed
     FILES:      331 installed pathnames
                  12 shared pathnames
                  31 directories
                   7 executables
                3116 blocks used (approx)

bash-3.00#
bash-3.00# uname -a
SunOS rhnsun6.rhnsun.rdu.redhat.com 5.10 Generic sun4u sparc SUNW,Ultra-60
bash-3.00#
bash-3.00# showrev
Hostname: rhnsun6.rhnsun.rdu.redhat.com
Hostid: 80aa1793
Release: 5.10
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.10 Generic
bash-3.00#

How reproducible:
Mostly, but not 100%

Steps to Reproduce:
1. Convert and upload a Solaris 10 patch cluster to Satellite with registered client
2. up2date --installall

 
Actual results:
Installing patch-solaris-119254                  
################################################################### [ 85%]
Installing patch-solaris-118822                  
################################################################### [ 88%]
warning:
warning: WARNING:  Installation of patch patch-solaris-121453 failed.
warning: status: 256, output: Package SUNWbreg from patch 121453-02 is not
installed on the system.
warning: Package SUNWccccrr from patch 121453-02 is not installed on the system.
warning: Package SUNWccfw from patch 121453-02 is not installed on the system.
warning: Package SUNWswupcl from patch 121453-02 is not installed on the system.
warning: Package SUNWppror from patch 121453-02 is not installed on the system.
warning: Package SUNWppro-plugin-sunos-base from patch 121453-02 is not
installed on the system.
warning: Package SUNWupdatemgrr from patch 121453-02 is not installed on the system.
warning: Package SUNWdc from patch 121453-02 is not installed on the system.
warning: Package SUNWccccfg from patch 121453-02 is not installed on the system.
warning: Package SUNWccsign from patch 121453-02 is not installed on the system.
warning: Package SUNWpprou from patch 121453-02 is not installed on the system.
warning: Package SUNWccccr from patch 121453-02 is not installed on the system.
warning: Package SUNWupdatemgru from patch 121453-02 is not installed on the system.
warning: Package SUNWccfwctrl from patch 121453-02 is not installed on the system.
warning: Package SUNWcctpx from patch 121453-02 is not installed on the system.
warning: Package SUNWccinv from patch 121453-02 is not installed on the system.
warning: Package SUNWcsmauth from patch 121453-02 is not installed on the system.
warning: Validating patches...
warning:
warning: Loading patches installed on the system...
warning:
warning: Done!
warning:
warning: Loading patches requested to install.
warning:
warning: Done!
warning:
warning: Checking patches that you specified for installation.
warning:
warning: Done!
warning:
warning: The following requested patches will not be installed because
warning: no patches required by the patch are installed on this system.
warning:
warning:           0 For patch 121453-02, required patch 119254-06 does not exist.
warning:
warning:
warning: No patches to install.
Installing patch-solaris-121453                  
################################################################### [ 90%]
Installing patch-solaris-120661                  
################################################################### [ 92%]
Installing patch-solaris-119981                  
################################################################### [ 95%]
Installing patch-solaris-122856                  
################################################################### [ 97%]
Traceback (most recent call last):                                             
                                      (  0%)
  File "/opt/redhat/rhn/solaris/usr/bin/up2date", line 216, in ?
    main(sys.argv[1:])
  File "/opt/redhat/rhn/solaris/usr/bin/up2date", line 189, in main
    exitcode = iface.run(opts.command, opts.argv)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/interfaces/up2date/interface.py",
line 102, in run
    result = install.main(self._ctrl, opts, RHNSolarisPolicyInstall)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/commands/install.py",
line 170, in main
    ctrl.commitTransaction(trans, confirm=confirm)
  File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/control.py",
line 464, in commitTransaction
    return self.commitChangeSet(trans.getChangeSet(), caching, confirm)
  File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/control.py",
line 518, in commitChangeSet
    pmclass().commit(pmcs, pkgpaths)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py",
line 208, in commit
    status, output = solupgrade(adminfile, path, pkg, prog)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py",
line 152, in solupgrade
    status, output = solinstall(adminfile, path, pkg, prog)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py",
line 107, in solinstall
    raise PatchaddException("status: %d, output: %s" % (status, output))
smart.backends.solaris.pm.PatchaddException: status: 256, output: Package
SUNWarcr from patch 118833-17 is not installed on the system.
Package SUNWbtool from patch 118833-17 is not installed on the system.
Version of package SUNWcakr from patch 118833-17 differs from the package
installed on the system.
Package SUNWcpr from patch 118833-17 is not installed on the system.
Package SUNWcti2 from patch 118833-17 is not installed on the system.
Package SUNWdrcr from patch 118833-17 is not installed on the system.
Package SUNWdrr from patch 118833-17 is not installed on the system.
Package SUNWefc from patch 118833-17 is not installed on the system.
Package SUNWhea from patch 118833-17 is not installed on the system.
Package SUNWidn from patch 118833-17 is not installed on the system.
Package SUNWintgige from patch 118833-17 is not installed on the system.
Version of package SUNWkvm from patch 118833-17 differs from the package
installed on the system.
Package SUNWmdbr from patch 118833-17 is not installed on the system.
Package SUNWpcmem from patch 118833-17 is not installed on the system.
Package SUNWpppdu from patch 118833-17 is not installed on the system.
Package SUNWsbp2 from patch 118833-17 is not installed on the system.
Package SUNWscsa1394 from patch 118833-17 is not installed on the system.
Package SUNWsmapi from patch 118833-17 is not installed on the system.
Package SUNWtoo from patch 118833-17 is not installed on the system.
Package SUNWusbu from patch 118833-17 is not installed on the system.
Package SUNWust1 from patch 118833-17 is not installed on the system.
Package SUNWvolu from patch 118833-17 is not installed on the system.
Package SUNWxcu4 from patch 118833-17 is not installed on the system.
Version of package SUNWcakr from patch 118833-17 differs from the package
installed on the system.
Package SUNWdrr from patch 118833-17 is not installed on the system.
Package SUNWefc from patch 118833-17 is not installed on the system.
Version of package SUNWkvm from patch 118833-17 differs from the package
installed on the system.
Package FJSVhea from patch 118833-17 is not installed on the system.
Package FJSVmdbr from patch 118833-17 is not installed on the system.
Validating patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Done!

Checking patches that you specified for installation.

Done!

The following requested patches will not be installed because
no patches required by the patch are installed on this system.

           0 For patch 118833-17, required patch 119254-14 does not exist.


No patches to install.
bash-3.00#

Expected results:
To not generate a python traceback and exit before completion.

Additional info:
At line 240 in pm.py we have:

                except PatchaddException, pae:
                    # Solaris patch cluster installs are tolerant of failed
                    # patches, and we should be too.  Just warn the user and
                    # keep going.
                    iface.warning( \
                        _("\nWARNING:  Installation of patch %s failed.\n%s") \
                            % (pkg.name, str(pae)))

So maybe PatchaddException needs better clarification on when it is called,
since obviously we did not intend for it to be called during patches being 
installed as part of a patch cluster.


If I edit file to read -
/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py

            print cmd
            status, output = commands.getstatusoutput(cmd)

            print status
            if status != 0:
                raise PatchaddException("status: %d, output: %s" % (status, output))

and re-run the install attempt:
bash-3.00# up2date -vvv --installall

Updating cache...                                
################################################################### [100%]
Updating cache...                                
################################################################### [100%]

Updating cache...                                
################################################################### [100%]

warning: patch-solaris-118371-07-1 is already installed
warning: patch-solaris-118815-03-1 is already installed
warning: patch-solaris-118822-30-1 is already installed
warning: patch-solaris-118918-17-1 is already installed
warning: patch-solaris-119130-21-1 is already installed
warning: patch-solaris-119574-02-1 is already installed
warning: patch-solaris-119578-24-1 is already installed
warning: patch-solaris-120900-04-1 is already installed
warning: patch-solaris-121133-02-1 is already installed

Committing transaction...
patchadd -u /tmp/121236-0121236                                                
                                      (  0%)
256
warning:
warning: WARNING:  Installation of patch patch-solaris-121236 failed.
warning: status: 256, output: Version of package SUNWcakr from patch 121236-01
differs from the package installed on the system.
warning: Validating patches...
warning:
warning: Loading patches installed on the system...
warning:
warning: Done!
warning:
warning: Loading patches requested to install.
warning:
warning: Done!
warning:
warning: The following requested patches do not update any packages installed on
the system
warning: No any packages from patch 121236-01 are installed on the system.
warning:
warning:
warning: No patches to check dependency.
Installing patch-solaris-121236                  
################################################################### [  5%]
patchadd -u /tmp/119903-0119903                                                
                                      (  0%)
256
warning:
warning: WARNING:  Installation of patch patch-solaris-119903 failed.
warning: status: 256, output: Package SUNWolrte from patch 119903-01 is not
installed on the system.
warning: Validating patches...
warning:
warning: Loading patches installed on the system...
warning:
warning: Done!
warning:
warning: Loading patches requested to install.
warning:
warning: Done!
warning:
warning: The following requested patches do not update any packages installed on
the system
warning: No any packages from patch 119903-01 are installed on the system.
warning:
warning:
warning: No patches to check dependency.
Installing patch-solaris-119903                  
################################################################### [ 11%]
patchadd -u /tmp/119757-0219757                                                
                                      (  0%)
256
warning:
warning: WARNING:  Installation of patch patch-solaris-119757 failed.
warning: status: 256, output: Package SUNWsmbaS from patch 119757-02 is not
installed on the system.
warning: Package SUNWsmbac from patch 119757-02 is not installed on the system.
warning: Package SUNWsmbar from patch 119757-02 is not installed on the system.
warning: Package SUNWsmbau from patch 119757-02 is not installed on the system.
warning: Validating patches...
warning:
warning: Loading patches installed on the system...
warning:
warning: Done!
warning:
warning: Loading patches requested to install.
warning:
warning: Done!
warning:
warning: The following requested patches do not update any packages installed on
the system
warning: No any packages from patch 119757-02 are installed on the system.
warning:
warning:
warning: No patches to check dependency.
Installing patch-solaris-119757                  
################################################################### [ 17%]
patchadd -u /tmp/119059-1419059                                                
                                      (  0%)
256
warning:
warning: WARNING:  Installation of patch patch-solaris-119059 failed.
warning: status: 256, output: Package SUNWxwacx from patch 119059-14 is not
installed on the system.
warning: Package SUNWxwinc from patch 119059-14 is not installed on the system.
warning: Package SUNWxwman from patch 119059-14 is not installed on the system.
warning: Package SUNWxwopt from patch 119059-14 is not installed on the system.
warning: Package SUNWxwplt from patch 119059-14 is not installed on the system.
warning: Package SUNWxwsrv from patch 119059-14 is not installed on the system.
warning: Validating patches...
warning:
warning: Loading patches installed on the system...
warning:
warning: Done!
warning:
warning: Loading patches requested to install.
warning:
warning: Done!
warning:
warning: The following requested patches do not update any packages installed on
the system
warning: No any packages from patch 119059-14 are installed on the system.
warning:
warning:
warning: No patches to check dependency.
Installing patch-solaris-119059                  
################################################################### [ 23%]
patchadd -u /tmp/121133-021133                                                 
                                      (  0%)
256
Traceback (most recent call last):
  File "/opt/redhat/rhn/solaris/usr/bin/up2date", line 216, in ?
    main(sys.argv[1:])
  File "/opt/redhat/rhn/solaris/usr/bin/up2date", line 189, in main
    exitcode = iface.run(opts.command, opts.argv)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/interfaces/up2date/interface.py",
line 102, in run
    result = install.main(self._ctrl, opts, RHNSolarisPolicyInstall)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/commands/install.py",
line 170, in main
    ctrl.commitTransaction(trans, confirm=confirm)
  File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/control.py",
line 464, in commitTransaction
    return self.commitChangeSet(trans.getChangeSet(), caching, confirm)
  File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/control.py",
line 518, in commitChangeSet
    pmclass().commit(pmcs, pkgpaths)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py",
line 209, in commit
    status, output = solupgrade(adminfile, path, pkg, prog)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py",
line 153, in solupgrade
    status, output = solinstall(adminfile, path, pkg, prog)
  File
"/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/pm.py",
line 108, in solinstall
    raise PatchaddException("status: %d, output: %s" % (status, output))
smart.backends.solaris.pm.PatchaddException: status: 256, output: Validating
patches...

Loading patches installed on the system...

Done!

Loading patches requested to install.

Done!

The following requested patches are already installed on the system
Requested to install patch 121133-02 is already installed on the system.


No patches to check dependency.
bash-3.00#

Note You need to log in before you can comment on or make changes to this bug.