View Issue Details

IDProjectCategoryView StatusLast Update
0014767CentOS-7rpmpublic2018-05-14 13:03
Reportercp-jpatterson 
PriorityurgentSeverityblockReproducibilityalways
Status newResolutionopen 
Platformx86_64OSOS Version
Product Version7.5.1804 
Target VersionFixed in Version 
Summary0014767: Building new CentOS installation - rpm doesn't work
DescriptionWhen 7.5 was pushed yesterday, rpm and yum started failing on new system builds with:

error: Failed to initialize NSS library

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   cannot import name ts

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

Recommended workarounds of installing 4.13.1 of the nspr package doesn't fix the issue
Steps To ReproduceStart with a fresh disk mounted at $FULL_RAWDIR

  wget http://vault.centos.org/RPM-GPG-KEY-CentOS-7
  mkdir -p $FULL_RAWDIR/var/lib/rpm
  sudo rpm --rebuilddb --root=$FULL_RAWDIR
  sudo rpm --root=$FULL_RAWDIR --import RPM-GPG-KEY-CentOS-7
  wget http://vault.centos.org/centos/7.3.1611/os/x86_64/Packages/centos-release-7-3.1611.el7.centos.x86_64.rpm
  sudo rpm -i --root=$FULL_RAWDIR --nodeps centos-release-7-3.*.rpm
  sudo yum --installroot=$FULL_RAWDIR -y clean all
  sudo yum --installroot=$FULL_RAWDIR -y update
  sudo yum --installroot=$FULL_RAWDIR install -y rpm-build yum
  sudo yum --installroot=$FULL_RAWDIR install -y sudo ca-certificates kernel-devel openssh grub2 bios-grub dracut util-linux kmod lvm2 dosfstools

  sudo chroot $FULL_RAWDIR yum -y install automake
Additional InformationThis process worked fine before 7.5 was pushed.
TagsNo tags attached.
abrt_hash
URL

Activities

cp-jpatterson

cp-jpatterson

2018-05-11 08:45

reporter   ~0031756

just running rpm or yum will cause the issue...e.g.,

sudo chroot $FULL_RAWDIR rpm -vv --rebuilddb

Fails as well as the steps to reproduce
karelklic

karelklic

2018-05-12 18:10

reporter   ~0031780

Hi, I fixed this issue by adding:

mknod -m 644 $FULL_RAWDIR/dev/urandom c 1 9

RPM (or NSS) in CentOS 7.5.1804 seems to fail when /dev/urandom is not available in a chroot.
"sudo chroot $FULL_RAWDIR strace rpm" shows the dependency on /dev/urandom nicely.
TrevorH

TrevorH

2018-05-12 18:17

manager   ~0031781

More likely the correct solution is to bind mount /proc /dev and /sys from the host system onto your chroot directory before you chroot into it.
cp-jpatterson

cp-jpatterson

2018-05-14 13:03

reporter   ~0031793

Genius! Thank you that was the issue.

Issue History

Date Modified Username Field Change
2018-05-11 08:38 cp-jpatterson New Issue
2018-05-11 08:45 cp-jpatterson Note Added: 0031756
2018-05-12 18:10 karelklic Note Added: 0031780
2018-05-12 18:17 TrevorH Note Added: 0031781
2018-05-14 13:03 cp-jpatterson Note Added: 0031793