Bug 1112104 - yum traceback with python-2.4.3-56.el5 + missing /dev/urandom
Summary: yum traceback with python-2.4.3-56.el5 + missing /dev/urandom
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python
Version: 5.10
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Python Maintainers
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-23 07:19 UTC by Sunny
Modified: 2014-06-23 07:54 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 893034
Environment:
Last Closed: 2014-06-23 07:54:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sunny 2014-06-23 07:19:58 UTC
+++ This bug was initially created as a clone of Bug #893034 +++

This bug description is same as Bug #893034

Description of problem:
Yum drops traceback when /dev/urandom in missing and python-2.4.3-56.el5 is installed. It looks like a regression but not sure where is the problem, yum or python or if there is a problem at all.

Version-Release number of selected component (if applicable):
yum-3.2.22-40.el5
python-2.4.3-56.el5



Actual results:
yum drops traceback

Expected results:
no traceback


I am trying to run anaconda with a particular kickstart profile. The execution of anaconda fails at then end during the post section displaying following errors. 

Installing ntp-4.2.2p1-17.el5_10...  Done [432/430]
Performing post install configuration...
Traceback (most recent call last):
  File "/usr/sbin/authconfig", line 27, in ?
    import authinfo, acutil
  File "/usr/share/authconfig/authinfo.py", line 38, in ?
    import urllib2
  File "/usr/lib64/python2.4/urllib2.py", line 93, in ?
    import httplib
  File "/usr/lib64/python2.4/httplib.py", line 70, in ?
    import mimetools
  File "/usr/lib64/python2.4/mimetools.py", line 6, in ?
    import tempfile
  File "/usr/lib64/python2.4/tempfile.py", line 33, in ?
    from random import Random as _Random
  File "/usr/lib64/python2.4/random.py", line 828, in ?
    _inst = Random()
  File "/usr/lib64/python2.4/random.py", line 95, in __init__
    self.seed(x)
  File "/usr/lib64/python2.4/random.py", line 109, in seed
    a = long(_hexlify(_urandom(16)), 16)
OSError: [Errno 2] No such file or directory: '/dev/urandom'
Traceback (most recent call first):
  File "/usr/lib/anaconda/yuminstall.py", line 1966, in <lambda>
    for repo in filter(lambda r: r.addon, self.ayum.repos.listEnabled()):
  File "/usr/lib/anaconda/yuminstall.py", line 1966, in writeKS
    for repo in filter(lambda r: r.addon, self.ayum.repos.listEnabled()):
  File "/usr/lib/anaconda/instdata.py", line 294, in writeKS
    self.backend.writeKS(f)
  File "/usr/lib/anaconda/packages.py", line 71, in writeKSConfiguration
    anaconda.id.writeKS(fn)
  File "/usr/lib/anaconda/dispatch.py", line 207, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 130, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/cmdline.py", line 146, in run
    anaconda.dispatch.gotoNext()
  File "/usr/sbin/anaconda", line 980, in ?
    anaconda.intf.run(anaconda)
AttributeError: 'RhnRepo' object has no attribute 'addon'

Killed


Anaconda builds the image in a temp directory.
If i do a chroot on this temp directory, i see following


[root tmp]# chroot /opt/ks2ami/tmp/
[root@ks01 /]# rpm -q yum python
yum-3.2.22-40.el5
python-2.4.3-56.el5
[root@ks01 /]# yum version
Traceback (most recent call last):
  File "/usr/bin/yum", line 4, in ?
    import yum
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 44, in ?
    import rpmsack
  File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 22, in ?
    import misc
  File "/usr/lib/python2.4/site-packages/yum/misc.py", line 14, in ?
    import tempfile
  File "/usr/lib64/python2.4/tempfile.py", line 33, in ?
    from random import Random as _Random
  File "/usr/lib64/python2.4/random.py", line 828, in ?
    _inst = Random()
  File "/usr/lib64/python2.4/random.py", line 95, in __init__
    self.seed(x)
  File "/usr/lib64/python2.4/random.py", line 109, in seed
    a = long(_hexlify(_urandom(16)), 16)
OSError: [Errno 2] No such file or directory: '/dev/urandom'


[root@ks01 /]# strace yum version 2>&1 | grep urandom
open("/dev/urandom", O_RDONLY)          = -1 ENOENT (No such file or directory)
stat("/dev/urandom", 0x7fffddf1ab20)    = -1 ENOENT (No such file or directory)
open("/dev/urandom", O_RDONLY)          = -1 ENOENT (No such file or directory)
write(2, "a = long(_hexlify(_urandom(16)),"..., 37a = long(_hexlify(_urandom(16)), 16)
write(2, "[Errno 2] No such file or direct"..., 51[Errno 2] No such file or directory: '/dev/urandom') = 51

Comment 1 Bohuslav "Slavek" Kabrda 2014-06-23 07:54:39 UTC
So, the upstream solution for this bug is not to use other sources of entropy, but rather change the error type from OSError to NotImplementedError. Since RHEL 5 has already entered phase 3 and this bug is not critical and/or security, I'm closing as wontfix. Thanks for your understanding.


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