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

Ignored folders should not be indexed #2816

Open
doman18 opened this issue Aug 30, 2024 · 12 comments
Open

Ignored folders should not be indexed #2816

doman18 opened this issue Aug 30, 2024 · 12 comments

Comments

@doman18
Copy link

doman18 commented Aug 30, 2024

My seafile-ignore.txt contains *volumes/ entry which prevents synchronisation of any volumes subfolders. Those folders contain files created by docker containers, usually with root permissions. Thats why i want to ignore them. Ignoring works - these folders are not synced. Unfortunately clients seem to index them anyway because during each client start i get bunch of errors saying that /xxx/xxx/volumes/xxx/xxx cannot be indexed because of permissions or disk is full.

Ubuntu 22.04
seafile-gui 9.0.6

@feiniks
Copy link
Contributor

feiniks commented Sep 2, 2024

Hello @doman18 ,
please use volumes/* instead. You can refer to this documentation.

@doman18
Copy link
Author

doman18 commented Sep 2, 2024

@feiniks Ive seen this documentation before and i followed it (BTW it lacks info about ignoring folders in any level of folders tree). But neither documentation nor your advice helped. Currently i have

volumes/
volumes/*
*volumes/
*volumes/*

in my seafile-ignore.txt. Restarted app couple times - still the same notification/error pops up

EDIT
This case is easy to recreate. Just create somefolder/volumes/ directory. Inside of it ceate somefile.txt. Change ownership of this file to other user (in linux sudo chown root:root somefolder/volumes/somefile.txt) and restart the client

@feiniks
Copy link
Contributor

feiniks commented Sep 2, 2024

Hello @doman18, is somefolder also a directory in the library? If so, then you need to add somefolder to seafile-ignore.txt like somefolder/volumes/*. *volumns doesn't match anything.

@doman18
Copy link
Author

doman18 commented Sep 2, 2024

@feiniks
First of all *volumes/ DOES match all volumes/ folders wherever they are. For example In my case folders testy/jenkins/DOCKER/volumes or testy/docker/certbot/volumes do exist on my disk but they do not on my seafile server. As said before, these rules works well for synchronisation. They doesn't with indexing.

Secondly, if only root-dir-relative ignores were possible it would not make sense at all and was Seafiles big design flaw. If *volumes/ didn't work in all folders i would drop seafile as a solution for my problems. Think about all those temporary or hidden folders which are created by various apps. Like .vscode or .cache or *.pyc files. It would require to add every single one to seafile-ignore.txt. For example .gitignore by default refers to ANY occurence of particular element so volumes/ refers to xxx/volumes/ xxx/xxx/volumes/ etc. And root-dir-relative ignores has to be explicitly set by adding / (which means current root directory) so /volumes/ in .gitignore refers only for volumes/ not xxx/volumes/. And thats a good design. Gitignores also can be placed in subdirectories but this feature is not needed in seafile-ignore.txt as long as it allows rules for specifying occurences in any subdirectory.

@feiniks
Copy link
Contributor

feiniks commented Sep 3, 2024

Hello @doman18, currently, seafile only supports root-dir-relative ingores, but not other cases. We will consider supporting other situations in the future.

@doman18
Copy link
Author

doman18 commented Sep 3, 2024

So solution works but its not supported. Got it. This unfortunately forces me to skip Seafile and look further for synology drive replacement.

@feiniks
Copy link
Contributor

feiniks commented Sep 4, 2024

Hello @doman18, in your scenario, you can use */volumes* to match a directory like somefolder/volumes*. Seafile's globbing is similar to Linux's, but slightly simpler than Git's.

@doman18
Copy link
Author

doman18 commented Sep 4, 2024

@feiniks Man your last answer contradicts with your previous one. Are you AI bot or real person??

BTW, i have these in my seafile-ignore.txt and still doesn't work

volumes/
volumes/*
*volumes/
*volumes/*
*/volumes*

@feiniks
Copy link
Contributor

feiniks commented Sep 4, 2024

Hello @doman18,
I followed these steps for testing:
1.Synchronized a library 'Test' to the local path '/home/user/Seafile/Test'.
2.Added a 'seafile-ignore.txt' file to the 'Test' directory, including the entry /volumes.
3.Created a directory 'A' under 'Test', then created a 'volumes' directory within 'A', and added 'test.md' inside the 'volumes' directory.
4.Changed the permissions of 'test.md' to root.
5.Restarted the client.
At this point, no indexing errors occur, and neither the 'volumes' directory nor its files are uploaded to the server.

Please check if there are any differences in your steps compared to mine. If not, you can reproduce the procedure locally and paste the relevant errors from the 'seafile.log'."

@doman18
Copy link
Author

doman18 commented Sep 4, 2024

Yes i found the reason which i forgot at first. I added seafile-ignore.txt after seafile started synchronisation. Yet it did not synchronised relevant folders. I recreated this scenario with new docker instance. In your list of steps you will have to move step 2. to the end, so it becomes new step 4 (after changing permissions) and then last step 5. is the same.

@feiniks
Copy link
Contributor

feiniks commented Sep 5, 2024

Hello @doman18 ,
I also tried move the steps, but it still works fine. You can show file sync errors and confirm if the file with the indexing error is located in the 'volumes' directory.

@PranavVerma-droid
Copy link

Yep, this is definitely a bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants