KDE, Krunner, and Baloo

Guest Linux tech tip, written by “Tedel” (tedel)

If you’re running KDE as your desktop environment, you may have run into these issues. Tedel has found an easy way to solve both issues! He writes:

How to solve two minor annoyances on KDE desktop (Krunner & Baloo)

If you use KDE, you may have noticed that, now and then, Krunner or Baloo get crazy. Krunner starts eating resources and even overheating your CPU without explanation (I suffered an 84% CPU consumption once, and my computer turned off automatically because of the overheating); while Baloo sometimes seems to never stop crawling your home folder to build its database.

Fortunately both issues are quite easy to solve. Here the details:

Krunner takes a lot of CPU

The high CPU consumption of Krunner usually comes right after upgrading KDE. Although I cannot tell why because I am not a KDE developer, I was able to find that find out Baloo was causing the problem. It seems that, for some reason, the previous database of files becomes… er… incompatible (or something like that) after the upgrade and drives Krunner crazy. Krunner uses Baloo’s database to search for files as you type, so it makes sense any problem with Baloo might affect Krunner too.

The Fix:

The solution is to erase Baloo’s database and log out (and back in) to force Baloo to create a new database of your home folder, and a clean database usually solves the Krunner high CPU consumption issue.

Your Baloo database is usually on ~/.local/share/baloo/. You can erase every file without concerns. The database will be recreated in your next KDE session.

Baloo fails to index your home folder

This one was trickier for me because there was not any problem with Baloo (congratulations KDE developers!), yet no matter how many times I tried, my database still got stuck after indexing a fixed number of files.

$ balooctl status
Baloo File Indexer is running
Indexer state: Indexing file content
Indexed 10473 / 25555 files
Current size of index is 224.12 MiB

The problem was not a problem. All Baloo wanted to do is to index a corrupt file, but it couldn’t, so it kept trying.

Yet there is a small issue: Baloo does not have a time-out or a notification system in case a file fails to be read or indexed correctly, and there is no way to ask Baloo what file is trying to be indexed but fails. So I had to look for the problem manually playing with Baloo for a while:

The Fix:

First, I created a new folder in my computer.
Next, I moved all my home folder into that new folder I created.
Next, I opened “system settings” and asked Baloo not to search in that location by opening system settings > search > file search > and adding the folder I just created to the list of folders that would be skipped.
Next, I erased current Baloo’s database ~/.local/share/baloo/.
Next, I logged out and logged back in.

After logging back in, I opened a terminal (Konsole is enough, don’t complicate it) and I ran balooctl status to make sure the result gave me zero (no files to index, and nothing indexed).
Then, I began moving one after one each of the subfolders from the temporary folder back to /home, and monitored how they were being indexed by running balooctl status in the terminal window.
Eventually, I found where Baloo stopped indexing, and I began opening file after file in that subfolder until I found the corrupted files Baloo just couldn’t read. After removing those files, Baloo continued indexing the rest of my home folder, and still today…

$ balooctl status
Baloo File Indexer is running
Indexer state: Indexing file content
Indexed 25555 / 25555 files
Current size of index is 374.53 MiB

…my home folder is being indexed and updated without issues.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s