haiwen / seafile

High performance file syncing and sharing, with also Markdown WYSIWYG editing, Wiki, file label and other knowledge management features.
http://seafile.com/
Other
12.25k stars 1.54k forks source link

Seafile shouldn't follow symlinks #1093

Closed Jenselme closed 8 years ago

Jenselme commented 9 years ago

Today I tried to sync a folder which contains link to itself. Seafile started using all the processor and I saw the following message in ~/.ccnet/logs/seafile.log.

[02/20/15 21:54:58] wt-monitor-linux.c(510): [wt mon] fail to stat /home/jenselme/Documents/assos/drupal/drupal7/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/mdv/phytv/agora/tvp: Too many levels of symbolic links

I think it would be better for seafile just to sync the link but don't try to follow them.

moonwalkersyrius commented 9 years ago

You can add the symlink in question to seafile-ignore.txt.

Jenselme commented 9 years ago

They are. It was working fine until some days ago: the client tried to upload the directory they were in. It reminds me of what is described in #826 and #1037 .

With this proposal, failure in the ignore mechanism would not use all the CPU and filling the disk with logs while trying to follow symlinks.

ibeardslee commented 9 years ago

See also .. https://github.com/haiwen/seafile/issues/130 https://github.com/haiwen/seafile/issues/288

But yes, seafile following the symlinks is quite broken for a number of use cases. We have some action happening to create some alternate solutions/options.

Fly0s commented 9 years ago

I can confirm that putting symlink in ignore-seafile.txt can result in Seafile still following the symlink and start syncing stuff.

For now, my fix was to remove the symlink for the synced folder.

shoeper commented 9 years ago

@Fly0s that's exactly the documented behaviour for seafile-ignore.txt

Notes The seafile-ignore.txt file only controls which files to exclude on the client side. You can still create a file from seahub web interface that's excluded on the client. In this case,

  • The created file will still be synced back to clients. But any later local changes to those files will be ignored.
  • If the file is modified on seahub, the new version will also be synced back to clients; If the file on the client is also modified, a conflict file will be generated on the client.

seafile-ignore.txt only ignores files that are not synced yet. If a file is already synced, and some time later you add it to the ignore list, its existing versions won't be removed. -> See: http://seafile.com/en/help/ignore/ (Notes)

Fly0s commented 9 years ago

Sorry, but I fail to see where symlinks are mentioned in this. Of course, I followed the instructions on this link, and made Seafile ignore the symlink as a file, not a folder.

In case this was not clear, I of course took care of the fact that the symlink was not on the server when I put it in ignore-seafile.txt. Indeed, it hasn't been synced until some time ago, where, after some activity within the symlinked folder, Seafle suddenly started to sync some files... Then I removed the symlink to avoid such a mess to happen again.

killing commented 8 years ago

Duplicate with #288