Bug 398867 - Dolphin search doesn't work in $HOME when you select "From here"
Summary: Dolphin search doesn't work in $HOME when you select "From here"
Status: REPORTED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.50.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-20 10:52 UTC by Patrick Holthaus
Modified: 2023-11-02 07:13 UTC (History)
5 users (show)

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


Attachments
Screenshot of search bar (67.54 KB, image/png)
2018-09-21 12:15 UTC, Patrick Holthaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Holthaus 2018-09-20 10:52:05 UTC
If you select "From here" while in the user's home directory, search doesn't work: Even files that are obviously there and are visible in the directory before opening the search don't appear. This happens whether you search for filenames or content (I didn't check further options).

Some more observations:

 * After a while, dolphin notifies the user that baloosearch died: "The process for the baloosearch protocol died unexpectedly."
 * balooctl status reports: "Baloo File Indexer is running.", Index looks healthy as well.
 * dolphin's terminal output contains: "Empty filename passed to function" on searching.
 * dolphin's terminal output sometimes contains: "org.kde.dolphin: slotUrlSelectionRequested:  QUrl("file:///{{homedir}}/{{selected folder}}")" after selecting different folders (at somerandom point later?)
Comment 1 Nate Graham 2018-09-20 19:25:32 UTC
But searching explicitly in the home directory rather than "from here" does work?
Comment 2 Patrick Holthaus 2018-09-21 12:15:46 UTC
Created attachment 115140 [details]
Screenshot of search bar
Comment 3 Patrick Holthaus 2018-09-21 12:16:28 UTC
I thought that selecting "From here (pholthaus)" is actually the explicit variant that searches in the current folder. The only other option is "Everywhere".
Comment 4 Nate Graham 2018-09-21 14:31:18 UTC
My apologies, I confused myself for a moment there! I meant, does it work when you click "Everywhere"?
Comment 5 Patrick Holthaus 2018-09-21 15:43:32 UTC
Sorry, that has gone missing due to editing the original post. Yes, it works perfectly when you select "Everywhere".
Comment 6 Nate Graham 2018-09-21 15:45:02 UTC
Awesome, thanks for the info. BTW, we have a patch that should fix the issue: https://phabricator.kde.org/D15635
Comment 7 yari.dev.it 2018-09-21 16:31:58 UTC
I think it isn't a Dolphin bug but a Baloo bug.
If you try to force baloo to search an item (/home/user/foo) in a specific folder from terminal (baloosearch -d /home/user foo), it doesn't find anything, but, if you tell it to search that in the parent folder (baloosearch -d /home foo), it will find it.
I don't know how to resolve this bug because I never worked on this project, but there's nothing wrong with Dolphin.
Comment 8 Nate Graham 2018-09-21 16:35:06 UTC
You are correct, and the patch is for Baloo. :)
Comment 9 yari.dev.it 2018-09-21 17:07:39 UTC
Excuse me, my internet connection is horrible and I saw the comment too late. Anyway, I compiled the patched code, but the error persists.
Comment 10 Nate Graham 2018-09-21 17:09:53 UTC
Yari, it sounds like you have a different problem, then. I can confirm Patrick's issue but not yours. Would you file a new bug for it? Thanks!
Comment 11 yari.dev.it 2018-09-21 18:08:27 UTC
Ok, there isn't any bug, my system's baloo simply didn't index my home directory before a certain date. So, I forced it to index again and it works. I don't know if Patrick's issue is the same that I had, but also unpatched dolphin now works well. Excuse me again but theese are my first approaches to KDE bugs community.
Comment 12 Nate Graham 2018-09-21 18:50:58 UTC
Not a problem, we've all been there. :)
Comment 13 Patrick Holthaus 2018-09-24 08:51:22 UTC
Thank you Nate. Great to hear there is a patch already!

Just because it may become useful:
I tried to reproduce the bug on another system but was not successful. I don't know what could be the reason for that because both systems are more or less up-to-date although their update cycle is vastly different meaning that the other system did not get a lot of updates in between.
Comment 14 Jaime Torres 2018-09-25 17:21:00 UTC
Git commit 95af521127c117c1aebf3a3881a86dc7422a2a11 by Jaime Torres Amate.
Committed on 25/09/2018 at 17:20.
Pushed by jtamate into branch 'master'.

Use String to store UDS_USER and UDS_GROUP of String type.

Summary:
First crash I get after enabling Dr. Konqi for slaves.
UDS_USER and UDS_GROUP are strings, not numbers, therefore I've got an assert (simplified):
"udsField & KIO::UDSEntry::UDS_NUMBER", "udsentry.cpp", line=line@entry=113)

Use the same methods to get those data as in file.

Test Plan: Search an obvious file in $HOME, it is shown.

Reviewers: dfaure, #baloo, #frameworks, ngraham

Reviewed By: dfaure, #baloo, ngraham

Subscribers: ngraham, broulik, kde-frameworks-devel

Tags: #frameworks, #baloo

Differential Revision: https://phabricator.kde.org/D15635

M  +41   -2    src/kioslaves/search/kio_search.cpp
M  +6    -0    src/kioslaves/search/kio_search.h

https://commits.kde.org/baloo/95af521127c117c1aebf3a3881a86dc7422a2a11
Comment 15 Kishore 2021-09-22 07:16:52 UTC
I'm on lastest update of user neon and find the issue still present. If i perform a dolphin search with the "From Here" selected, it fails to find any file and always shows no results. If I change the search option to "Your files", it finds the file.

I find the same problem to be true from within baloosearch. When I use the -d option to baloosearch, it fails to find the same file that it found without the option.

kishore@kishore-x403:~$ baloosearch AN4065
/home/kishore/Projects/Reference/Datasheets/ST/STM32F0 Reference Manual.pdf
Elapsed: 2.35966 msecs
kishore@kishore-x403:~$ baloosearch -d /home/kishore/Projects/Reference/Datasheets/ST AN4065
Elapsed: 0.329187 msecs
kishore@kishore-x403:~$ baloosearch --version
Baloo 5.86.0
kishore@kishore-x403:~$
Comment 16 tagwerk19 2021-09-23 21:08:06 UTC
(In reply to Kishore from comment #15)
> I find the same problem to be true from within baloosearch. When I use the
> -d option to baloosearch, it fails to find the same file that it found
> without the option.
I wonder what we are doing differently, I've found what may be the same PDF:
    https://www.waveshare.com/w/upload/d/d9/STM32F0-Reference.pdf
Downloaded to:
    /home/test/Projects/Reference/Datasheets/ST/STM32F0 Reference Manual.pdf

a straightforward folder tree, no symlinks. Both the tests work:

    $ baloosearch AN4065
    /home/test/Projects/Reference/Datasheets/ST/STM32F0 Reference Manual.pdf
    Elapsed: 0,229862 msecs

    $ baloosearch -d /home/test/Projects/Reference/Datasheets/ST/ AN4065
    /home/test/Projects/Reference/Datasheets/ST/STM32F0 Reference Manual.pdf
    Elapsed: 0,24483 msecs

System is a Guest VM:

    KDE neon 5.22
    Ext4 filesystem

    Plasma: 5.22.5
    Frameworks: 5.86.0
    Qt: 5.15.3
    Kernel: 5.11.0-36-generic (64-bit)
Comment 17 jan.claussen10 2023-10-16 19:30:42 UTC
Okay, 5 years later. This bug still hasn't been fixed. I was just about to file a bug.
Comment 18 jan.claussen10 2023-10-16 19:38:13 UTC
Oh yeah, seems like it is a baloosearch bug. This still is true unfortunately

$ baloosearch alpine-pi-script
/home/jan/Downloads/alpine-pi-script
elapsed: 1,29095 msec
$ baloosearch -d Downloads alpine-pi-script
Using canonical path '/home/jan/Downloads' for 'Downloads'
eplapsed: 1,43824 msec
Comment 19 tagwerk19 2023-10-16 20:39:55 UTC
(In reply to jan.claussen10 from comment #18)
> ... still is true unfortunately ...
I've not been able to pin down an exact "as and when" it happens but there's been discussion in:
    https://bugs.kde.org/show_bug.cgi?id=474973#c22
was that you get the behaviour when you have a "doubled" $HOME entry in the
    .config/baloofilerc
see:
    https://bugsfiles.kde.org/attachment.cgi?id=162267

Maybe attach your baloofilerc?
Comment 20 jan.claussen10 2023-10-21 18:38:06 UTC
I don't seem to have a doubled entry in there it seems.

http://ix.io/4JBh

In the link you shared it says it only happens in the Downloads directory. This is not true. This maybe the case because there are not many files in there. If I search my Games folder, which is kind of large, it even segfaults. 

I am looking at the code, but I am a C++ noob and the Qt objects are a jungle to debug
Comment 21 tagwerk19 2023-10-22 08:46:55 UTC
(In reply to jan.claussen10 from comment #20)
> In the link you shared it says it only happens in the Downloads directory.
I think the focus in Bug 474973 was on the "Downloads", or "Scaricati", folder. I missed a trick not asking if the same issue was seen elsewhere :-/

> This is not true. This maybe the case because there are not many files in
> there. If I search my Games folder, which is kind of large, it even
> segfaults. 
Interesting.

There are crashes with baloo_file_extractor, it has to deal with any and all sorts of file. Once indexed though things are more stable, don't get reports from baloosearch crashing (although I know Dolphin sometimes reports the search or tags protocol has crashed). If the command line baloosearch crashes, then most likely the index has been corrupted (*)

I've tried all sorts of variations and not been able to find a way of duplicating the issue. Almost...

There is the issue when you set up a symlink to a folder, say on your desktop, pointing to your Downloads folder. When you follow that link in Dolphin and search "from there" you are looking for files in "$HOME/Desktop/Downloads" and won't find any. I include this mention for completeness, you've said it's not an issue for you.

Second, wild, possibility is you've somehow created a folder with the name "UTF-8" encoded. I don't know what might happen in this case. You say your Games folder? This is not a folder under Wine with Windows games?

> I am looking at the code, but I am a C++ noob and the Qt objects are a jungle to debug
The same for me....

*) There is a index "consistancy check" script, baloo-checkdb.py, but this is only practicable for "smaller" indexes...
Comment 22 jan.claussen10 2023-10-23 08:13:49 UTC
I have several folder symlinks in my home folder that point to Nextcloud folders.

Yes, the games folder contains some Wine games.
Comment 23 tagwerk19 2023-11-02 07:13:28 UTC
(In reply to jan.claussen10 from comment #22)
> I have several folder symlinks in my home folder that point to Nextcloud
> folders.
> 
> Yes, the games folder contains some Wine games.
Maybe related...
    https://bugs.kde.org/show_bug.cgi?id=474973#c27
At least I now have a system where I see the same issue...