Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import: Syncthing's .stignore is deleted on import #1348

Closed
HaroldDLeon opened this issue Jun 3, 2021 · 10 comments
Closed

Import: Syncthing's .stignore is deleted on import #1348

HaroldDLeon opened this issue Jun 3, 2021 · 10 comments
Assignees
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release

Comments

@HaroldDLeon
Copy link

Follow-up discussion from #1319 :

When importing, Photoprism will delete the .stignore file from the folder, even if it's included on .ppignore.

@AudunVN
Copy link
Sponsor

AudunVN commented Jun 3, 2021

Can reproduce this on build 210523-b1856b9d, looks like dotfiles (besides .ppignore) are quietly deleted even if included in .ppignore. Below is a copy of the log from an import where the files phone/.stignore, laptop/.stignore, drive/.stignore and desktop/.stignore were deleted.

2021-06-03 22:00:26 INFO Import completed in 7 s
2021-06-03 22:00:19 INFO import: ignored "phone/folder.ico"
2021-06-03 22:00:19 INFO import: ignored "phone/desktop.ini"
2021-06-03 22:00:19 INFO import: ignored "phone/OpenCamera/ppkeep"
2021-06-03 22:00:19 INFO import: ignored "phone/100ANDRO/ppkeep"
2021-06-03 22:00:19 INFO import: ignored "laptop/folder.ico"
2021-06-03 22:00:19 INFO import: ignored "laptop/desktop.ini"
2021-06-03 22:00:19 INFO import: ignored "drive/folder.ico"
2021-06-03 22:00:19 INFO import: ignored "drive/desktop.ini"
2021-06-03 22:00:19 INFO import: ignored "desktop/folder.ico"
2021-06-03 22:00:19 INFO import: ignored "desktop/desktop.ini"
2021-06-03 22:00:19 INFO Moving files from import

My .ppignore files contain

# ignore syncthing folders and files
.stfolder
.stversions
.stignore

# ignore folder metadata
desktop.ini
folder.ico

# others
ppkeep

and seem to be working fine except for .stignore being deleted.

In my case I have .stignore configured precisely since I don't want the ignored desktop.ini and folder.ico files mentioned in the import log to be there in the first place, as they're not much use on the headless Linux-based server I'm running Photoprism on.

@alexislefebvre
Copy link
Contributor

I think .ppignore is only used when indexing directories, not importing them. Maybe this part of the doc should be updated: https://docs.photoprism.org/user-guide/library/indexing/#ignoring-directories-and-files

@lastzero
Copy link
Member

lastzero commented Jun 4, 2021

Should also work in import, maybe it's on the wrong directory level. If you import from a sub folder, the patent folders might not be checked. Can also be a bug, didn't have time to look at this in detail.

@AudunVN
Copy link
Sponsor

AudunVN commented Jun 4, 2021

I think .ppignore not having an effect may not be the most important thing here. Dotfiles (and/or hidden files) being quietly deleted would come as a surprise after reading the documentation, as one of the listed advantages of importing instead of indexing is

Unsupported files stay untouched in the import directory

which would likely make users expect that the unsupported file .stignore shouldn't be affected at all, regardless of whether a .ppignore file is set up. Not sure if this is a documentation or code issue, though.

PS: Thank you very much for all the help! 😀 Sorry for the Syncthing-related issues recently, even if I'm slightly glad it's not just me that's using Photoprism and (breaking) Syncthing in weird ways.

@lastzero
Copy link
Member

lastzero commented Jun 4, 2021

You're welcome to add a note to our docs. Most modern operating systems use hidden files to store folder metadata, so in practice deleting empty folder would never work and would likewise lead to complaints, and bug reports.

@AudunVN
Copy link
Sponsor

AudunVN commented Jun 4, 2021

Yep, I very much understand - would be a bit confusing if seemingly empty folders were left behind on import if the user doesn't know about or can't see the hidden files. .ppignore not working as expected is indeed the main concern here, then, since deleting hidden files is the intended behaviour. I'll see if I can add a note to the docs about all hidden files being deleted on import.

@HaroldDLeon
Copy link
Author

Should also work in import, maybe it's on the wrong directory level. If you import from a sub folder, the patent folders might not be checked. Can also be a bug, didn't have time to look at this in detail.

My folder structure looks like this:

Imports/
├─ DCIM/
│  ├─ .ppignore
│  ├─ .stignore
│  ├─ .stfolder/
│  ├─ .stversions/
├─ .ppignore
├─ .stignore

With .ppignore having only one line, which is ignored:

.stignore

Also tested adding other dotfiles to the folder and to .ppignore, but they were also deleted on Import.

@lastzero
Copy link
Member

lastzero commented Jun 4, 2021

Did you try DCIM/.stignore?

@HaroldDLeon
Copy link
Author

Yes. On import, the folder structure from above comment would change to:

Imports/
├─ DCIM/
│  ├─ .ppignore
│  ├─ .stfolder/
│  ├─ .stversions/
├─ .ppignore

@lastzero
Copy link
Member

lastzero commented Jun 4, 2021

We can have a look after our vacation, in about two weeks. It's probably easy to fix.

@lastzero lastzero self-assigned this Jun 8, 2021
@lastzero lastzero added the enhancement Refactoring, improvement or maintenance task label Jun 8, 2021
@lastzero lastzero added the please-test Ready for acceptance test label Jul 16, 2021
@graciousgrey graciousgrey added released Available in the stable release and removed please-test Ready for acceptance test labels Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Refactoring, improvement or maintenance task released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

5 participants