RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 507616 - traceback when installing cobbler
Summary: traceback when installing cobbler
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: distribution
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: beta
: ---
Assignee: Michael DeHaan
QA Contact: Daniel Riek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-23 13:54 UTC by Alexander Todorov
Modified: 2009-09-25 13:36 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-25 13:36:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Alexander Todorov 2009-06-23 13:54:03 UTC
Description of problem:

Installing cobbler-1.6.2-1.fc11.noarch
/usr/lib64/python2.6/site-packages/Cheetah/CacheRegion.py:30: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: cannot open Packages database in /var/lib/rpm

invalid literal for float(): n
  File "/usr/lib/python2.6/site-packages/cobbler/cobbler.py", line 83, in main
    rc = BootCLI().run(sys.argv)

  File "/usr/lib/python2.6/site-packages/cobbler/cobbler.py", line 45, in __init__
    self.api = api.BootAPI(is_cobblerd=False)

  File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 101, in __init__
    self.os_version = utils.os_release()

  File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 776, in os_release
    version = float(version[0])


Version-Release number of selected component (if applicable):
cobbler-1.6.2-1.fc11.noarch

How reproducible:


Steps to Reproduce:
1. @everything install
2.
3.
  
Actual results:


Expected results:


Additional info:
The DeprecationWarning is reported in bug #507614. It's no likely that they are duplicates.

Comment 2 Bill Nottingham 2009-06-23 16:51:42 UTC
Moving to releng. Do we have two cobbler packages in the tree???

Comment 3 Dennis Gregorovic 2009-06-23 17:25:01 UTC
The %post script is trying to call "rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE} --whatprovides redhat-release".  The call is failing somehow, leading to the traceback when it tries to parse the error message as an RPM version string.  Querying rpm from a %post script is not guaranteed to work. I would say this is a cobbler bug.

Comment 4 Mike McLean 2009-06-23 21:21:14 UTC
Calling rpm in a scriptlet is a big packaging no-no

Comment 5 Michael DeHaan 2009-06-24 18:50:36 UTC
I've never seen this happen in regular use with RPM or yum.

Any special Reproduction details?

AFAIK, this would be from condrestart in %post and that needing to check the package version, which has, so far, seemed to have worked.  That being said we could remove the condrestart and change it to a /stop/, though leaving the current version running is not a good idea.

Comment 6 Mike McLean 2009-06-24 19:21:59 UTC
calling rpm in a scriptlet will sometimes work -- basically there's racing between the rpm running the transaction and the rpm run inside the scriptlet. Note that they may be completely different versions of rpm (e.g. in the build system).

Regardless, calling rpm from a scriptlet should be avoided if at all possible.

Is there no other way to check the package version? Run a cli tool with -V? Look in an installed file?

Comment 7 Michael DeHaan 2009-06-24 19:27:55 UTC
In present versions, yes, we can in fact get it via safer means.

(Opening this up in Trac also so I don't lose track of this one).

Comment 8 Michael DeHaan 2009-06-24 19:28:53 UTC
https://fedorahosted.org/cobbler/ticket/466#preview

Comment 9 Michael DeHaan 2009-09-25 13:36:32 UTC
Fixed in 2.0


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