Skip to content

Inconsistency between filesystem and database - unable to resolve / repair #440

Closed

Description

@msrex

4.5.2: If you copy a file into the ownCloud or it is modified in anyway in the filesystem, there is no way to trigger a "correction run" or "repair fs cache" run. This leads to very unexpected behaviour.
It is clear that you are not supposed to change anything directly in the FS, but if for some reason there is a difference, a method is needed to get the filecache back in sync.

Activity

  1. RandolfCarter commented on Nov 15, 2012

    @RandolfCarter
    Contributor

    This is not specific to 4.5.2 as far as I can tell, it's been the same in all 4.0.x and 4.5.x releases.

    There is a way to scan the existing directories, however: use "Rescan" app, or execute "scanFiles" javascript function in Files view.

  2. karlitschek commented on Nov 15, 2012

    @karlitschek
    Contributor

    Yes. But we also have to find out What brings the filesystem and the database out of sync. Because the solution for the user is not to run a fix script all the time. So bug reports about ways to bring the database out of sync are helpful.

  3. MTRichards commented on Dec 6, 2012

    @MTRichards
    Contributor

    I am running into this problem with users too because people keep copying large sets of files into the fileserver. If they sync, it would take them a week. Copying it manually, it takes a few hours. So, while it is important to not get the two out of sync, there is no question people will still touch the filesystem and things will get out of sync...

  4. msrex commented on Dec 8, 2012

    @msrex
    Author
  5. boxrick commented on Dec 10, 2012

    @boxrick

    So if this was working in version 3 and previous to that. How did that particular version keep things in sync differently than 4?

  6. msrex commented on Dec 10, 2012

    @msrex
    Author

    I ran into numerous more cases when testing external mounts where an official way to update the fs_cache is required. Can we please create one, instead of telling people to open the javascipt console?

    Especially the case of Matt is really more common than one might think.

  7. MTRichards commented on Dec 11, 2012

    @MTRichards
    Contributor

    In the same light of this bug, one from bugzilla: manual "scanFiles()" on javascript-console doesnt update folder-sizes

    http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-2112

    Seems there may be a bug in scanFiles(true)

    Description:
    After syncing my files per samba/Robocopy, I had to clear my fscache (parent=-1 bug) and rescan the filesystem by calling scanFiles() from a javascript console.

    All files where displayed correctly now in webinterface, but every folder had the size of only the contained files, not including the contained subfolders (so a folder with only subfolders was shown with 0 bytes).

    Problem: lib/filecache.php - function increaseSize() calls self::getParentId with $path, not regarding the needed fullpath

    Works fine for me (not sure how this whole github-thingy works, so I just post it here):
    348 while($id!=-1 && strlen($path) > 0) {//walk up the filetree increasing the size of all parent folders
    (...)
    351 $path=dirname($path);
    352 $id=self::getId($path,$root);

    instead of

    348 while($id!=-1) {//walk up the filetree increasing the size of all parent folders
    (...)
    351 $id=self::getParentId($path);
    352 $path=dirname($path);
    if the strlen isnt checked, the routine wont stop trying to get the parent of "empty string"...I wasn't able to find out why id!=-1 wasnt enough.

    Still a problem: scanFiles() for a specific folder: each call increases the size of parent-folders of the folder to scan.

    example:

    foo 300MB
    foo/foo 150MB
    foo/bar 150MB

    will be after scanFiles(true,'foo/bar');

    foo 450MB
    foo/foo 150MB
    foo/bar 150MB

    Reproduction steps:
    clear fscache in your database
    rescan by javascript scanFiles(true)
    folder-sizes arent updated recursivly (so a folder containing only folders, and no files, will be 0 bytes)

  8. bartv2 commented on Apr 6, 2013

    @bartv2
    Contributor

    can you check with the 5.0.3? the file cache is rewritten in OC5

  9. jancborchardt commented on Aug 5, 2013

    @jancborchardt
    Contributor

    I’m closing this issue because it has been inactive for a few months. This probably means it’s not reproducible or it has been fixed in a newer version.

    Please reopen if the error still persists with the latest stable version (currently ownCloud 5.0.9) and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)

    Thank you!

  10. MTRichards commented on Aug 5, 2013

    @MTRichards
    Contributor

    The problem still exists...when you get inconsistencies between the filecache and the filesystem, it is very difficult to sort it out and fix them. This happens when you have the inconsistencies and migrate to a new version of ownCloud.

    It is a fall back, of course, and a fail safe maneuver. But admins need to be able to provide this for a specific user, if something goes sideways (an often requested feature).

  11. DeepDiver1975 commented on Aug 5, 2013

    @DeepDiver1975
    Contributor

    we have a console script now in master (and soon in stable5 - planned to be shipped with 5.0.10) which allows admins to rescan the filesystem for a given user.

  12. DeepDiver1975 commented on Aug 5, 2013

    @DeepDiver1975
    Contributor
  13. MTRichards commented on Aug 5, 2013

    @MTRichards
    Contributor

    I like it!! :)

  14. MTRichards commented on Aug 5, 2013

    @MTRichards
    Contributor

    Any documentation we can get our hands on to play with?

  15. DeepDiver1975 commented on Aug 5, 2013

    @DeepDiver1975
    Contributor

    Any documentation we can get our hands on to play with?

    we need to extend out docs accordingly ...

    How it will work:

    • open a terminal
    • cd into the ownCloud installation folder
    • run 'occ files:scan ' or 'occ files:scan --all'

    occ is 'ownCloud console' 😉

  16. MTRichards commented on Aug 5, 2013

    @MTRichards
    Contributor

    Cool - so what happens if this user hits the server with 3 sync clients while we are scanning again?

    Does it put this account in maintenance mode, or... will the sync client delete all of the files thinking that they are removed?

  17. DeepDiver1975 commented on Aug 5, 2013

    @DeepDiver1975
    Contributor

    afaik these processes (console rescan and sync client) can operate in parallel without causing issues on each other.

    @icewind1991 am I right?

  18. JacekZ commented on Aug 7, 2013

    @JacekZ

    For testing purpose, I used 'occ files_scan login'. The result is that, owncloud sync-client repeatedly starts to download my whole files. When it's done, it starts again download the same files, and again and again...... :(((
    OC. 5.0.10RC1, client 1.3.8.

    What's the right behavior after scanning files system?? Should sync-client download once all files??

    Errata#1: After installing client 1.3 everything went back to normal - almost (all files are downloaded once, after execution of "occ files:scan")

  19. DeepDiver1975 commented on Aug 7, 2013

    @DeepDiver1975
    Contributor

    @JacekZ hmm - looks like the etag of the files is lost/recreated - I'll have a look. Thanks for reporting

  20. JacekZ commented on Aug 7, 2013

    @JacekZ

    Yes, that's truth. New (different) etag is recreated by execution of 'occ file_scan.'

  21. DeepDiver1975 commented on Aug 7, 2013

    @DeepDiver1975
    Contributor

    @icewind1991 any idea why the etag changes? within OC\Files\Utils\Scanner scan() is called wih the option REUSE_ETAG - THX

  22. icewind1991 commented on Aug 7, 2013

    @icewind1991
    Contributor

    I'll look into the reusing a bit more

  23. DeepDiver1975 commented on Aug 7, 2013

    @DeepDiver1975
    Contributor
  24. a-schild commented on Aug 12, 2013

    @a-schild

    Seems to be a critical problem for the desktop client 1.4.0beta1, since it uses the etag to detect sync need

  25. DeepDiver1975 commented on Aug 12, 2013

    @DeepDiver1975
    Contributor

    @icewind1991 any news? THX

  26. locked as resolved and limited conversation to collaborators on Aug 16, 2019
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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions