After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 784278 - Nautilus spams logs with message: "nautilus_menu_provider_get_background_items: assertion 'NAUTILUS_IS_MENU_PROVIDER (provider)' failed"
Nautilus spams logs with message: "nautilus_menu_provider_get_background_item...
Status: RESOLVED FIXED
Product: nautilus-python
Classification: Other
Component: general
1.1
Other Linux
: Normal minor
: ---
Assigned To: Adam Plumb
Adam Plumb
Depends on:
Blocks:
 
 
Reported: 2017-06-28 08:15 UTC by emma peel
Modified: 2017-12-07 00:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description emma peel 2017-06-28 08:15:15 UTC
This happens to me while running Tails based on Debian Stretch (Tails 3.x) but I am not sure when it started (maybe since systemd)

Nautilus complains a lot on the logs, making debugging cumbersome and advancing climate change :D


Tails devs had a look at this and:

The corresponding code is: https://sources.debian.net/src/nautilus/3.22.1-2/libnautilus-extension/nautilus-menu-provider.c/?hl=127#L127

This was reported in Ubuntu (https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1429535), where someone suggests the culprit might be python-nautilus. I don't see this error on a sid system without anything installed in /usr/share/nautilus-python/extensions/. Installing a single package that ships something in there (e.g. mat or nautilus-image-manipulator) and restarting Nautilus is enough to make these errors appears in the logs. So this indeed seems like a bug in python-nautilus. It might be that thinks like PyObject_IsSubclass(type, (PyObject*)&PyNautilusMenuProvider_Type (in src/nautilus-python-object.c) need to be adjusted wrt. Python Nautilus extensions using GObject introspection, and not some older technology.


You can reply to Tails devs here:
https://labs.riseup.net/code/issues/13174

Thanks for your work!
Comment 1 intrigeri 2017-06-28 10:46:58 UTC
(In reply to emma peel from comment #0)
> but I am not sure when it started (maybe since systemd)

FWIW I don't think it has anything to do with the init system.

> You can reply to Tails devs here:
> https://labs.riseup.net/code/issues/13174

No, let's not spread the discussion too much. Let's discuss it here instead :)
Comment 2 Ernestas Kulik 2017-08-08 10:01:55 UTC
I can’t find any of the extensions you mention in Fedora repos and the ones I tried behave as expected.
Comment 3 intrigeri 2017-08-13 16:48:18 UTC
(In reply to Ernestas Kulik from comment #2)
> I can’t find any of the extensions you mention in Fedora repos and the ones
> I tried behave as expected.

Indeed, while the Python bindings for Nautilus, which this bug is about, are in Fedora (https://apps.fedoraproject.org/koschei/package/nautilus-python?collection=f26) there doesn't seem to be any extension that actually uses them in Fedora. So, in order to reproduce bugs in this component _on Fedora_ one needs to either install by hand a Nautilus extension that uses these bindings, or test on another distro that packages some of them (Debian, Ubuntu). If you prefer the latter way and need pointers, let me know, I'll happily help.
Comment 4 Ernestas Kulik 2017-08-13 16:54:34 UTC
(In reply to intrigeri from comment #3)
> Indeed, while the Python bindings for Nautilus, which this bug is about, are
> in Fedora
> (https://apps.fedoraproject.org/koschei/package/nautilus-
> python?collection=f26) there doesn't seem to be any extension that actually
> uses them in Fedora. So, in order to reproduce bugs in this component _on
> Fedora_ one needs to either install by hand a Nautilus extension that uses
> these bindings, or test on another distro that packages some of them
> (Debian, Ubuntu). If you prefer the latter way and need pointers, let me
> know, I'll happily help.

I’m not sure what you’re trying to achieve with this comment, but I’m fairly sure I know how to tell if the extension is a Python one, and let me tell you - I did install a few _on Fedora_ from the repos.

Now, whether or not they all execute the same failing code path is another question.
Comment 5 intrigeri 2017-08-13 17:25:42 UTC
Meta: I'm sorry. I should clearly have checked my facts before posting a comment that suggested I knew better. My intent was to help, and I failed.

Ernestas, can you please tell me which extensions you've tested? I would like to try & reproduce this (potential) bug with the extensions you've tested, on the affected distros.

Meanwhile, I'll try & reproduce on Fedora with the extensions we've seen expose this problem on Debian/Ubuntu/Tails.
Comment 6 Ernestas Kulik 2017-08-13 17:30:55 UTC
(In reply to intrigeri from comment #5)
> Meta: I'm sorry. I should clearly have checked my facts before posting a
> comment that suggested I knew better. My intent was to help, and I failed.
> 
> Ernestas, can you please tell me which extensions you've tested? I would
> like to try & reproduce this (potential) bug with the extensions you've
> tested, on the affected distros.
> 
> Meanwhile, I'll try & reproduce on Fedora with the extensions we've seen
> expose this problem on Debian/Ubuntu/Tails.

It doesn’t matter anymore, I should have tried with the ones you mentioned and not assuming their brokenness (which doesn’t even make sense given the function that is causing it). nautilus-mat is triggering the criticals as expected and I’m trying to debug it now. Thanks for getting back on this.
Comment 7 Ernestas Kulik 2017-08-14 06:41:33 UTC
Sorry, I’m not getting far with this. Something wrong is happening on the way back to libnautilus-extension via libpython and gobject, but it’s quite the mess to debug.

I might find some time to dig more later in the week, but I can’t promise much.
Comment 8 Ernestas Kulik 2017-08-14 06:43:47 UTC
(In reply to Ernestas Kulik from comment #7)
> via libpython and gobject

I meant pygobject.
Comment 9 Adam Plumb 2017-12-06 00:31:14 UTC
The direct cause of this is that the python extension is not implementing the get_background_items method.  This shouldn't cause a failure but for some reason it is.  I'm looking into it.  In the meantime you can workaround this by implementing a get_background_items method that returns an empty list.
Comment 10 Adam Plumb 2017-12-07 00:17:33 UTC
For now I'm going to recommend implementing a dummy get_background_items like so:

def get_background_items(self, window, file):
    return None

This warning can be fixed with a change in Nautilus, but I'll need to work with the Nautilus devs to see if there is an appetite for it.  In the meantime I'm going to close this ticket out as there is a workable solution.