Skip to content

Client just deleted local files, even though they also exist on the server #6322

Closed

Description

@sagamusix

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

Activity

  1. ogoffart commented on Jan 21, 2018

    @ogoffart
    Contributor

    Start the client with --logdebug --logfile C:\log.txt To start the client will full debug output into a file.

    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.
    Either we will see the file reaparing, or we will see in the log why the client thinks the files are not there.

  2. sagamusix commented on Jan 22, 2018

    @sagamusix
    Author

    After copying the files back to their original location, the bug didn't happen anymore, even after a enforcing a full remote discovery.

  3. guruz commented on Feb 2, 2018

    @guruz
    Contributor

    @sagamusix Which exact server version are you using?
    Can you grep your server access log for the respective path?

  4. sagamusix commented on Feb 2, 2018

    @sagamusix
    Author

    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.

  5. guruz commented on Feb 5, 2018

    @guruz
    Contributor

    @sagamusix But you don't know if in this special case the server sent something unexpected, right?
    The 503s you spoke about were on previous occasions?

  6. added this to the 2.4.1 milestone on Feb 5, 2018
  7. sagamusix commented on Feb 5, 2018

    @sagamusix
    Author

    As far as I can tell, yes, there was no direct connection between the two.

  8. sagamusix commented on Feb 5, 2018

    @sagamusix
    Author

    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.

  9. sagamusix commented on Feb 5, 2018

    @sagamusix
    Author

    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.

  10. ckamm commented on Feb 6, 2018

    @ckamm
    Contributor

    @sagamusix Can you look for the .owncloudsync.log log entry for the file that was deleted? This is pretty hard to debug without a full client log (and I realize getting one is very hard for rare problems like this) and the log entry there might at least provide some pointers.

  11. ckamm commented on Feb 6, 2018

    @ckamm
    Contributor

    I've looked at this as much as I could with the given data in #6282 but don't know what's going on.

  12. sagamusix commented on Feb 6, 2018

    @sagamusix
    Author

    @ckamm I will send you some logs via mail.

  13. ckamm commented on Feb 7, 2018

    @ckamm
    Contributor

    @sagamusix Thank you for the logs!

    Initial impressions follow:

    Setup:

    • A sync folder A, some data somewhere else called B/data
    • A/link is a directory link to B/data, so A/link/foo and B/data/foo point to the same file

    Trigger:

    • During the sync of A, link has an _invalid_ etag (unclear whether parents also had that etag)
    • Because of that it's missing in the remote tree and gets assigned a REMOVE instruction with Down direction.
    • The folder and all its contents get deleted. That means B/data/foo gets deleted.

    Bugs:

    • The recursive folder deletion follows the directory link and deletes the shared contents (note: windows!)
    • Mysterious _invalid_ etags

    Log snippet from sync run of A:

    #=#=#=# Syncrun started 2018-02-05T17:47:02Z
    #=#=#=#=# Propagation starts 2018-02-05T17:48:08Z (last step: 66717 msec, total: 66717 msec)
    #=#=#=# Syncrun finished 2018-02-05T17:48:14Z (last step: 5587 msec, total: 72305 msec)
    #=#=#=# Syncrun started 2018-02-05T17:48:27Z
    #=#=#=#=# Propagation starts 2018-02-05T17:48:53Z (last step: 25894 msec, total: 25894 msec)
    ||link|INST_REMOVE|Down|1468444962|_invalid_|0|01199898oc79c8z0bi2n|4||0|0|0||||
    #=#=#=# Syncrun finished 2018-02-05T17:49:34Z (last step: 40429 msec, total: 66323 msec)
    
  14. ckamm commented on Feb 7, 2018

    @ckamm
    Contributor

    @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 !fi.isSymLink() seems to not cut it on Windows.

  15. 20 remaining items

  16. modified the milestones: , 2.6.0 on Apr 25, 2018
  17. modified the milestones: 2.6.0, 2.5.1 on Aug 20, 2018
  18. ogoffart commented on Oct 12, 2018

    @ogoffart
    Contributor

    Is this issue still a problem?
    I guess the 2.6 new discovery does not suffer from these problem, does it?

  19. modified the milestones: 2.5.1, 2.6.0 on Oct 12, 2018
  20. sagamusix commented on Oct 12, 2018

    @sagamusix
    Author

    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?

  21. guruz commented on Oct 13, 2018

    @guruz
    Contributor

    For some reason the UI does not show the version number anymore?

    It's in the about dialog now, accessible from the tray icon.

  22. ckamm commented on Oct 17, 2018

    @ckamm
    Contributor

    Definitely reopen if you see it happen again. (also reminder to enable permanent rotating file logging!)

  23. sagamusix commented on Oct 17, 2018

    @sagamusix
    Author
  24. BigMuscle85 commented on Jul 24, 2019

    @BigMuscle85

    Today, I noticed weird behaviour similar to this one.
    Suddenly notification "Following files will be deleted..." appeared and it deleted some local files/folder although I did not touch them at all. They still exist on the server, but local copy has gone and does not resynchronize back. Sync log just contains these folders with action "Deleted".

    Client version ownCloud 2.5.4, Win10 x64.
    Deleting user data is very critical bug!

  25. sagamusix commented on Jul 24, 2019

    @sagamusix
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions