Bug 375370 - Unable to remove a folder from excludeFolders list
Summary: Unable to remove a folder from excludeFolders list
Status: RESOLVED FIXED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: balooctl (show other bugs)
Version: 5.29.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Pinak Ahuja
URL:
Keywords: junior-jobs, triaged
Depends on:
Blocks:
 
Reported: 2017-01-21 12:27 UTC by Soukyuu
Modified: 2018-10-16 16:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.51


Attachments
my baloofilerc, in case it is useful (749 bytes, text/plain)
2018-10-04 14:53 UTC, S. Christian Collins
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Soukyuu 2017-01-21 12:27:00 UTC
I have tried both the GUI and balooctl commands - the action is executed, but the folder path in question is displayed on the exclude list afterwards again. I have checked ~/.config/baloofilerc and it's not on the list. There is also no config in the old .kde4 folder.

If it matters, it's a remote path, which is currently available, however. I can also add the same path to exclude list and it appears as a redundant entry. I can also remove that redundant entry, but not the original one, even after multiple remove commands.
Comment 1 Soukyuu 2017-01-21 12:28:04 UTC
The version is 5.30.0, actually, but it's not on the dropdown list.
Comment 2 S. Christian Collins 2017-03-08 05:48:14 UTC
This happens on my system as well, with both of my mounted NTFS drives showing up on the exclude list. I am running KDE Neon 5.9.3 64-bit (Plasma Desktop 5.9.3, KDE Frameworks 5.31.0, Qt 5.7.1).
Comment 3 Nate Graham 2018-05-10 02:36:54 UTC
Can't reproduce with Frameworks 5.45. There's been a ton of work on Baloo lately, so let's call this fixed!
Comment 4 S. Christian Collins 2018-05-10 05:55:45 UTC
I'm still experiencing this bug with Frameworks 5.45, same as I reported in comment #2. I'm still using KDE Neon, now at version 5.12.5 64-bit (Plasma Desktop 5.12.5, KDE Frameworks 5.45.0, Qt 5.10.0).
Comment 5 Nate Graham 2018-05-10 18:06:34 UTC
Can you phrase the problem in terms of Steps To Reproduce? See https://community.kde.org/Get_Involved/Bug_Reporting#Steps_to_Reproduce
Comment 6 S. Christian Collins 2018-05-28 21:53:20 UTC
Here are the steps to reproduce for my system:
1. I have two NTFS partitions defined in /etc/fstab. Here are their entries:
UUID=10156E860DB794A2 /home/username/Personal ntfs-3g defaults,auto,noatime,big_writes,uid=1000,gid=1000,umask=022,windows_names,locale=en_US.utf8 0 0
UUID=0F14CDF22D70C77E /home/username/Storage ntfs-3g defaults,auto,noatime,big_writes,uid=1000,gid=1000,umask=022,windows_names,locale=en_US.utf8 0 0

This means that /home/username/Personal and /home/username/Storage are always mounted at boot.

2. When I go to "System Settings" -> "Search" -> "File Search", I see both "Personal" and "Storage" listed in the "Do not search" box. I did not put them there.

3. If I remove these two entries from the list and hit "Apply", they appear to be gone. However, if I navigate away and then back to the search settings, they are back in the list again.
Comment 7 S. Christian Collins 2018-09-08 03:05:10 UTC
Bug still present in KDE neon based on Ubuntu 18.04.1 (Plasma 5.13.5, Frameworks 5.49.0, Qt 5.11.1, Kernel 4.15.0-33-generic, 64-bit).
Comment 8 Andrew Crouthamel 2018-09-28 03:40:22 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 S. Christian Collins 2018-09-29 13:50:51 UTC
I already responded with the requested information (bug repro steps), so setting to REPORTED.
Comment 10 Nate Graham 2018-09-29 15:23:47 UTC
Yep, can reproduce. Dunno what I was smoking before.


$ cat ~/.config/baloorc 
[Basic Settings]
Indexing-Enabled=true

[General]
exclude folders[$e]=$HOME/test1,$HOME/test1-test,$HOME/test2,$HOME/test1-test/foo
first run=true
folders[$e]=$HOME,$HOME/test1-test/foo

$ balooctl config list excludeFolders
/home/dev/test1
/home/dev/test1-test
/home/dev/test2

$ balooctl config remove excludeFolders '/home/dev/test1'
Path does not exist

$ balooctl config remove excludeFolders '$HOME/test1'
Path does not exist

$ balooctl config remove excludeFolders \$HOME/test1
Path does not exist



I'm guessing this is a simple logic error that will be easy to fix.
Comment 11 Nate Graham 2018-09-29 15:35:43 UTC
I found the problem: you can't remove a folder that's currently in the include or exclude lists if it doesn't exist.If you create it, everything works:

$ mkdir ~/test1

$ balooctl config remove excludeFolders '/home/dev/test1'
[it works]


Patch coming soon.
Comment 12 Nate Graham 2018-09-29 22:54:00 UTC
Here's the patch: https://phabricator.kde.org/D15844
Comment 13 Nate Graham 2018-09-29 23:12:12 UTC
Git commit 8a0b8270dcd389db38cf3a4c20d65d46a9dda5d7 by Nathaniel Graham.
Committed on 29/09/2018 at 22:59.
Pushed by ngraham into branch 'master'.

Allow removing non-existent folders from include and exclude lists

Summary:
Currently, if you add a folder to Baloo's `includeFolders` or `excludeFolders` lists, it cannot be removed again if it has been deleted. This patch fixes that for both `balooctl` and also the KCM.
FIXED-IN: 5.51

Test Plan:
```
mkdir ~/foobar-test
balooctl config add excludeFolders ~/foobar-test
rmdir ~/foobar-test
balooctl config remove excludeFolders ~/foobar-test
```

Without the patch, `balooctl` exits with an error, reports "Path does not exist", and does not remove the entry.

With the patch, `balooctl` exits cleanly with no error and removes the path.

Works from the KCM, too.

Reviewers: #baloo, bruns

Reviewed By: #baloo, bruns

Subscribers: kde-frameworks-devel

Tags: #frameworks, #baloo

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

M  +3    -24   src/tools/balooctl/configcommand.cpp

https://commits.kde.org/baloo/8a0b8270dcd389db38cf3a4c20d65d46a9dda5d7
Comment 14 S. Christian Collins 2018-09-30 03:21:27 UTC
Interesting. In my case, the folders on the list do exist, but are considered hidden (they are both NTFS mount points).
Comment 15 Nate Graham 2018-09-30 04:39:12 UTC
(In reply to S. Christian Collins from comment #14)
> Interesting. In my case, the folders on the list do exist, but are
> considered hidden (they are both NTFS mount points).

Please run the following and include the output:

cat ~/.config/baloorc 

balooctl config list excludeFolders

balooctl config remove excludeFolders '/path/to/the/folder/you/want/to/remove/from/the/exclusions/list'
Path does not exist
Comment 16 S. Christian Collins 2018-10-02 15:01:32 UTC
(In reply to Nate Graham from comment #15)
> Please run the following and include the output:
> 
> cat ~/.config/baloorc

cat: /home/chris/.config/baloorc: No such file or directory

> balooctl config list excludeFolders

/home/chris/Personal
/home/chris/Storage

> balooctl config remove excludeFolders
> '/path/to/the/folder/you/want/to/remove/from/the/exclusions/list'
> Path does not exist

I ran the following commands:
 . balooctl config remove excludeFolders '/home/chris/Personal'
 . balooctl config remove excludeFolders '/home/chris/Storage'

Neither command gave any output. Then I ran "balooctl config list excludeFolders" again, which showed the following:

/home/chris/Personal
/home/chris/Personal
/home/chris/Storage

I noticed that the ~/.config/baloorc file now exists, and contains the following:

[General]
exclude folders[$e]=$HOME/Personal
Comment 17 Nate Graham 2018-10-02 22:53:23 UTC
Now that the rc file exists, can you again do:

balooctl config remove excludeFolders '/home/chris/Personal'

balooctl config list excludeFolders

cat ~/.config/baloorc
Comment 18 S. Christian Collins 2018-10-04 14:50:26 UTC
(In reply to Nate Graham from comment #17)
> Now that the rc file exists, can you again do:
> 
> balooctl config remove excludeFolders '/home/chris/Personal'
> 
> balooctl config list excludeFolders
> 
> cat ~/.config/baloorc

When I start off, there is no "baloorc" in ~/.config, but there is "baloofileinformationrc" and "baloofilerc". Neither file has any lines pertaining to the "/home/chris/Personal" or "/home/chris/Storage" folders, yet both locations are listed when running "balooctl config list excludeFolders".

When I run "balooctl config remove excludeFolders '/home/chris/Personal'", two things happen:
1. "baloorc" is created containing "exclude folders[$e]=$HOME/Storage" under "[General]"
2. "baloofilerc" is updated adding "exclude folders[$e]=$HOME/Storage" under "[General]"

Running "balooctl config list excludeFolders" now shows:
/home/chris/Personal
/home/chris/Storage
/home/chris/Storage

If I run "balooctl config remove excludeFolders '/home/chris/Personal'" a second time, both "baloorc" and "baloofilerc" now show "exclude folders[$e]=$HOME/Storage,$HOME/Storage"

Running "balooctl config list excludeFolders" now shows:
/home/chris/Personal
/home/chris/Storage
/home/chris/Storage
/home/chris/Storage

If I now run "balooctl config remove excludeFolders '/home/chris/Storage'", both "baloorc" and "baloofilerc" now show "exclude folders[$e]=$HOME/Personal"
Comment 19 S. Christian Collins 2018-10-04 14:53:30 UTC
Created attachment 115412 [details]
my baloofilerc, in case it is useful
Comment 20 Nate Graham 2018-10-04 17:27:42 UTC
Thanks for the investigation. Since this bug already fixed one issue, could you file a new bug to track the one you're describing right now? Thanks!
Comment 21 S. Christian Collins 2018-10-16 16:29:01 UTC
Done: https://bugs.kde.org/show_bug.cgi?id=399885