NautilusDevel nightly flatpak sandboxes Tracker and ignores the system-provided Tracker3, causing cache duplication and mining
Affected version
- Nightly flatpak: Yes
Steps to reproduce
flatpak run org.gnome.NautilusDevel
Current behavior
This gets printed to the terminal:
** Message: 14:34:06.525: Connecting to org.freedesktop.Tracker3.Miner.Files
** (org.gnome.NautilusDevel:2): WARNING **: 14:34:07.332: Unable to create connection for session-wide Tracker indexer: Parser error at byte 55, expected one of ',', 'base', 'prefix', 'constraint', 'select', 'construct', 'describe', 'ask':
…cker:FileSystem;tracker:Docume…
‸
** Message: 14:34:07.332: Starting org.gnome.NautilusDevel.Tracker3.Miner.Files
If you search for tracker in gnome-system-monitor's processes, you will see a bubblewrapped tracker grinding your disk and CPU even though your system was already indexed by the normal tracker instance.
If you visit ~/.var/app/org.gnome.NautilusDevel/cache/nautilus/miner/files
after a while you will see that it recreated its own cache of everything after mining. In my case that's a significant amount of disk space consumed:
Expected behavior
Use the system-installed tracker3.
Additional information
@carlosg provided some hints:
Tracker 3 added a portal to allow searching across Flatpak boundaries. The reason some apps bundle Tracker 3.x is for backwards compatibility on systems that have Flatpak but don't have Tracker 3.x, only Tracker 2.
In most cases its not a big inefficiency, the miners inside the sandbox are started manually by the app (there's nothing else that could start them), and the app will only do that if Tracker 3 is not found on the host
Nautilus Devel flatpak supposedly only uses its internal miners if connection with the host miner/db fails, in https://gitlab.gnome.org/GNOME/nautilus/-/blob/master/src/nautilus-tracker-utilities.c#L55-L69
...and as you can see with the warnings pasted above in this bug report, it does seem to fail.
Supposedly this might have been caused by a flatpak change at some point, but I was advised to report this here.