Bug 555659 - Error when running up2date on Solaris 10.4 for patch with names of certain format
Summary: Error when running up2date on Solaris 10.4 for patch with names of certain fo...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Solaris
Version: 520
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Clifford Perry
QA Contact: Martin Minar
URL:
Whiteboard:
Depends On:
Blocks: 468734 sat531-triage
TreeView+ depends on / blocked
 
Reported: 2010-01-15 06:57 UTC by Xixi
Modified: 2018-11-14 17:51 UTC (History)
7 users (show)

Fixed In Version: RHATsmart-5.3.1-2 rhn-solaris-bootstrap-5.3.5-1
Doc Type: Bug Fix
Doc Text:
Patches with non-standard SUNW_PATCHID now work as expected.
Clone Of:
Environment:
Last Closed: 2011-07-20 15:57:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xixi 2010-01-15 06:57:19 UTC
Description of problem:
Customer is unable to patch solaris machines through Satellite for certain solaris patches. For example - they must apply solaris patch PSE400SOL049 to their machines. Unfortunately, this is not possible because it does not match our predefined regex for patch names in the RHN solaris client, which has regex PNAMERE = re.compile("([^ ]+)-([0-9][0-9])") on line 32 of /opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/loader.py. The problem is 3rd party ISVs don't necessarily adhere to this format. For example, Citrix does not.

Sample traceback:
[$?] \! # up2date --showall | grep SUNWxwfnt
Updating cache...               ######################################## [100%]
Updating cache...               ######################################## [100%]
Traceback (most recent call last):
File "/opt/redhat/rhn/solaris/usr/bin/up2date", line 236, in ?
  main(sys.argv[1:])
File "/opt/redhat/rhn/solaris/usr/bin/up2date", line 209, 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 209, in run
  pkgs = self.getRHNPackages(latest=True)
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/interfaces/up2date/interface.py", line 56, in getRHNPackages
  if reload: self._ctrl.reloadChannels()
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/control.py", line 375, in reloadChannels
  self._cache.load()
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/loader.py", line 78, in load
  for info in self.getInfoList():
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/loader.py", line 157, in getInfoList
  info = parsePatchLine(entry.rstrip())
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/loader.py", line 515, in parsePatchLine
  info = createPatchInfo(patch, packages, requires, obsoletes, conflicts)
File "/opt/redhat/rhn/solaris/lib/python2.4/site-packages/smart/backends/solaris/loader.py", line 550, in createPatchInfo
  (name, prvversion) = m.groups()
AttributeError: 'NoneType' object has no attribute 'groups'

def createPatchInfo(patch, packages, requires, obsoletes, conflicts):
   info = {"provides": [], "depends": [], "conflicts": [], "upgrades": []}
   m = PNAMERE.match(patch)
   (name, prvversion) = m.groups()
   name = "patch-solaris-" + name

This takes the results of a showrev -p, the output of which is:
Patch: PSE4000SOL049 Obsoletes: Requires: Incompatibles: Packages: CTXSmf

The regex must allow PSE4000SOL049 to pass.

Seems we need to either get rid of the regex, or change it to include the more varied patch names. Not sure if there is a Solaris standard for this, so we may be better off letting everything through. If we keep the regex, consider throwing an exception as well, so we don't get traceback & NoneType exceptions in the future.

Version-Release number of selected component (if applicable):
Red Hat Network (RHN) Satellite & Solaris client 5.2

How reproducible:
Always.

Steps to Reproduce:
1. Upload solaris patch that does not confirm to the "([^ ]+)-([0-9][0-9])" naming convention - such as PSE400SOL049 - to a solaris-enabled 5.2 satellite in appropriate channel.
2. Register solaris client and try to up2date or up2date --showall.

Actual results:
up2date fails with above traceback

Expected results:
up2date succeeds 

Additional info:
Asked but weren't able to get the solaris patch in question to replicate internally.

Comment 7 James M. Leddy 2010-01-29 20:20:23 UTC
(In reply to comment #0)
> Steps to Reproduce:
> 1. Upload solaris patch that does not confirm to the "([^ ]+)-([0-9][0-9])"
> naming convention - such as PSE400SOL049 - to a solaris-enabled 5.2 satellite
> in appropriate channel.
> 2. Register solaris client and try to up2date or up2date --showall.

Actually you don't have to use RHN to install the patch. The way we came about it is that we patched CTXMS out of band from satellite, but up2date still chokes on the output of showrev -p. Steps to reproduce:

1. Install a weird patch, such as PSE400SOL049 to a solaris machine that is managed by a satellite.
2. run up2date or up2date --showall.

> 
> Actual results:
> up2date fails with above traceback
> 
> Expected results:
> up2date succeeds

Comment 11 Miroslav Suchý 2010-05-17 12:11:33 UTC
Fixed in spacewalk git in commit 893f1d89a8350fcf34f0f56be9f0743332f73beb

Comment 12 Miroslav Suchý 2010-05-18 14:49:38 UTC
Cherrypicked to satellite.git as 7e4b02e39702590531e19ef13a89369784c0f99c

Comment 15 Jaromir Hradilek 2010-09-02 21:06:12 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:
Patches with non-standard SUNW_PATCHID now work as expected.

Comment 16 Martin Minar 2011-07-19 09:54:31 UTC
Verified in rhn-solaris-bootstrap-5.4.1-5 and RHATsmart-5.4.1-2


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