Bug 510622 - `balooctl index` does not print an error or returns error status when it has problems indexing
Summary: `balooctl index` does not print an error or returns error status when it has ...
Status: REPORTED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: balooctl (other bugs)
Version First Reported In: 6.19.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-15 03:31 UTC by skierpage
Modified: 2025-10-28 19:50 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 2025-10-15 03:31:25 UTC
SUMMARY
`balooctl index /path/to/file` should print an error and return non-zero status if it fails to index a file's contents.

STEPS TO REPRODUCE
1.  Find a file that shows up in `balooctl failed` output, even after I clear it and index it (see bug 501613).
2. Turn on baloo and kfilemetadata logging by adding 
kf.filemetadata=true
kf.baloo=true
    to ~/.config/QtProject/qtlogging.ini
3. In another terminal window, clear the problematic file from the index again and index it (note in Fedora, the command is `balooctl6`) and print the exit status of the index command.
    % balooctl clear /path/to/Mail/Foldername
    % balooctl index /path/to/Mail/Foldername
    % echo $?
    % balooctl failed

OBSERVED RESULT
The index command prints
    Indexing /media/Windows/Users/spage/Thunderbird_profiles/1y6g4zic.default/Mail/Local Folders/Diary
    File(s) indexed
`echo $?` displays 0, i.e. the index command completed successfully.

But the logging prints out:
    kf.filemetadata: Extracting UTF-8 "\r\n" plain text from "/path/to/Mail/Foldername"
    kf.filemetadata: Invalid encoding. Ignoring "/path/to/Mail/Foldername"
and the problematic file is still in the list of failed files.

EXPECTED RESULT
If content indexing fails, tell the user (even without logging enabled) and return a non-zero exit status.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2

ADDITIONAL INFORMATION
Few people will ever run `balooctl index /path/to/file`; normally the baloo_file process indexed files in the background. I believe its failures  to index file content should likewise be logged in the system log by default, although in another bug comment (?) someone (Nate?) expressed concern that such error logging might reveal the path to a file and its contents.
Comment 1 tagwerk19 2025-10-28 19:50:03 UTC
I need to do some more tests, but it does seem that balooctl6 doesn't return an error code....