Skip to content

unjustified download of a big file just after being uploaded #1425

Closed

Description

@moscicki

Hello,

I have created a file (VERY-BIG.3GB) with dd inside the sync folder:

$ dd if=/dev/zero of=VERY-BIG.3GB bs=10M count=300
300+0 records in
300+0 records out
3145728000 bytes (3.1 GB) copied, 49.6872 s, 63.3 MB/s

The sync client started uploading while the file was being modified (looking at the behaviour of the progress bar I think it may have restarted the upload while the file was being created).

Eventually the file was uploaded ok.

But then it was downloaded twice for no reason.

I repeated the test with another file (MEGA-BIG.3GB) and this time it worked fine.

client-screenshot

Is it possible to tell from this log if this is a race-condition in the client or a hickup with server's etags?

I notice a presence of a temporary file VERY-BIG.3GB.~1c69fb81

Here is the grep of VERY-BIG.3GB from the relevant client logs:

https://gist.github.com/moscicki/9002908

Activity

  1. moscicki commented on Feb 14, 2014

    @moscicki
    ContributorAuthor

    Client: 1.5.1-rc1 on redhat6

  2. ogoffart commented on Feb 15, 2014

    @ogoffart
    Contributor

    After the first upload, we save an empty etag to the datavase (md5 field)

    /home/moscicki/owncloud.log.d-testbox._usertest001/owncloud.log.927:02-14 15:49:49:702 "INSERT OR REPLACE INTO metadata (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid) VAL
    UES ( ? , ?, ? , ? , ? , ? , ?,  ? , ? , ?, ? )" -2838282014029957421 12 "VERY-BIG.3GB" 656815 0 0 0 "1392389036" "0" "" "" 
    

    Normaly this housl happen only if the server had given an empty e-tag field in the reply to the PUT: E-Tag: ""
    If there was no etag at all from the server, we would have normaly thrown another error.

    On the second sync however, the server report a different etag (52fe2cff34e1e) so we beleive the file has changed on the servrer.

    The question is why do we save an empty etag in the first place? Was the server really reporting an empty etag? Or is there a bug in the way we parse etags? Or was there a proxy messing with the E-Tag field?

  3. EmidioStani commented on Apr 8, 2014

    @EmidioStani

    I have the same problem, it looks like for files over 4GB (I tried with 4.1GB and 5.7GB files) after the upload (see the file attached at time: 04-08 10:51:38:281) the client starts to download the file (I didn't touch it at all). For a file of 3.5GB it doesn't happen.

    See the mirall log: https://gist.github.com/EmidioStani/10108753

    Client: Mirall 1.5.3 (2523) on windows 7
    Server: Owncloud 6.0.2 on Ubuntu 12.04.4 LTS, Apache 2.4.7, PHP 5.5

  4. guruz commented on Oct 21, 2014

    @guruz
    Contributor

    @cdamken How similar is this to the issue we chatted about today?

  5. added this to the 1.7.1 milestone on Oct 21, 2014
  6. cdamken commented on Oct 27, 2014

    @cdamken
    Contributor

    @guruz Yes, I have the same behavior with CentOS and I receive this message too: #1729 (I don't know if its related)
    but I have tested with 1.6.3 and 1.6.4

  7. cdamken commented on Nov 3, 2014

    @cdamken
    Contributor

    @ogoffart @guruz

    The file name is VERY.BIG.FILE
    MTIME of the original file is Oct 29 17:01:12

    It was started to be uploaded at 17:01:13 and it finished at 17:07:42.

    In the check just after the upload, MTIME/etag has not been changed.

    10-29 17:08:13:781 csync_walker: file: C:\Users\USER.PATH/VERY.BIG.FILE [file_id=]
    10-29 17:08:13:797 _csync_detect_update: Database entry found, compare: 1414569672 <-> 1414569672, etag: 5450a0b0aa63a <-> 5450a0b0aa63a, inode: 63966 <-> 63966
    --
    10-29 17:08:14:140 csync_walker: file: ownclouds://SERVER.NAME/remote.php/webdav/share4/VERY.BIG.FILE [file_id=00259547ocfdd0f6fec7]
    10-29 17:08:14:140 _csync_detect_update: Database entry found, compare: 1414569672 <-> 1414569672, etag: 5450a0b0aa63a <-> 5450a0b0aa63a, inode: 0 <-> 63966
    

    On the next check (I don’t know why it was 30 mins later…I just greped the file name), MTIME/etag has been changed.

    10-29 17:37:43:948 csync_walker: file: C:\Users\USER.PATH/VERY.BIG.FILE [file_id=]
    10-29 17:37:43:948 _csync_detect_update: Database entry found, compare: 1414569672 <-> 1414569672, etag: 5450a0b0aa63a <-> 5450a0b0aa63a, inode: 63966 <-> 63966
    --
    10-29 17:37:45:540 csync_walker: file: ownclouds://SERVER.NAME/remote.php/webdav/share4/VERY.BIG.FILE [file_id=00259547ocfdd0f6fec7]
    10-29 17:37:45:540 _csync_detect_update: Database entry found, compare: 1414570107 <-> 1414569672, etag: 5450a649318ba <-> 5450a0b0aa63a, inode: 0 <-> 63966
    
    1414570107 = Oct 29 17:08:27
    

    monitoring the file on the ownCloud server:

    At 17:09:58, it was

    File: `/oc_data/w10102/files/share4/VERY.BIG.FILE'
    Size: 2147483647 Blocks: 4194304 IO Block: 1048576 <92>ʏ<ED><83>t<83>@<83>C<83><8B>
    Device: 1ch/28d Inode: 98349313 Links: 1
    Access: (0644/-rw-r--r--) Uid: ( 48/ apache) Gid: ( 48/ apache)
    Access: 2014-10-29 17:01:12.000000000 +0900
    Modify: 2014-10-29 17:01:12.000000000 +0900
    Change: 2014-10-29 17:09:20.000000000 +0900
    

    and at 17:10:08, it was

    File: `/oc_data/w10102/files/share4/VERY.BIG.FILE'
    Size: 2147483647 Blocks: 4194304 IO Block: 1048576 <92>ʏ<ED><83>t<83>@<83>C<83><8B>
    Device: 1ch/28d Inode: 98349313 Links: 1
    Access: (0644/-rw-r--r--) Uid: ( 48/ apache) Gid: ( 48/ apache)
    Access: 2014-10-29 17:08:27.000000000 +0900
    Modify: 2014-10-29 17:08:27.000000000 +0900
    Change: 2014-10-29 17:08:27.000000000 +0900
    

    Logs and Pictures

    S3-ownCloud\Shared\owncloud\support\github-issues\mirall\1425

  8. cdamken commented on Nov 24, 2014

    @cdamken
    Contributor

    @ogoffart @guruz Any news?

  9. dragotin commented on Nov 24, 2014

    @dragotin
    Contributor

    The server reports a changed mtime (through a changed etag), that is why the client re-downloads.

    The server log file contains a lot of lines like this:

    {"app":"remote","message":"SQLSTATE[HY000] [1129] Host 'owncld21' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'","level":4,"time":"2014-10-29T17:40:09+09:00"}
    

    Please fix the PHP to database connection and I am positive that the problem will go away.

  10. dragotin commented on Nov 27, 2014

    @dragotin
    Contributor

    @cdamken any news on this one?

  11. 9 remaining items

  12. cdamken commented on Jan 26, 2015

    @cdamken
    Contributor

    @craigpg @markviens I need a solution here please.

  13. MorrisJobke commented on Jan 26, 2015

    @MorrisJobke
    Contributor

    Is this still the problem described in the initial post or is this just #1425 (comment) ? It is just this error message, isn't it?

  14. MorrisJobke commented on Jan 26, 2015

    @MorrisJobke
    Contributor

    Maybe #2116 (comment) fixes it.

  15. MorrisJobke commented on Jan 26, 2015

    @MorrisJobke
    Contributor

    The linked PR is merged into 6.0.6. @cdamken Which version did they use?

  16. cdamken commented on Jan 27, 2015

    @cdamken
    Contributor

    @MorrisJobke #1425 (comment) In my case only the comment, but the errors are similar as the initial post.

  17. cdamken commented on Jan 27, 2015

    @cdamken
    Contributor

    @PVince81 #1425 (comment) Both servers have the same time.

    @MorrisJobke #1425 (comment) They use 6.0.5, I already told them to upgrade it at least to 6.0.6

  18. MorrisJobke commented on Jan 27, 2015

    @MorrisJobke
    Contributor

    Nothing happened here with 6.0.5 and client 1.7.1:

    01-27 14:31:14:711 0x16b8018 csync_walker: file: owncloud://localhost/master/remote.php/webdav/VERY-BIG.3GB [file_id=00000007occfedce0b58 size=3145728000]
    01-27 14:31:14:711 0x16b8018 _csync_detect_update: Database entry found, compare: 1422365198 <-> 1422365198, etag: 54c7929e7b964 <-> 54c7929e7b964, inode: 0 <-> 1708330, size: 3145728000 <-> 0, perms:  <-> 
    01-27 14:31:14:712 0x16b8018 _csync_detect_update: file: VERY-BIG.3GB, instruction: INSTRUCTION_NONE <<=
    

    It did several checks, but in the last 5 minutes there was not a single redownload. I will keep the client open and maybe it good redownloaded.

  19. MorrisJobke commented on Jan 27, 2015

    @MorrisJobke
    Contributor

    20 minutes later. Nothing happened yet. I will have a look at the logs again.

  20. MorrisJobke commented on Jan 27, 2015

    @MorrisJobke
    Contributor

    This message shows up repeatedly (3 is error):

    {"app":"hook","message":"error while running hook (OC\\Preview::post_write): An exception occurred while executing 'INSERT INTO `oc_filecache` (`mimepart`, `mimetype`, `mtime`, `size`, `etag`, `storage_mtime`, `parent`, `path_hash`, `path`, `name`, `storage`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6-13cd79b7b4d3191ffaa9cb66cb3e7681' for key 'fs_storage_path_hash'","level":3,"time":"2014-11-07T16:16:17+09:00"}
    

    I don't know that one, but it is just present at the beginning of the log and looks like a filter, that dodn't match anything:

    {"app":"webdav","message":"Sabre_DAV_Exception_PreconditionFailed: An If-Match header was specified, but none of the specified the ETags matched.","level":4,"time":"2014-11-07T16:26:18+09:00"}
    

    Something that is possibly just a notice (4 is warning):

    {"app":"webdav","message":"Sabre_DAV_Exception_MethodNotAllowed: The resource you tried to create already exists","level":4,"time":"2014-11-11T13:26:28+09:00"}
    

    And finally those: (last two ones have the same size but other expectations ... kinda weird, but maybe this is simply luck)

    {"app":"webdav","message":"Sabre_DAV_Exception_BadRequest: expected filesize 10485760 got 1114112","level":4,"time":"2014-11-20T09:16:01+09:00"}{"app":"webdav","message":"Sabre_DAV_Exception_BadRequest: expected filesize 20971520 got 131072","level":4,"time":"2014-11-28T11:30:30+09:00"}
    {"app":"webdav","message":"Sabre_DAV_Exception_BadRequest: expected filesize 8388607 got 131072","level":4,"time":"2014-11-28T11:30:31+09:00"}
    

    That are simply too many possible problems in here. Can we have a clean setup that breaks with reproducible steps? @cdamken You said, that you can reproduce with a CentOS box? Is this the Inc. appliance? Where can I grab one with 6.0.5? Did you also notice the problem with 1.7.1?

  21. cdamken commented on Jan 28, 2015

    @cdamken
    Contributor

    @MorrisJobke

    You said, that you can reproduce with a CentOS box? Is this the Inc. appliance? Where can I grab one with 6.0.5? Did you also notice the problem with 1.7.1?

    I reproduced once, but my NFS was probably not synced on that time.

    I try with 6.0.5, 6.0.6, 7.0.3 and 7.0.4 with 1.7.1 and I could not reproduce it anymore 😞

  22. MorrisJobke commented on Feb 2, 2015

    @MorrisJobke
    Contributor

    @moscicki @EmidioStani Can one of you reproduce this with a current client? Otherwise I tend to close this ticket as nobody can reproduce this.

  23. EmidioStani commented on Feb 2, 2015

    @EmidioStani

    Hello,

    unfortunately I am not able to reproduce because I work for another
    organization. Thanks for looking into it.

    Best,

    Emidio

    On 2 February 2015 at 10:36, Morris Jobke [email protected] wrote:

    @moscicki https://github.com/moscicki @EmidioStani
    https://github.com/EmidioStani Can one of you reproduce this with a
    current client? Otherwise I tend to close this ticket as nobody can
    reproduce this.

    —
    Reply to this email directly or view it on GitHub
    #1425 (comment).

    Emidio Stani
    PwC | Senior Consultant
    Direct: +32 2 7104162 | Mobile: +32 499 599823 | Fax: +32 2 7104069
    Email: [email protected]
    PwC Enterprise Advisory cvba/scrl

  24. dragotin commented on Feb 17, 2015

    @dragotin
    Contributor

    Closing this as the problem obviously is solved. Please reopen if not.

  25. removed their assignment
    on Oct 5, 2015
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