Localsearch keeps working, apparently stuck

Since upgrading to Fedora 44, localsearch-3 is constantly running keeping the CPU very busy. For a few hours, the number of files and folders that were “currently indexed” according to localsearch status was growing, but now it appears to be stuck, and has not been changing for a few hours while keeping the CPU busy (if I delete some files, the number decreases).

I have a very large number of files, so I’d be fine if this was a once thing and it didn’t appear to be stuck, yet here I am, and for a few hours localsearch status has been giving the same figures, with no apparent change, while the CPU keeps running busy with the localsearch-3 process at top speed:

Currently indexed: 2485795 files, 70729 folders
Remaining space on database partition: 67.4 GB (3.37%)
Data is still being indexed
2585 recorded failures:

Is there a way to find what it may be stuck on? if there’s any hint about relevant documentation, I’d gladly follow through.

Everything was fine and working as expected before the upgrade to Fedora 44.

You could use lsof -p <pid-of-localsearch> to see what files it is accessing.

Thanks for the suggestion!

I don’t see obvious culprits…

There’s a generic reference to my home folder and the root folder.

a few reference to files in /usr/lib64/ , references to the database itself, and then this part I don’t quite understand:

FYI: Please do not post pictures of text, we cannot search or quote from the image. Copy and paste the text as preformatted text using the </> button.

It seems that you found a bug in localsearch if its use lots of CPU and not accessing files. You can report in the fedora bug tracker - Making sure you're not a bot!

All clear. As I don’t see anything really sensitive, here is the full ouput of lsof -p:


COMMAND    PID USER   FD      TYPE             DEVICE    SIZE/OFF     NODE NAME
localsear 4780    g  cwd       DIR               0,44        3040      257 /home/g
localsear 4780    g  rtd       DIR               0,38         174      256 /
localsear 4780    g  txt       REG               0,38      336976 45262327 /usr/libexec/localsearch-3
localsear 4780    g  mem       REG               0,36             45262327 /usr/libexec/localsearch-3 (path dev=0,38)
localsear 4780    g  mem-w     REG               0,36             50309328 /home/g/.cache/tracker3/files/meta.db-shm (path dev=0,44)
localsear 4780    g  mem       REG               0,36             45005167 /usr/lib64/libicudata.so.77.1 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45580037 /usr/lib64/gconv/gconv-modules.cache (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45596899 /usr/share/mime/mime.cache (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005069 /usr/lib64/libstdc++.so.6.0.35 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45011535 /usr/lib64/gio/modules/libgioremote-volume-monitor.so (path dev=0,38)
localsear 4780    g  DEL       REG               0,36             50358152 /home/g/.config/dconf/user
localsear 4780    g  mem       REG               0,36             45059355 /usr/lib64/gio/modules/libdconfsettings.so (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45588707 /usr/share/glib-2.0/schemas/gschemas.compiled (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005169 /usr/lib64/libicui18n.so.77.1 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005177 /usr/lib64/libicuuc.so.77.1 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45016186 /usr/lib64/libstemmer.so.0.0.0 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45011537 /usr/lib64/gvfs/libgvfscommon.so (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45169781 /usr/lib/locale/locale-archive (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45593542 /var/lib/flatpak/exports/share/mime/mime.cache (path dev=0,38)
localsear 4780    g  mem       REG               0,36             50312240 /home/g/.local/share/mime/mime.cache (path dev=0,44)
localsear 4780    g  mem       REG               0,36             45588178 /etc/dconf/db/distro (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45588182 /etc/dconf/db/site (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45588181 /etc/dconf/db/local (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45011536 /usr/lib64/gio/modules/libgvfsdbus.so (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005200 /usr/lib64/liblzma.so.5.8.2 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005380 /usr/lib64/libblkid.so.1.1.0 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005188 /usr/lib64/libsqlite3.so.3.51.2 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005209 /usr/lib64/libxml2.so.2.12.10 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45010910 /usr/lib64/libjson-glib-1.0.so.0.1000.8 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005521 /usr/lib64/libffi.so.8.2.0 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45010693 /usr/lib64/libselinux.so.1 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45010750 /usr/lib64/libmount.so.1.1.0 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005123 /usr/lib64/libz.so.1.3.1.zlib-ng (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45005541 /usr/lib64/libpcre2-8.so.0.15.0 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45004516 /usr/lib64/libc.so.6 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             44984007 /usr/lib64/libgcc_s-16-20260515.so.1 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45010786 /usr/lib64/libgmodule-2.0.so.0.8800.2 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45011702 /usr/lib64/libupower-glib.so.3.1.2 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45061903 /usr/lib64/libtinysparql-3.0.so.0.1101.0 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45004518 /usr/lib64/libm.so.6 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45010788 /usr/lib64/libgobject-2.0.so.0.8800.2 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45010780 /usr/lib64/libgio-2.0.so.0.8800.2 (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45010784 /usr/lib64/libglib-2.0.so.0.8800.2 (path dev=0,38)
localsear 4780    g  DEL       REG               0,95                  155 /run/user/1000/dconf/user
localsear 4780    g  mem       REG               0,36             45061907 /usr/lib64/tinysparql-3.0/libtracker-parser-libicu.so (path dev=0,38)
localsear 4780    g  mem       REG               0,36             45004513 /usr/lib64/ld-linux-x86-64.so.2 (path dev=0,38)
localsear 4780    g    0r      CHR                1,3         0t0        4 /dev/null
localsear 4780    g    1u     unix 0x0000000009b6f272         0t0    48401 type=STREAM (CONNECTED)
localsear 4780    g    2u     unix 0x0000000009b6f272         0t0    48401 type=STREAM (CONNECTED)
localsear 4780    g    3u  a_inode               0,17           0     3095 [fanotify]
localsear 4780    g    4u  a_inode               0,17           0     3095 [eventfd:435]
localsear 4780    g    5u  a_inode               0,17           0     3095 [eventfd:436]
localsear 4780    g    6u     unix 0x000000004131dbaa         0t0    42403 type=STREAM (CONNECTED)
localsear 4780    g    7u  a_inode               0,17           0     3095 [eventfd:438]
localsear 4780    g    8r  a_inode               0,17           0     3095 inotify
localsear 4780    g    9u  a_inode               0,17           0     3095 [eventfd:431]
localsear 4780    g   10u      REG               0,44 12940066816      559 /home/g/.cache/tracker3/files/meta.db
localsear 4780    g   11u     unix 0x000000003c9c0034         0t0    39578 type=STREAM (CONNECTED)
localsear 4780    g   12u      REG               0,44 15703470880 50309327 /home/g/.cache/tracker3/files/meta.db-wal
localsear 4780    g   13u      REG               0,44    15302656 50309328 /home/g/.cache/tracker3/files/meta.db-shm
localsear 4780    g   14r      REG               0,44 12940066816      559 /home/g/.cache/tracker3/files/meta.db
localsear 4780    g   15u  a_inode               0,17           0     3095 [eventfd:76]
localsear 4780    g   16u  a_inode               0,17           0     3095 [eventfd:84]
localsear 4780    g   17u      REG                0,1           0     5202 /memfd:extract-persistent-storage (deleted)
localsear 4780    g   19r      REG               0,44 12940066816      559 /home/g/.cache/tracker3/files/meta.db
localsear 4780    g   20u      REG               0,44 15703470880 50309327 /home/g/.cache/tracker3/files/meta.db-wal
localsear 4780    g   21u     unix 0x00000000f48e813d         0t0    88393 type=DGRAM (UNCONNECTED)
localsear 4780    g   23r      REG               0,44 12940066816      559 /home/g/.cache/tracker3/files/meta.db

localsear 4780    g   11u     unix 0x000000003c9c0034         0t0    39578 type=STREAM (CONNECTED)
localsear 4780    g   12u      REG               0,44 15703470880 50309327 /home/g/.cache/tracker3/files/meta.db-wal
localsear 4780    g   13u      REG               0,44    15302656 50309328 /home/g/.cache/tracker3/files/meta.db-shm
localsear 4780    g   14r      REG               0,44 12940066816      559 /home/g/.cache/tracker3/files/meta.db
localsear 4780    g   15u  a_inode               0,17           0     3095 [eventfd:76]
localsear 4780    g   16u  a_inode               0,17           0     3095 [eventfd:84]
localsear 4780    g   17u      REG                0,1           0     5202 /memfd:extract-persistent-storage (deleted)
localsear 4780    g   19r      REG               0,44 12940066816      559 /home/g/.cache/tracker3/files/meta.db
localsear 4780    g   20u      REG               0,44 15703470880 50309327 /home/g/.cache/tracker3/files/meta.db-wal
localsear 4780    g   21u     unix 0x00000000f48e813d         0t0    88393 type=DGRAM (UNCONNECTED)
localsear 4780    g   23r      REG               0,44 12940066816      559 /home/g/.cache/tracker3/files/meta.db

From the look of the lsof output it is not scanning file.
The fanotify shows it is watching for changes.

Is it still using a lot of CPU time? If so report as a but please.

here is from top

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                      
 124444 g         39  19 4966016   3.9g  48244 S 101.2   6.2   4:22.39 localsearch-ext                                                                                                                              
   4780 g         39  19 2097652 341264  39996 S  96.6   0.5 232:01.61 localsearch-3         

I will try some options, and if nothing helps, will report.

TL;DR : go via GUI to settings → search → search locations and make sure only relevant folders are being indexed, and rebuild index anew with localsearch reset --filesystem for good measure, and after a few minutes everything will be fine.

Here are the steps I have taken to deal with this.

First, I reset the tracker’s database, with localsearch reset --filesystem

This reduced the number of errors, but the process kept running, even if at least localsearch status reached a point where it would say Indexer is idle , which never happened before the reset (and I also get many fewer errors). But although allegedly idle, CPU was still maxing.

I then finally noticed that there are not one, but two localsearch processes:

  • localsearch-3
  • localsearch-ext

When I run `lsof -p` on the the latter, than I could finally see where the indexer was wasting its time (indexing a folder with a very large number of html files, in the order of hundreds of thousands)

I then tried to follow the documentation and remove the relevant folder from the index, with

localsearch index --remove <path>

But this apparently didn’t work (although it threw no error, I could see no change to localchange info). Perhaps I somehow got it wrong.

Eventually, instead of working with custom config files or gsettings, I went back to GUI, went to settings → search → search locations

Then removed home, and added some custom folders at the bottom.

Then reset again localsearch for good measure, and apparently everything went fine… after a few minutes, indexing finished, and all looked good.

In brief, I am not quite sure if something was broken in the database with the update from Fedora 43, or if I could just let it scan folders with million of files and create a database with tens of GB in size and then it would have eventually settled (I let the process run for about 5 hours before investigating, and it was still CPU maxing). The fact that it reached idle status after the first reset, leads me to thing that something was indeed broken before that, but who knows.

@giocomai out of curiosity: are you still experiencing this?

I’ve been noticing a lot of erratic behaviour with localsearch-3, and ended up doing something similar to you. I work on code, and I suspect this thing was trying to index environment files.
I also ended up setting custom directories for it, and even moving my code to a separate directory.

I am not sure if this really solved the problem, though. localsearch still pops up and hogs resources at random