-
Notifications
You must be signed in to change notification settings - Fork 669
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
Client just deleted local files, even though they also exist on the server #6322
Comments
Start the client with Select the folder in the settings dialog and press the secret "Ctrl+F6" shortcut which will redo a sync with full remote discovery. Does the deleted file re-appear? Go in the log and search for filename of files that are deleted and send us the lines around that. My suspission is that the server did not report the files for some reason, doing CTRL+F6 should force the client to read everything again from the server. |
After copying the files back to their original location, the bug didn't happen anymore, even after a enforcing a full remote discovery. |
@sagamusix Which exact server version are you using? |
10.0.4, but probably 10.0.3 at that time. I have pruned my logs since they grew to more than 6GB, so I'm afraid they are gone now. |
@sagamusix But you don't know if in this special case the server sent something unexpected, right? |
As far as I can tell, yes, there was no direct connection between the two. |
Coincidentally, this just happened again today. This time, it was even worse, though, because it deleted a hardlink (which it would normally not touch at all), and apparently, as a consequence, even deleted the contents of the linked-to folder. I cannot imagine how that is even possible. |
I'd be much less frustrated now if ownCloud at least (optionally) uses the recycle bin to delete local files. I do have other backups, but the recycle bin would be just much more convenient, in particular since I use ownCloud with a single client and in theory the server should never delete files for me. |
@sagamusix Can you look for the |
I've looked at this as much as I could with the given data in #6282 but don't know what's going on. |
@ckamm I will send you some logs via mail. |
@sagamusix Thank you for the logs! Initial impressions follow: Setup:
Trigger:
Bugs:
Log snippet from sync run of A:
|
@sagamusix I've looked at documentation and apparently you can only have hardlinks for files. Is this a symbolic link or a junction? Both should be detectable by looking for reparse points - our current check of |
Looking at Qt, I see https://bugreports.qt.io/browse/QTBUG-45344 and that https://codereview.qt-project.org/#/c/113019/ was abandoned. So |
QFileInfo::isSymLink() does detect reparse points that are symlinks but returns false for junctions. The new function FileSystem::isJunction() can detect those and is used to not recursively delete files inside directories that are junctions.
In my tests I was unable to reproduce the concrete situation. The discovery correctly detects the junction and refuses to sync it (like other symlink-like things). Deleting the parent directory on the remote didn't lead to a local deletion. However the PR #6349 nevertheless makes the recursive-deletion code safer by worrying about junctions. |
I don't remember exactly if it was a symbolic link or junction, but my best guess would be that it was a symbolic link. After I re-created them, they get ignored again, as it happened in the past. |
@sagamusix Yes, both symbolic links and junctions should be ignored. The contents behind a symbolic link should never be deleted, and with the upcoming patch the contents behind junctions will be safe too. |
QFileInfo::isSymLink() does detect reparse points that are symlinks but returns false for junctions. The new function FileSystem::isJunction() can detect those and is used to not recursively delete files inside directories that are junctions. See also https://bugreports.qt.io/browse/QTBUG-45344 and the discussion in the PR https://codereview.qt-project.org/#/c/113019/.
QFileInfo::isSymLink() does detect reparse points that are symlinks but returns false for junctions. The new function FileSystem::isJunction() can detect those and is used to not recursively delete files inside directories that are junctions. See also https://bugreports.qt.io/browse/QTBUG-45344 and the discussion in the PR https://codereview.qt-project.org/#/c/113019/.
Paths can contain the wildcards % and _ and that would lead to odd behavior. This patch also clarifies the behavior of avoidReadFromDbOnNextSync() which previously dependend on whether "foo/bar" or "foo/bar/" was passed as input. Possibly affects #6322
Paths can contain the wildcards % and _ and that would lead to odd behavior. This patch also clarifies the behavior of avoidReadFromDbOnNextSync() which previously dependend on whether "foo/bar" or "foo/bar/" was passed as input. Possibly affects #6322
There've been some fixes for 2.4.1 that might have addressed the problem. Since we couldn't reproduce we don't know for sure. The patch to never delete files behind junctions also went into 2.4.1. |
@ogoffart How about we add a safety-fixup check, where we find all |
This can happen if the file/folder is deleted on the server. but the deletion of the file did not work because it was still in use (or had a ignored file) |
Other cases:
|
Moving to 2.4.2 |
@ogoffart I think we should disentangle the two use cases of
If we did this, we could validate whether there are any invariant-breaking markers occasionally and thereby avoid problems like the one that popped up here. |
We don't know the concrete issue and mitigations won't be in time for 2.5.0, changing milestone |
Is this issue still a problem? |
I don't think I have recently experienced this specific issue. I have been on 2.5 for a while now - I believe. For some reason the UI does not show the version number anymore? |
It's in the about dialog now, accessible from the tray icon. |
Definitely reopen if you see it happen again. (also reminder to enable permanent rotating file logging!) |
Yup, I have that enabled now, but back when I captured the log this
option didn't exist. :)
|
Today, I noticed weird behaviour similar to this one. Client version ownCloud 2.5.4, Win10 x64. |
Since it's unlikely that this has something to do with the bug that I
was experiencing over a year ago, can you please create a separate issue
and provide as much information there as possible?
|
Expected behaviour
The client should never delete files for no good reason.
Actual behaviour
I had a tough time synchronizing big ownCloud folders (which is already being discussed e.g. in #5017), often resulting in 503s and timeouts during the sync and thus restarting the sync process.
After some days the folder was mostly synchornized at last, as I could observe on the web interface.
However, all of a sudden the client decided that it should delete the local folder, even though it was still present on the server as well! I got a message telling me that there is a big folder that won't be synchronized by default, I chose to synchronize everything but by that time the local files were already gone...
Steps to reproduce
I'm not really sure.
Client configuration
Client version: Version 2.5.0-nightly20180110 (build 8967).
Operating system: Windows 7 x64
OS language: German
Installation path of client: Default
The text was updated successfully, but these errors were encountered: