Bug 18797 - rpm fails to run glib-2.0 %transfiletriggerin which breaks gnote
Summary: rpm fails to run glib-2.0 %transfiletriggerin which breaks gnote
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
: High critical
Target Milestone: Mageia 6
Assignee: Olav Vitters
QA Contact:
Keywords: UPSTREAM
: 19221 (view as bug list)
Depends on:
Reported: 2016-06-27 17:17 CEST by Barry Jackson
Modified: 2017-06-21 20:08 CEST (History)
5 users (show)

See Also:
Source RPM: rpm, glib2.0
Status comment:

svn diff of working patch (863 bytes, patch)
2017-03-23 18:32 CET, Barry Jackson
Details | Diff
Debug patch (8.13 KB, patch)
2017-06-20 20:03 CEST, Pascal Terjan
Details | Diff
Log generated with the debug patch (70.31 KB, text/plain)
2017-06-20 20:09 CEST, Pascal Terjan

Description Barry Jackson 2016-06-27 17:17:28 CEST
Description of problem:
[baz@localhost ~]$ gnote

(gnote:2950): GLib-GIO-ERROR **: Settings schema 'org.gnome.gnote' is not installed

Trace/breakpoint trap (core dumped)

Version-Release number of selected component (if applicable):

How reproducible:
I have this in two systems, plasma and a fresh test install of LXDE with gnote installed cleanly (no previous configs).

This was working until quite recently.

Steps to Reproduce:
1. Install gnote
2. Try to run it
Comment 1 Barry Jackson 2016-06-27 18:03:37 CEST
This seems to be a gsettings issue.

[baz@localhost ~]$ gsettings list-schemas | grep gnote
[baz@localhost ~]$

[root@localhost baz]# ll /usr/share/glib-2.0/schemas|grep gnote
-rw-r--r-- 1 root root 13892 May 15 14:07 org.gnome.gnote.gschema.xml
[root@localhost baz]# glib-compile-schemas /usr/share/glib-2.0/schemas

[baz@localhost ~]$ gsettings list-schemas | grep gnote
[baz@localhost ~]$ gnote

(gnote:19281): Gtk-WARNING **: Theme directory base/ of theme oxygen has no size field

...and it works.

So I guess that either gnote is not compiling the schema or some file-trigger is not working after gnote is installed, I have no idea how this is set up.

However there is maybe another issue. In Plasma (where I am now) it launches to the task bar with a continuously circling waiting icon this goes on until it is clicked whereupon it opens into the full window.
I will test again in a clean system as my desktop configs may be affecting this.
Comment 2 Barry Jackson 2016-06-27 18:16:18 CEST
Repeating the same as above in a clean cauldron LXDE:

[baz@localhost ~]$ gsettings list-schemas | grep gnote
[baz@localhost ~]$ su
[root@localhost baz]# gsettings list-schemas | grep gnote
[root@localhost baz]# ll /usr/share/glib-2.0/schemas|grep gnote
-rw-r--r-- 1 root root 13892 May 15 14:07 org.gnome.gnote.gschema.xml
[root@localhost baz]# glib-compile-schemas /usr/share/glib-2.0/schemas
[root@localhost baz]# gsettings list-schemas | grep gnote
[root@localhost baz]# exit
[baz@localhost ~]$ gnote

...it's running with no warnings. However there are lots of:
(gnote:2937): GLib-GObject-CRITICAL **: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
...on closing, but IIRC this is normal.
Comment 3 Barry Jackson 2016-06-28 12:50:47 CEST
Apparently this should now be handled by the following in the glib2.0 spec
(thanks to Luigi on irc :)

%transfiletriggerin -n %{name}-common --  %_datadir/glib-2.0/schemas/
if [ -x /usr/bin/glib-compile-schemas ]; then
        /usr/bin/glib-compile-schemas --allow-any-name %_datadir/glib-2.0/schemas/

... which for some reason is not working in this case.
Comment 4 Barry Jackson 2016-06-28 13:24:23 CEST
Further testing confirms that the filetrigger is not working for either install or removal of gnote.
The exact command and conditional in the trigger script do work correctly when run manually.

So this appears to be an rpm/glib-2.0 bug.

Changing summary.
Comment 5 Thierry Vignaud 2016-06-30 11:45:00 CEST
Indeed "urpmi --debug-librpm yelp shows:

D: %triggerin(glib2.0-common-2.48.1-1.mga6.x86_64): scriptlet start
fdio:       2 writes,      172 total bytes in 0.000011 secs
D: %triggerin(glib2.0-common-2.48.1-1.mga6.x86_64): execv(/bin/sh) pid 14431
+ '[' -x /usr/bin/glib-compile-schemas ']'
+ /usr/bin/glib-compile-schemas --allow-any-name /usr/share/glib-2.0/schemas/
D: %triggerin(glib2.0-common-2.48.1-1.mga6.x86_64): waitpid(14431) rc 14431 status 0

But "urpmi --debug-librpm gnote" doesn't
Comment 6 Thierry Vignaud 2016-07-01 16:07:05 CEST
I think we'll have to report this upstream
Comment 7 Thierry Vignaud 2016-11-07 14:52:31 CET
It's hopefully fixed in rpm-4.13.0-3.mga6
Comment 8 Thierry Vignaud 2016-11-07 17:10:44 CET
Humm it'sn't ...
Comment 9 Thierry Vignaud 2016-11-11 16:34:25 CET
I just backported an upstream patch that now warns:
error: line 210: file trigger condition must begin with '/':   /usr/share/glib-2.0/schemas/
Comment 10 Samuel Verschelde 2017-03-17 12:37:24 CET
Is this issue still present?
Comment 11 Barry Jackson 2017-03-17 12:50:58 CET

[baz@localhost ~]$ gnote

(gnote:10314): GLib-GIO-ERROR **: Settings schema 'org.gnome.gnote' is not installed

Trace/breakpoint trap (core dumped)
[baz@localhost ~]$
Comment 12 Olav Vitters 2017-03-20 19:05:23 CET
Thiery: I don't get the warning message.  It starts with a '/', no? I tried compiling with removing one of the spaces, but that doesn't seem to be it. I also don't get any error or warning message?
Comment 13 Thierry Vignaud 2017-03-22 22:26:10 CET
I fear that somebody will have to take time to debug rpm...
Comment 14 Barry Jackson 2017-03-23 18:12:16 CET
Could we simply use a sledgehammer to workaround this in the gnote spec as Fedora seem to have done, by running glib-compile-schemas in %postun and %posttrans (or %post?):

From Fedora spec:
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :

/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : 


This needs fixing in rpm, but for Mga6 this approach would fix the gnote breakage until such time as rpm is fixed.
Comment 15 Barry Jackson 2017-03-23 18:32:41 CET
Created attachment 9147 [details]
svn diff of working patch

Tested in VM and gnote runs without error after updating to this version.
Comment 16 Thierry Vignaud 2017-03-23 22:23:35 CET
That wouldn't solve other similar issues to other packages having files in /usr/share/glib-2.0/schemas
Comment 17 Barry Jackson 2017-03-23 23:22:31 CET
I'm not suggesting it would, but it would fix gnote.

I opened this against gnote until the root cause was found.

I think https://bugs.mageia.org/show_bug.cgi?id=19221 is the only possible duplicate.
Comment 18 Barry Jackson 2017-04-05 14:41:31 CEST
*** Bug 19221 has been marked as a duplicate of this bug. ***
Comment 19 Pascal Terjan 2017-06-20 18:02:37 CEST
From adding some logging, rpm correctly finds the list of file triggers that are triggered by this transaction.

Then it merges duplicates.

Then for each of those, it searches again the matching files in the transaction (in runHandleTriggersInPkg) and sometimes doesn't find them, I still haven't found why.

It seems to happen in 2 cases:
- If same file triggers 2 file triggers from 2 different packages
- If 2 packages in the transaction trigger the same file trigger
Comment 20 Pascal Terjan 2017-06-20 20:03:35 CEST
Created attachment 9433 [details]
Debug patch
Comment 21 Pascal Terjan 2017-06-20 20:09:10 CEST
Created attachment 9434 [details]
Log generated with the debug patch

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