Bug 455456 - baloo_file doesn't index drives if you let KDE mount them "On Login"
Summary: baloo_file doesn't index drives if you let KDE mount them "On Login"
Status: REPORTED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: Baloo File Daemon (other bugs)
Version First Reported In: 5.93.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-17 02:57 UTC by skierpage
Modified: 2022-06-17 09:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2022-06-17 02:57:38 UTC
SUMMARY
I edited ~/.config/baloofilerc telling it to index folders on my NTFS drive which I had mounted in /etc/fstab, and Baloo indexed them for years 🥳. Until, as part of reinstalling Fedora, instead of /etc/fstab I let KDE mount my NTFS drive using System Settings > Removable Storage > Removable Devices, by checking Automount > Attached Devices > Windows "On Login".

After I this change, `balooctl monitor` showed that baloo_file wasn't noticing new and changed files on NTFS. However, a manual  `balooctl check` would find new and changed files and index them. I'm pretty sure the reason they're not indexed is Plasma startup starts the /usr/libexec/baloo_file process before calling /sbin/mount.ntfs to mount the drive, and the already running baloo_file doesn't seem to "notice" that the path to the folder is now available to monitor. 

STEPS TO REPRODUCE
1. In System Settings > Removable Storage > Removable Devices , configure an attached drive to Automount "On Login"
2. Add the absolute (no symbolic links) path to a directory on this drive to ~/.config/baloofilerc, e.g.
   folders[$e]=$HOME/,/run/media/spage/Windows/Users/spage/Documents/
3. Reboot computer.
4. Enter the terminal command `balooctl monitor &`
5. Modify a file in this directory, e.g. `echo balooIndexMe > /run/media/spage/Windows/Users/spage/Documents/index_test.txt
6. Search for this file, e.g. `baloosearch balooIndexMe`
7. Restart baloo with `balooctl disable`, `baloctl enable`
8. Repeat step 5.

OBSERVED RESULT
balooctl monitor doesn't report "Indexing: /path/to/new/file.txt"; searching for its content fails. But if you restart baloo, then baloo_file starts watching the folder on the drive.

EXPECTED RESULT
I know file notification is hard, and there's an argument that Baloo shouldn't index "removable" drives; but this is unexpected behavior that's too sensitive to startup order. baloo_file should watch for when folders it's been told to index appear, even when it's already running.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.93.0
Qt Version: 5.13.3 on Wayland

ADDITIONAL INFORMATION
Advanced users might be able to modify the kde-baloo.service to wait for KDE's disk automounting.
A workaround is to restart baloo_file with balooctl disable then balooctl enable.
Comment 1 tagwerk19 2022-06-17 09:19:48 UTC
You managed to get further than I...

(In reply to skierpage from comment #0)
> ... NTFS drive which I had mounted in /etc/fstab, and Baloo indexed them for years 🥳.
I assume you are/were using the (older) ntfs-3g drivers, not the recently included ntfs3?

I tried the ntfs3 drivers with some "magic dust" in the /etc/fstab,
    https://bugs.kde.org/show_bug.cgi?id=406506#c21
That seems quite solid, not trusting production data on it but seems OK during "regular revisiting"

If I remove the /etc/fstab line and try mounting via Dolphin, I get a authentication prompt and the volume is mounted via fuseblk (and ntfs-3g). Couldn't get automounting to work...