stash icon indicating copy to clipboard operation
stash copied to clipboard

MacOS scan does not work, and cleaning attempts to remove entire filesystem

Open shanty-chits opened this issue 3 years ago • 4 comments

Describe the bug Recent development versions do not scan folders correctly. Logs show an error about dotfiles (even if those are excluded) and the scan does not find any new items. The Clean utility also now attempts to remove the entire root directory.

To Reproduce Steps to reproduce the behavior:

  1. Go to Tasks and select Scan

  2. New items are not found and the scan shows errors.

  3. Go to Tasks and select Clean

  4. The entire filesystem root "/" is marked for cleaning.

Screenshots Screenshot 2022-09-25 at 11 27 31 PM

Screenshot 2022-09-25 at 11 32 13 PM

Stash Version: (from Settings -> About): v0.16.1-67-g00820a87

Desktop (please complete the following information):

  • OS: MacOS 13.0
  • Browser [all]

Additional context Add any other context about the problem here.

shanty-chits avatar Sep 26 '22 03:09 shanty-chits

The Folder not in any stash library directories. Marking to clean: "/" message is expected, if a little misleading. During the schema migration process for schema 32, it creates a number of folder entries in the database, all the way up to the root directory, even for those outside the stash library. When clean is first run, it removes these superfluous folder entries because they aren't actually valid. It's not actually removing anything else, otherwise you'd see Marking to clean for all of your other contained files.

I'll amend the migration to be a little smarter so that these folders aren't created in future, but for now there's no problem here.

I will however double-check the exclusion code to see why you're getting those permission denied errors.

WithoutPants avatar Sep 27 '22 03:09 WithoutPants

As far as I can tell, those permission denied are because .Trashes is a directory. Directories will only be ignored if the path matches both the excluded video and excluded image patterns. If either do not, then the directory will be read, and if there is no read permission then you'll get those errors. Can you confirm that the .Trashes filename matches both exclusion patterns?

WithoutPants avatar Sep 28 '22 06:09 WithoutPants

Previously, my exclusions were set to ignore dotfiles according to the wiki: Screenshot 2022-09-28 at 11 04 53 PM

Setting each and every identified file and folder as individual exclusions does work, though.

shanty-chits avatar Sep 29 '22 03:09 shanty-chits

I think the extra \ character in the video patterns might be causing the issue. It's not present in the image/gallery pattern.

WithoutPants avatar Oct 05 '22 23:10 WithoutPants