Bug 238471 - Handle unknown package names on registration.update_packages
Summary: Handle unknown package names on registration.update_packages
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Network
Classification: Red Hat
Component: RHN/Backend   
(Show other bugs)
Version: rhn500
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bryan Kearney
QA Contact: Bret McMillan
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 239809
TreeView+ depends on / blocked
 
Reported: 2007-04-30 19:06 UTC by James Bowes
Modified: 2013-01-10 09:52 UTC (History)
2 users (show)

Fixed In Version: 5.0.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-25 20:29:00 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description James Bowes 2007-04-30 19:06:26 UTC
If you do this xml call with packages that RHN doesn't know about, It will cause
a  nasty traceback. Instead, send some meaningful info to the client, and log
the error in our logs.

Comment 1 Bret McMillan 2007-05-11 15:52:51 UTC
Adding to rhn502, this'll reduce tracebacks which will make it easier for the
hosted team to find & debug production issues.

Comment 2 James Bowes 2007-05-22 17:31:58 UTC
If an unknown package name is given in a profile, we will now raise fault 23.

Comment 3 James Bowes 2007-06-04 15:22:36 UTC
I've examined this further, and it only happens for empty package names. So
instead of throwing a fault, the packages are now filtered on empty package name
(like other fields on the package)

Comment 4 James Bowes 2007-06-19 14:52:54 UTC
A quick n' dirty way to test this (like bz 235214) is to append a package with
no name to
your package profile, like:
   pkg_list.append(['', '1', '1', '', 'i386'])
at line 173 in /usr/share/rhn/up2date_client/rpmUtils.py

Then use rhnreg_ks and note that things don't blow up. Your package profile
should be uploaded, and not include any packages with empty names.

Comment 5 Bret McMillan 2007-06-22 17:26:01 UTC
Tested using:

./test_up2date_checks.py --verbose --server=qa --test=update_packages
--username=lethallemur --password=[censored] --os-release=5Client
--os-arch=x86_64 --package-profile=./package-profiles/profile-emptyname-x86_64


profile-emptyname-x86_64 looks like:
[bretm@potential test]$ cat package-profiles/profile-emptyname-x86_64
(none) 1.0 3 (none) x86_64
a2ps 4.13b 41 (none) x86_64
acl 2.2.23 5 (none) x86_64
[bretm@potential test]$ 


test harness registers w/out fault, logs show:
2007/06/22 13:07:53 -04:00 30272 172.16.57.213:
rhnServer/server_packages.add_package(1007420128, ['', '1.0', '3', ''])
2007/06/22 13:07:53 -04:00 30272 172.16.57.213:
rhnServer/server_packages.add_package(1007420128, ['a2ps', '4.13b', '41', ''])
2007/06/22 13:07:53 -04:00 30272 172.16.57.213:
rhnServer/server_packages.add_package(1007420128, ['acl', '2.2.23', '5', ''])


sqlplus shows:

select name from rhnpackagename where id in (select name_id from
rhnserverpackage where server_id = 1007420128)
SQL> /

NAME
--------------------------------------------------------------------------------
a2ps
acl

SQL> 




Comment 6 Bret McMillan 2007-06-22 17:26:30 UTC
Also, simulated runs for rhel 4as system registration show nothing odd in webqa.

Comment 7 James Bowes 2007-07-25 15:18:02 UTC
rhn502 released.


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