Bug 491406

Summary: yum info crashes on empty %description`
Product: Red Hat Enterprise Linux 5 Reporter: Harriet Severino <hseverino>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: low    
Version: 5.2CC: bperkins, ffesti, herrold, james.antill, pmatilai, rlerch, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Because every rpm package should have a %description field, yum info did not allow for packages where this field might be empty. When yum info encountered such a package, it would crash. Yum info now allows for empty %description fields in packages and will not crash when it encounters an empty field.
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 07:34:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
rpm to re-create bug
none
spec file to re-create bug none

Description Harriet Severino 2009-03-20 19:34:33 UTC
Description of problem:
If  you have an RPM,
and the %description is empty,
and you upload it to the yum repository,
and the package is not installed,
and you do a yum info on it,
yum crashes.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. get an RPM of an uninstalled package with %description is empty
2. upload it to the yum repository
3. do a yum info on it
  
Actual results:
yum crashes

Expected results:
info printed

Additional info:

Comment 1 R P Herrold 2009-03-20 20:14:37 UTC
With what rpm building tool was the package built?

Comment 2 seth vidal 2009-03-20 20:30:48 UTC
Can you attach a file with the crash, too?

Comment 3 seth vidal 2009-03-20 20:40:17 UTC
I've done some tests here.

With a <description></description> field in the xml metadata and db metadata - yum behaves properly.

I cannot generate a non-existent description field in the rpm itself. rpmbuild won't let me. So I echo russ' question.

please provide the crash, how you made the rpm itself and, if possible, attach the rpm.

Thanks

Comment 4 Harriet Severino 2009-03-23 18:35:49 UTC
Created attachment 336340 [details]
rpm to re-create bug

Comment 5 Harriet Severino 2009-03-23 18:36:22 UTC
Created attachment 336342 [details]
spec file to re-create bug

Comment 6 Harriet Severino 2009-03-23 18:38:00 UTC
Output from yum error:

hseverino@flurry8:/usr/src/redhat/RPMS/x86_64>yum info foo
Loading "security" plugin
Loading "rhnplugin" plugin
*Note* Red Hat Network repositories are not listed below. You must run this command as root to access RHN repositories.
RHN support will be disabled.
Available Packages
Name   : foo
Arch   : x86_64
Version: 1
Release: 1
Size   : 1.1 k
Repo   : SiCortex Inhouse
Summary: foo
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 105, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 293, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 178, in doCommand
    rap = base.listPkgs(ypl.available, 'Available Packages', basecmd)
  File "/usr/share/yum-cli/output.py", line 306, in listPkgs
    self.infoOutput(pkg)
  File "/usr/share/yum-cli/output.py", line 277, in infoOutput
    print _("Description:\n%s") % enc(pkg.description)
  File "/usr/share/yum-cli/output.py", line 258, in enc
    if len(s) > 0:
TypeError: len() of unsized object

Comment 7 seth vidal 2009-03-23 19:00:24 UTC
The package you attached is pretty badly corrupted.

I built a package from the spec file you attached and that operates just fine.

Can you rebuild from your spec file and generate the same error?

Comment 8 Harriet Severino 2009-03-23 19:06:56 UTC
Output from yum error:

hseverino@flurry8:/usr/src/redhat/RPMS/x86_64>yum info foo
Loading "security" plugin
Loading "rhnplugin" plugin
*Note* Red Hat Network repositories are not listed below. You must run this command as root to access RHN repositories.
RHN support will be disabled.
Available Packages
Name   : foo
Arch   : x86_64
Version: 1
Release: 1
Size   : 1.1 k
Repo   : SiCortex Inhouse
Summary: foo
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.main(sys.argv[1:])
  File "/usr/share/yum-cli/yummain.py", line 105, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 293, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 178, in doCommand
    rap = base.listPkgs(ypl.available, 'Available Packages', basecmd)
  File "/usr/share/yum-cli/output.py", line 306, in listPkgs
    self.infoOutput(pkg)
  File "/usr/share/yum-cli/output.py", line 277, in infoOutput
    print _("Description:\n%s") % enc(pkg.description)
  File "/usr/share/yum-cli/output.py", line 258, in enc
    if len(s) > 0:
TypeError: len() of unsized object

Comment 9 seth vidal 2009-03-23 19:10:00 UTC
what ver of yum and rpm and rpm-python is this?

rpm -q yum rpm rpm-python

Comment 10 Harriet Severino 2009-03-23 19:13:41 UTC
I have built this rpm multiple times, with the same result. I

1) build the rpm with 
> rpmbuld foo-bar.spec
2) copy the rpm file into the repo
3) In the repo
> createrepo --update .
4) back on the build machine:
> yum info foo

Comment 11 Harriet Severino 2009-03-23 19:14:46 UTC
> rpm -q yum rpm rpm-python
yum-3.2.8-9.el5
rpm-4.4.2-48.el5
rpm-python-4.4.2-48.el5

Comment 12 Harriet Severino 2009-03-23 19:15:33 UTC
> rpm -q yum rpm rpm-python
yum-3.2.8-9.el5
rpm-4.4.2-48.el5
rpm-python-4.4.2-48.el5

Comment 13 seth vidal 2009-03-23 19:16:04 UTC
get rid of the --update to createrepo and see if everything gets more sane.

Comment 14 Harriet Severino 2009-03-23 19:24:07 UTC
I did a
> createrepo .
 and 
>yum info foo 
gives the same results.

Comment 15 seth vidal 2009-03-23 21:16:55 UTC
okay, Found the problem - it was fixed in yum 3.2.21 but not backported to rhel.

Comment 16 Harriet Severino 2009-03-23 21:40:26 UTC
Great. CanI get the rpm? http://yum.baseurl.org/ lists src rpms and src tarballs, and I'm just not that masochistic.

Comment 21 Ruediger Landmann 2009-09-01 19:06:09 UTC
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
Because every rpm package should have a %description field, yum info did not allow for packages where this field might be empty. When yum info encountered such a package, it would crash. Yum info now allows for empty %description fields in packages and will not crash when it encounters an empty field.

Comment 22 errata-xmlrpc 2009-09-02 07:34:16 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/RHBA-2009-1419.html