Bug 433579

Summary: Requires(post) does not bring in library dependencies at the right time
Product: [Fedora] Fedora Reporter: Orion Poplawski <orion>
Component: bashAssignee: Roman Rakus <rrakus>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: dcantrell, mk, oget.fedora, pnasrat, rc040203, rrakus, tsmetana, twaugh, wtogami
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: NEEDSRETESTING
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-29 08:17:38 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:
Bug Depends On:    
Bug Blocks: 446449    

Description Orion Poplawski 2008-02-20 04:46:26 UTC
Description of problem:

I'm doing a livecd build against rawhide.  I'm seeing the following messages
during install:

  Installing: tcsh                         ################### [ 322/1182]grep:
error while loading shared libraries: libpcre.so.0: cannot open shared object
file: No such file or directory
grep: error while loading shared libraries: libpcre.so.0: cannot open shared
object file: No such file or directory
  Installing: mlocate                      ################### [
384/1182]/bin/grep: error while loading shared libraries: libpcre.so.0: cannot
open shared object file: No such file or directory
  Installing: coreutils                    ################### [
415/1182]/bin/grep: error while loading shared libraries: libpcre.so.0: cannot
open shared object file: No such file or directory
  Installing: fontconfig                   ################### [ 417/1182]grep:
error while loading shared libraries: libpcre.so.0: cannot open shared object
file: No such file or directory
  Installing: rpm                          ################### [ 437/1182]grep:
error while loading shared libraries: libpcre.so.0: cannot open shared object
file: No such file or directory
  Installing: nss_ldap                     ################### [ 558/1182]grep:
error while loading shared libraries: libpcre.so.0: cannot open shared object
file: No such file or directory
  Installing: initscripts                  ################### [ 591/1182]fgrep:
error while loading shared libraries: libpcre.so.0: cannot open shared object
file: No such file or directory
  Installing: torque                       ################### [
643/1182]/bin/grep: error while loading shared libraries: libpcre.so.0: cannot
open shared object file: No such file or directory
  Installing: microcode_ctl                ################### [ 658/1182]grep:
error while loading shared libraries: libpcre.so.0: cannot open shared object
file: No such file or directory
  Installing: pcre                         ################### [ 675/1182] 

Now, tcsh has:

Requires(post): grep

and grep has a requirement on libpcre.so.0, but pcre isn't getting installed
until later in the transaction.

Version-Release number of selected component (if applicable):
rpm-4.4.2.2-13.fc9

Comment 1 Orion Poplawski 2008-03-31 17:39:27 UTC
I'm seeing these now in regular anaconda installs of rawhide:

Installing coreutils-6.10-16.fc9.i386
/bin/grep: error while loading shared libraries: libpcre.so.0: cannot open
shared object file: No such file or directory

coreutils does a:

Requires(post): grep

So it is doing the right thing by requiring grep, but not all of grep's
dependencies are installed yet.

rpm-4.4.2.3-0.5.rc1.i386

I really think this should be a release blocker as this could leave the
installed system in a strange state if %post scripts fail strangely.

Comment 2 Bug Zapper 2008-05-14 05:17:50 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Mogens Kjaer 2008-05-20 08:49:47 UTC
Is there any trick that puts pcre earlier in the installation?

Comment 4 Jeff Johnson 2008-05-20 23:34:10 UTC
No tricks, just standard distro QA.

tcsh has
    Requires(post): grep

grep has
    Requires: libpcre.so.0

pcre has
    Provides: libpcre.so.0

If pcre-7.3-3.fc9 is not installed before grep-2.5.1-59.fc9, which is installed
before tcsh-6.15-4.fc9, then either
   1) there are dependency loops (which cause the above dependencies to be ignored while ordering).
   2) something else has been broken in rpm-4.4.2.3-2.fc9



Comment 5 Mogens Kjaer 2008-05-21 04:59:48 UTC
How do I tell if it is 1) or 2)?

And more specifically, how do I fix the problem?

As it is now, I can't rebuild a Live-CD with a changed package list.

During installation of the rpm package I get:

Installing: rpm                          ################### [ 756/1730]grep:
error while loading shared libraries: libpcre.so.0: cannot open shared object
file: No such file or directory

During the Live-CD %post section I get errors from rpm:

rpmdb: Program version 4.3 doesn't match environment version
error: db4 error(-30974) from dbenv->open: DB_VERSION_MISMATCH: Database
environment version mismatch
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
error: /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora: import failed.

I have a manual installation of the Sun Java JRE .rpm, this fails with
the same error message.

I assume that these errors are due to the fact that the post script
of the rpm installation hasn't been run.

How do I fix this problem?

Comment 6 Orion Poplawski 2008-10-10 15:55:35 UTC
I'm still seeing this building a livecd on current rawhide:

  Installing: tcsh                         ################### [ 172/1215]
grep: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

pcre is finally installed later:

  Installing: pcre                         ################### [ 535/1215]

Comment 7 John Poelstra 2008-10-10 22:23:29 UTC
This bug has been triaged

Comment 8 Orion Poplawski 2008-10-27 21:37:44 UTC
A new manifestation:

Installing bash-3.2-28.fc10.x86_64
/bin/sh: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
warning: %post(bash-3.2-28.fc10.x86_64) scriptlet failed, exit status 127

Comment 9 Orion Poplawski 2008-10-28 19:15:57 UTC
Interestingly, all of the other pcre messages are now gone.  Perhaps coincidence, perhaps related.

Comment 10 Jesse Keating 2008-10-28 19:42:39 UTC
While I think this is a bit of a pile-on bug, the current issue with the bash circular dep is one that concerns me for F10 Preview, so I'm adding it to the blocker.

Comment 11 Panu Matilainen 2008-10-28 21:17:13 UTC
Yes this is starting to be way too much of a pile-on bug... so lets forget about the older issues that apparently are gone now (as per comment #9), the pcre thing was almost certainly a dependency loop somewhere too.

Most likely this recent bash change:
https://www.redhat.com/archives/fedora-extras-commits/2008-October/msg06379.html

-Requires(post): ncurses

Removing the (post) bit removes the hint that rpm needs for correctly snipping the dependency loop. And over to bash.

Oh and FWIW, bash being one of those early "bootstrap" packages, it's %post would be prime candidate for using the embedded Lua for it's actions, it'd avoid these kind of issues completely as -p <lua> doesn't need any external dependencies to work.

Comment 12 Panu Matilainen 2008-10-28 21:19:10 UTC
*** Bug 468827 has been marked as a duplicate of this bug. ***

Comment 13 Jesse Keating 2008-10-28 21:34:26 UTC
I'm adding back the Requires(post) on ncurses-libs since that's what we actually need in %post.  Easier than re-writing it in LUA, which could be done post-f10.  Build going into koji shortly, will need testing when done.

Comment 14 Jesse Keating 2008-10-28 21:59:48 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=909965 has the build if anybody wants to try and verify it.

Comment 15 Jesse Keating 2008-10-28 23:11:05 UTC
Verified fixed, and now tagged for F10.

Comment 16 Roman Rakus 2008-10-29 10:48:37 UTC
*** Bug 468923 has been marked as a duplicate of this bug. ***

Comment 18 Jesse Keating 2009-01-29 08:17:38 UTC
I got some help and replaced the %post in bash with a <lua> script so that bash doesn't require anything external.  I think I forgot to remove the Requires(post) but that's OK for now.  The buildsystem is again functional.

It had stopped working because we upgraded to a yum that treated errors in %post as fatal.