Bug 974505 - warning: %post(shared-mime-info-0.70-4.el6.i686) scriptlet failed, exit status 127
Summary: warning: %post(shared-mime-info-0.70-4.el6.i686) scriptlet failed, exit statu...
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: shared-mime-info
Version: 6.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: beta
: ---
Assignee: Bastien Nocera
QA Contact: Desktop QE
: 730461 (view as bug list)
Depends On:
Blocks: 994246 972747
TreeView+ depends on / blocked
Reported: 2013-06-14 10:01 UTC by Marian Ganisin
Modified: 2018-12-06 15:07 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-05-27 09:07:21 UTC
Target Upstream Version:

Attachments (Terms of Use)
install.log in the no-error case (9.89 KB, text/plain)
2014-01-22 21:53 UTC, Kay Williams
no flags Details
install.log in the error case (53.43 KB, text/plain)
2014-01-22 21:53 UTC, Kay Williams
no flags Details

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0555 normal SHIPPED_LIVE shared-mime-info bug fix update 2014-05-27 13:07:05 UTC

Description Marian Ganisin 2013-06-14 10:01:36 UTC
Description of problem:

During installation of system installer reports this failure:

Installing shared-mime-info-0.70-4.el6.i686
warning: %post(shared-mime-info-0.70-4.el6.i686) scriptlet failed, exit status 127

Version-Release number of selected component (if applicable):
Installing shared-mime-info-0.70-4.el6

How reproducible:

Expected results:
Properly installed package including correct execution of rpm scriptlets or no error message in case of success or harmless issue.

Comment 4 Kay Williams 2014-01-22 21:51:32 UTC
I am seeing this issue as well, but not in all cases. 

The scriptlet that is failing has the following command (as seen from rpm -q --scripts shared-mime-info):
/usr/bin/update-mime-database /usr/share/mime &> /dev/null

Error 127 means 'command not found'. The update-mime-database command is installed by the shared-mime-info command, so presumably it is not missing but rather there is a permissions (maybe selinux) issue?

Whether the error appears or not seems related to the order packages are installed.

For example- 

Good: with a barebones install of @core and shared-mime-info, a total of 114 packages install ahead of shared-mime-info and there is no error.

Bad: With a more complex install, a total of 84 packages install ahead of it and the error occurs.

See attached files that show the install.log for both cases.

Comment 5 Kay Williams 2014-01-22 21:53:10 UTC
Created attachment 854051 [details]
install.log in the no-error case

Comment 6 Kay Williams 2014-01-22 21:53:46 UTC
Created attachment 854052 [details]
install.log in the error case

Comment 7 Kay Williams 2014-01-23 03:43:42 UTC
More information:

Since this issue is blockign a current project, I continued experimenting. My first step was to modify the shared-mime-info specfile and rebuilding the rpm (see related bug 1056802).

Specifically, I modified the scriptlet line in the specfile as follows:

before: /usr/bin/update-mime-database /usr/share/mime &> /dev/null
after:  /usr/bin/update-mime-database /usr/share/mime

This unmasked the real error message which turned out to be:

/usr/bin/update-mime-database: error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directory
So, the underlying problem is that (for some reason) the glib2 package (which provides libglib-2.0.so.0) is being installed after shared-mime-info in some cases.

I tried adding a "Requires: glib2" statement to the specfile, but this made no difference - glib2 was still installed after shared-mime-info. (Note that adding glib2 should not have been necessary at any rate as the 'rpm -q --requires shared-mime-info' already listed 'libglib-2.0.so.0()(64bit)'

So now this looks like a dependency resolution issue?

Comment 8 Kay Williams 2014-01-23 04:02:07 UTC
More information:

Actually, there is a circular dependency here. The glib2 package lists 'shared-mime-info' as a requires, and the shared-mime-info package lists 'libglib-2.0.so.0' (provided by glib2).

From the install.log files (attached), you can see that in the 'good' case, shared-mime-info is installed first, just prior to glib2.  In the 'bad' case the order is reversed.

Comment 9 Kay Williams 2014-01-23 21:40:18 UTC
Final note:

I am able to work around this for now by rebuilding the shared-mime-info package with the following post install script:

# Should fail, as it would mean a problem in the mime database
if [ -f %{_lib}/libglib-2.0.so.0 ]; then
  %{_bindir}/update-mime-database %{_datadir}/mime > /dev/null

Comment 10 Bastien Nocera 2014-01-27 13:39:07 UTC
The problem should be solved in anaconda (or at least, the packaging guidelines should be amended to take those cases into account if that's not fixable in anaconda itself).

FWIW, I don't know whether it's possible to reproduce this bug at all in yum, as I don't think we can install a RHEL or Fedora base system without glib2 installed (thus, without shared-mime-info being installed at the same time through the installed/anaconda).

Thanks a lot for the root-causing Kay.

Comment 11 David Cantrell 2014-01-27 13:45:47 UTC
Either the glib2 package or shared-mime-info package needs their Requires and/or scripts adjusted to deal with this situation.  We do not work around issues like this in anaconda.  I agree that this is something that should be updated in the packaging guidelines (ideally the package review process would catch circular dependency issues like this too).

This bug either belongs with shared-mime-info or glib2, but not anaconda.  It might be both.  At any rate, it's definitely not something we can deal with in anaconda.  If you want the problem addressed in glib2, please reassign it there.  If you want it addressed as a distribution-wide issues, please reassign it to 'distribution'.

Comment 12 Bastien Nocera 2014-01-27 14:47:52 UTC
*** Bug 730461 has been marked as a duplicate of this bug. ***

Comment 14 Johnny Hughes 2014-02-20 00:32:16 UTC
I see the same error in mock root logs as shared-mime-info installs before glib2.

Comment 15 Matthias Clasen 2014-03-27 15:45:43 UTC
The rawhide package has 

Requires(post): glib2

I assume thats sufficient to fix this bug

Comment 16 Kay Williams 2014-03-30 17:53:55 UTC
Actually, no, that won't address the issue, unless a change has also been made to the requires of the glib2 package.

The trouble is that there is a circular dependency.

shared-mime-info requires glib2 (via libglib-2.0.so.0)
glib2 requires shared-mime-info

One of those two packages needs to be modified to remove the dependency on the other.

Comment 17 Matthias Clasen 2014-04-02 21:42:46 UTC
a circular dependency just means that shared-mime-info and glib2 have to be installed at the same time. The requires(post) adds additional information that should be sufficient to sort out the necessary ordering inside the transation.

Comment 18 Kay Williams 2014-04-02 22:50:21 UTC
I see. Thanks for the clarification.

Comment 19 Bastien Nocera 2014-05-21 14:46:53 UTC
Package with the idea from comment 15 is built in shared-mime-info-0.70-5.el6.

Comment 23 errata-xmlrpc 2014-05-27 09:07:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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