Skip to content

client 1.4 unnecessarily downloads again those files which are already downloaded #994

Closed

Description

@jochenwezel

A user shared with me a folder with about 10 10 GB data (approx. 200 files).

I don't know why, but it's often (not always) finding some new files. Download follows - but unnecessarily: files are absolutely identical (byte comparison); the file on server hasn't been touched for months. So the file hasn't changed.

Following suggestions:

  1. Finding and fixing the reason why the client trys to re-download equal files which hasn't been changed/updated in any way
  2. Before downloading files: download a hash of the file from server for that file + check if hash can be found in local journal database + if yes: copy the file locally

Local client: 1.4.0 on Win2008 R2 server (and other win systems, too)
Server version: 4.5.7 on Linux

Activity

  1. torbennehmer commented on Sep 13, 2013

    @torbennehmer

    I can confirm this issue against Server 5.0.10.

  2. torbennehmer commented on Sep 13, 2013

    @torbennehmer

    Please let me know what information I can give you to further track down this error. I am seeing this regularily on my install.

  3. jochenwezel commented on Sep 13, 2013

    @jochenwezel
    Author

    maybe related: #110

  4. jochenwezel commented on Sep 13, 2013

    @jochenwezel
    Author

    this bug is critical to me since lot of traffic happens due to this issue (>30 GB per month!)
    my last ISP already kicked me a few weeks ago because I had too much traffic with my internet flat rate. I don't want to retry this procedure again... ;-)

  5. RandolfCarter commented on Sep 13, 2013

    @RandolfCarter

    Might be related: I just noticed that my client also decided now to re-download everything (in the menu opening up when clicking on the "tray" icon in my ubuntu 13.04, it wrote "downloading file .. of .., xx of yy MB or something like that - and showing all the 950MB of the one synced folder, so it seems to just re-download everything!) - no idea why, there were no big changes to files recently, no server upgrade (still running 5.0.10), no client upgrade (apart from 1.4, but that was last week already or so and the client has run multiple times since then already).

    So I really have no clue at all why the client is redownloading anything. Any logfile I could check (I heard the client now also produces a logfile if not explicitly started with the logging option)? I guess its also no option to restart I the client, not sure if he will exhibit the same behavior, but I will try...

    Edit: Restarted the client with logwindow option, and the sync continued to download files I think (at least the Recent changes show something like that). Can provide the logfile on request (don't like to post it publicly with all the document references).

    Is it maybe now a good time to think again about introducing proper file checksums instead of the random tags?
    What was again the argument against using it? High CPU usage? If it can prevent issues such as this, where unmodified files are downloaded multiple times, this argument doesn't hold. Calculating a checksum once can't possibly cost more CPU performance than re-downloading the same things multiple times (and if the argument is for the server side, then the re-downloading possibilities can even be multiplied with more clients!)

  6. dragotin commented on Sep 14, 2013

    @dragotin
    Contributor

    Please everybody, can you please post me the result of the following SQL-Statements run on server database:

    select count(*) from oc_filecache where etag = '';
    select count(*) from oc_filecache;
    

    @RandolfCarter pls. send the full, zipped logfile to freitag at owncloud.com, thanks.

  7. torbennehmer commented on Sep 14, 2013

    @torbennehmer

    37 without etag, 7790 with.

    The 37 are all files within zip files (.../file.zip/...) plus a directory. These are not the files I observed to be redownloaded.

  8. nileshgr commented on Sep 15, 2013

    @nileshgr

    The client seems to do repeated uploading too. Is this related? Same server version, same client version. OS - Gentoo both side. PHP 5.5, Apache 2.4, MariaDB 5.5.

  9. torbennehmer commented on Sep 15, 2013

    @torbennehmer

    An update, I just added another computer to a folder, which is already synced at a two other hosts. As expected, the new system integrated itself fine. The new system used a blank directory to start its work from.

    However, one of the two other systems started to download approximaltely 85% of the files (2.700 files, 1.1 GB) after I booted the system about half an hour later. None of the files have been changed, since the download on the new system.

    I have launched a log window during synchronisation, the general pattern seems to be like this:

    09-15 15:25:22:087 oc_module: => open called for ownclouds://loremipsum/remote.php/webdav/Documents/file.txt
    09-15 15:25:22:087 oc_module: GET request on /remote.php/webdav/Documents/file.txt
    09-15 15:25:22:087 oc_module: Sendfile handling request type GET. fd 3
    09-15 15:25:22:087 oc_module: -- GET on ownclouds://loremipsum/remote.php/webdav/Documents/file.txt
    09-15 15:25:22:204 oc_module: Content encoding ist with status 200
    09-15 15:25:22:212 oc_module: GET http result 200 (OK)
    09-15 15:25:22:212 oc_module: http request all cool, result code 200
    09-15 15:25:22:212 oc_module: ** Finished download ownclouds://loremipsum/remote.php/webdav/Documents/file.txt
    09-15 15:25:22:219 oc_module: Get file ID for ownclouds://loremipsum/remote.php/webdav/Documents/file.txt: 5235b0ddf2dd5
    09-15 15:25:22:219 _get_md5: MD5 for ownclouds://loremipsum/remote.php/webdav/Documents/file.txt: 5235b0ddf2dd5
    09-15 15:25:22:219 _csync_push_file: FINAL MD5: 5235b0ddf2dd5
    09-15 15:25:22:219 _csync_push_file: PUSHED file: C:\Users\loremipsum\Documents\Documents/file.txt

    If you want the full log untli the end of the sync, please let me know, I have saved it. However, I did not catch the start of the sync. If that is neccessary, please let me know, then I'll change my client systems to permanent logging. As well, if you want to take a peek into the server logs (both oc internal and Apache access log), I have them available for inspection. Just drop me a mail to torbennehmernet.

  10. torbennehmer commented on Sep 15, 2013

    @torbennehmer

    While trying to investigate #1003, I again got addidional downloads. What I did (Win 7/64 Pro, Client 1.4):

    1. Create a folder ("New Folder", which got renamed to "GCA Data Sets", see Client 1.4, Windows: Creating a folder and dropping a file in it afterwards doesn't sync cleanly #1003 for troulbes)
    2. Copied a few files into it from another folder within the same sync directory.
    3. Did this twice.
    4. After the rename I did in Client 1.4, Windows: Creating a folder and dropping a file in it afterwards doesn't sync cleanly #1003, it synchronized the complete folder which contained a few of the files I synced.

    I used Windows Explorer for this.

    I'll change my clients now so that they continously create log files. Maybe this gives us some insights.

    Are the server logs helpful here, or are the client logs sufficient?

  11. torbennehmer commented on Sep 15, 2013

    @torbennehmer

    What i had just now:

    Several log messages around "stat failed for /var/www/clients/client1/web27/private/somefile" (Why can't I just copy/past from the log view in the web, this is really irritating...)

    At least right now the file in question exists and has the correct permission set.

    Again, after a client restart, I got a few dozen files downloaded again without reason. I have zipped together the logs of the individual sync runs the client made, the oc server log and the oc apache access log. Please mail me at torbennehmernet for the password:

    http://s.nehmer.net/eSxI6oR2rC

    Note, that this is reproducible her. The number of files getting downloaded again and again is increasing (right now he sucks down 629 files wtih 200 MB needlessly).

  12. torbennehmer commented on Sep 15, 2013

    @torbennehmer

    Another thing to look out, unsure if this is related: Right now I realized (by coincidence) that I had two owncloud.exe instances running (one of it did not show a tray icon, otherwise I'd have noticed it earlier). I cannot say for sure, if this influences things. If it does, you might want to include a check to avoid duplicate program launches.

  13. danimo commented on Sep 15, 2013

    @danimo
    Contributor

    @torbennehmer We already have a check for double instances. If another instance was running, it did not respond and thus was dead anyway.

  14. torbennehmer commented on Sep 15, 2013

    @torbennehmer

    @danimo: That check is buggy, see #1004, it is easily possible to launche two instances in case you have different command line. I am unsure how long the multiple instances were running here, though I am fairly certain that most of the problems I experienced were before the second instance came up.

  15. jochenwezel commented on Sep 16, 2013

    @jochenwezel
    Author

    @dragotin Executing your SQL statement doesn't work for me since I use older server version 4.5.7
    table oc_filecache doesn't exist
    if I use table oc_fscache, column etag doesn't exist
    Please advise what I can do for you to get information as needed.

  16. 177 remaining items

  17. dragotin commented on Feb 11, 2014

    @dragotin
    Contributor

    @fragtion can you provide a log file snippet about the files in question, both client- and server access log?

  18. dschmidthawk commented on Feb 11, 2014

    @dschmidthawk

    I'm using a linux server through BlueHost. no external anything.

  19. fragtion commented on Feb 11, 2014

    @fragtion

    Ok I've saved a log of it happening from one of the clients. It's 2.5MB uncompressed, so I couldn't pastebin it, rather a direct link to my server - http://197.242.147.241/owncloud-logs.zip . The server instance's log is really tiny - I hope I'm searching the right file. Does the server need to be running in a debug mode as well?

  20. fragtion commented on Feb 15, 2014

    @fragtion

    Acknowledgement? I suppose this hasn't been identified and resolved yet in v1.5.1 client? Is it more likely a client issue?

  21. dschmidthawk commented on Feb 15, 2014

    @dschmidthawk

    I can attest to the fact that it isn't corrected for me in the latest version: 1.5.1 (build 2337)

  22. inducer commented on Dec 25, 2014

    @inducer

    Not fixed for me either.

  23. obma commented on Dec 29, 2014

    @obma

    Reoccurred for me too.

    Server: 7.0.4 (stable) - Ubuntu package
    Client: 1.7.1- Arch Linux AUR

  24. seiferflo commented on Feb 3, 2015

    @seiferflo

    Hi,
    Same problem for me. Random files being downloaded to the client for no reason as the file is already there in both places and hasn't changed. The new file on the client has a new "date created" which is problematic for me as I use this metadata a lot. Sometime we're talking about thousands of files.
    If I close the client, open it back, same, it goes on and on.
    If I now close again and remove the .csync_journal.db, then I get only a dozens of files downloaded and these files are named with an *_conflict
    After that, it works great. Basically I'm just deleting each db everytime I close owncloud to avoid having this issue again. Weird but couldn't find another workaround.

    I don't really understand much as I'm not a skilled user, but if you need anything from me, just let me know.

    Server: 7.3.5 (Synommunity package)
    Client: 1.7.1 b4382 windows 8.1

  25. inducer commented on Feb 3, 2015

    @inducer

    FWIW, I rebuilt the cache and resynchronized the server clock, and the issue hasn't reoccurred since.

  26. seiferflo commented on Feb 3, 2015

    @seiferflo

    @inducer Hey. I just resumed another folder and it happened again, quite annoying. I've got 3 machines to sync with this afterwards and It scares me now.
    I've put windows & synology on the same time server to get the same clock. I restarted everything, remove the db and the problem is still there. When you're saying rebuild the cache, is there any other method than deleting the db? Thanks

  27. AiYoriAoshi commented on Feb 14, 2015

    @AiYoriAoshi

    I have the following setup:
    C:\ and E:\ Partition on SSD, not synced by owncloud
    D:\ RAID5 Partition on Raidcontroller with 3x1.5TB drives completely synced with owncloud

    A few days ago I re-installed my windows while the raid controller was not plugged in so no data is touched on the owncloud partition. After the installation I plugged in the raid and then I installed the owncloud client and set it up with my server. Now the client says some 105GB need to be synced and started downloading them from the server. The files it downloaded so far all exist on the disk and have not been touched in years.

    I have no idea which files it actually want's to sync and why. I checked and the time on server and client are perfectly sync.

    Server: 8.0 (just upgraded from 7.0.2 to see if it makes a difference, nope)
    Client: 1.7.1 build 4382 Windows 7

  28. karlitschek commented on Feb 14, 2015

    @karlitschek

    It seems that ownCloud detected your files as changes. This can be cause by a changes timestamp of the files or the mountpoint.

  29. RandolfCarter commented on Feb 19, 2015

    @RandolfCarter

    Just happened again to me after upgrading to OC 8.0. Could this be related to owncloud/core#13980 ? I did have to fiddle around in the storage table to get the upgrade working, not sure if I removed the correct entries there...

  30. seiferflo commented on May 4, 2015

    @seiferflo

    And again...
    Turned on my Synology after a while with ownCloud 8.0.3. I started windows client 1.8.0, resume my usual folder and it downloads useless stuff that hasn't changed again.
    On top of that All files are "Downloaded, renamed conflicting file".

    Both machines are clocked on the same time.nist.gov server.
    I even tried with the 1.8.1RC2 and deleted all temp files from my folders.

    I don't understand and I'm having this problem since I'm using ownCloud 7 and client 1.7.1 everytime.
    Same behaviour, it starts by downloading files, 1 to 200 sometimes, then it stops downloading and just upload if any. If nothing to upload, it stops and moves to other folder. Same behaviour for that folder too.
    If I keep the client & server on all the times, it will not download again.
    But I turn both off for a bit, to save electricity I guess, then all folders will download a few files.

    Why ownCloud detect the files as changed when they are not? I'm sure of that because I sync the folders on my external HDD using size & time change.
    Have you solved this issue yet? Thanks for your feedback.

  31. PVince81 commented on May 11, 2015

    @PVince81

    @seiferflo it is still not clear why the files are being redownloaded.
    What you could try is the following:

    1. Wait for the sync client to be stable (no download) like when you keep it on for a long time.
    2. Shut down the web server to prevent further access
    3. Check the oc_filecache table in the database, maybe save the listing of some of the files. Goal is to find out their "etag", "mtime" and "storage_mtime" columns.
    4. Check the files in the "data" directory and see what mtime they have, save the listing in a file.
    5. Stop the sync client
    6. Reboot the Synology
    7. Let the web server start (but not the sync client).
    8. Check the "data" folder and verify that the mtimes are still the same
    9. Check the database again and compare the "etag", "mtime" and "storage_mtime" columns with what you saw before (for a few select files)
    10. Start the sync client, stop it after a while (hopefully it will not upload anything yet)
    11. Check the database again like at step 9

    Goal is to find out if anything causes the "etag" or "mtime" fields to change in the database or filesystem after the Synology reboot.

    You might also want to try disabling cron jobs and see if it solves the issue. (if yes, the cron job might be a clue).

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions