Skip to content

Corrupted Microsoft Office Files #2893

Closed

Description

@stonerl

I have several user who are facing severe problems with owncloud. The setup looks like this:

Server owncloud 7.0.4 on ubuntu 14.04
Client 1 OSX 10.10 owncloud-client 1.7.1
Client 2 OSX 10.10 owncloud-client 1.7.1

The user creates a file and syncs this one with the oc-server for some reason then he starts the second client and syncs with owncloud. On the second client the user gets an error about a corrupted word/excel/powerpoint file.

I checked the files md5sum and here is what I get:

Original (working) file:

1efbc2ea324d314badc6c70486240f99

File on server:

67dafdbdcfdd013fba39ef2be1fc4c32

Corrupted file transferred to second client:

67dafdbdcfdd013fba39ef2be1fc4c32

Either on the server or during the transfer the files get altered.

Found this several times in the log:

{"app":"no app in context","message":"Error while running background job: Invalid archive or corrupted .docx file.","level":3,"time":"2015-01-30T15:15:19+01:00"}
{"app":"no app in context","message":"Error while running background job: Invalid archive or corrupted .pptx file.","level":3,"time":"2015-02-26T12:30:05+01:00"}
{"app":"no app in context","message":"Error while running background job: Invalid archive or corrupted .xlsx file.","level":3,"time":"2015-02-10T14:15:03+01:00"}

Activity

  1. guruz commented on Feb 26, 2015

    @guruz
    Contributor
  2. PVince81 commented on Feb 26, 2015

    @PVince81

    Does it only happen with office files ? How big are they ? (bigger or less big than 20 MB to rule out chunking)

    Do you have encryption enabled ?
    Are multiple users working concurrently on these same files ?

  3. PVince81 commented on Feb 26, 2015

    @PVince81

    Corruption can happen if you're using an older version of mod_fastcgihandler, see: owncloud/core#10984 (comment)

    More information about server setup would be helpful. Thanks.

  4. stonerl commented on Feb 27, 2015

    @stonerl
    Author

    So here are some more information:

    1. Encryption is disabled
    2. It affects Microsoft Office Documents (size independent though)
    3. Only one User works on the document
    4. The Users work directly in the owncloud folder

    The Server:

    • Ubuntu 14.04.1 with latest updates
    • Apache 2.4.7
    • libapache2-mod-fastcgi 2.4.7~0910052141-1.1

    fastcgid-settings:

    <IfModule mod_fcgid.c>
        DefaultMaxClassProcessCount 3
        # Set Busy and IO Timeout long enough to prevent server errors for long
        # searches and other complex wiki applications.
        FcgidBusyTimeout 3600
        FcgidIOTimeout 3600
        FcgidMaxRequestLen 100000000
        # Refer to details at http://fastcgi.coremail.cn/doc.htm
    </IfModule>

    owncloud.conf in apache

    Alias /owncloud /var/www/owncloud
    
    <Directory /var/www/owncloud/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Allow from all
        Require all granted
        Order allow,deny
        Satisfy Any
        SetEnv MOD_X_SENDFILE_ENABLED 1
        XSendFile On
    </Directory>

    config.php

    <?php
    $CONFIG = array (
      'instanceid' => '###',
      'passwordsalt' => '###',
      'trusted_domains' => 
      array (
        0 => '###',
      ),
      'datadirectory' => '/var/www/owncloud/data',
      'dbtype' => 'mysql',
      'version' => '7.0.4.2',
      'dbname' => '###',
      'dbhost' => 'localhost',
      'dbtableprefix' => 'oc_',
      'dbuser' => '###',
      'dbpassword' => '###',
      'installed' => true,
      'mail_from_address' => 'owncloud',
      'mail_smtpmode' => 'sendmail',
      'loglevel' => '2',
      'logtimezone' => 'Europe/Berlin',
      'log_type' => 'owncloud',
      'log_authfailip' => true,
      'mail_domain' => '###',
      'default_language' => 'de_DE',
      'user_backends' => 
      array (
        0 => 
        array (
          'class' => 'OC_User_IMAP',
          'arguments' => 
          array (
            0 => '{###}',
          ),
        ),
      ),
      'maintenance' => false,
      'overwritewebroot' => '/owncloud',
      'forcessl' => true,
      'appcodechecker' => false,
      'session_keepalive' => true,
      'session_lifetime' => 2592000,
      'remember_login_cookie_lifetime' => 2592000,
      'secret' => '###',
      'theme' => '',
    );

    I did some testing, when I open the file and save it with a new name in the sync-folder, the new one then gets transferred to the server and has a different md5sum on the server then on the local machine. When I save the file on the desktop, or in any other folder that doesn't get synced and then copy the new file to the sync-folder, the md5sums match.

    As I said the size doesn't matter. I had a Word-Document with only 140kb and a pptx with 24 MB, both corrupted. But we have tons of pdf-files ranging from some kilobytes to hundreds of Megabytes and no problem at all.

    The main difference is that the pdf-files only got copied to the sync-folder, the corrupted Office Documents on the other hand have been created/edited directly in the owncloud-folder.

  5. stonerl commented on Feb 27, 2015

    @stonerl
    Author

    OK, I figured how this happens. Here is what I did:

    1. I closed the owncloud client.
    2. I opened the pptx and saved it with a new name and also saved the original file under the same name.
    3. I started the owncloud client again
    4. Both files got transferred to the server. And the md5sums match

    So as I stated in my last comment, when office files get created or changed while the client is running the synced files are corrupted on the server. When a file gets copied to the sync-folder while the client is running everything is fine, also when the file gets altered while the client is closed.

  6. ckamm commented on Feb 27, 2015

    @ckamm
    Contributor

    @stonerl Sounds like the client sends bad data to the server. Could you try to reproduce it with a current 1.8.0 snapshot (http://download.owncloud.com/desktop/daily/) or the 1.8.0 beta1 (https://owncloud.org/install/#testing)?

    We made improvements to how we deal with files on Windows in 1.8.0 that might have solved the problem already.

  7. stonerl commented on Feb 27, 2015

    @stonerl
    Author

    I will test this as soon as I get my hands on the Computers. Did you do changes for file handling on Windows only? Because the machines here are running OS X.

  8. ckamm commented on Feb 27, 2015

    @ckamm
    Contributor

    @stonerl Ah, sorry, I didn't realize your clients were on OS X. Some of the changes apply to OS X too, so it's worth a try, but less likely to help.

  9. stonerl commented on Mar 3, 2015

    @stonerl
    Author

    @ckamm
    I installed 1.8.0 beta1 and the problems are resolved. When saving the Office Document the correct file gets transferred.

    Just one question. Is there a way to run a validationscan? Because we really don't know which files are affected. So we would have to check every single file.

  10. SebStaeubert commented on Mar 5, 2015

    @SebStaeubert

    Some Problem here.
    Server: 7.0.4
    Client (Debian 7): 1.7.1, 1.8.0beta2

    I made some Tests with a bunch of files (~456Mb, ~650 Files, ~130 Folder)
    Not only Office-Files are affected. It seems, that all types of files could randomly get damaged (about 20 files of 650 are affected each test). Using owncloud-client from the nightly build doesn't fix the Problem.

    @stonerl
    I did the validation in this way:
    Scenario 2:

    • Client 1 (Linux) uploads files/dirs via owncloud-client
    • Client2 (Linux) syncs the files/dirs from the server
    • on Client2 you need the original files/dirs: transfer them via dropbox ;-) or sftp
    • then use the command "diff":
      diff -r dir1 dir2
      where dir1 is the owncloud-dir and dir2 is the dir with original files

    Scenario 1:

    • Client1 (Linux) uploads files/dirs via owncloud-client
    • Client2 (Windows7) syncs the files/dirs from the server
    • on Client2 you need the original files/dirs: transfer them via dropbox ;-) or sftp
    • then use total commander -> Commands -> "Synchronize Dirs" (Options marked: Subdirs, by content, ignore date) to compare.

    @guruz @PVince81
    This is a crucial bug! It should have priority! Reliability of owncloud is mission critical.

    Regards,
    Seb.

  11. guruz commented on Mar 5, 2015

    @guruz
    Contributor

    @SebStaeubert Yes, this is very bad. I agree.. did you see #2893 (comment) ?

  12. stonerl commented on Mar 5, 2015

    @stonerl
    Author

    @SebStaeubert I just checked some file types and the main problem were office files. On one machine we also had a problems with a file-maker db-file. But as I stated above this error only appeared when the files have been modified in the sync-folder. Textfiles, PDFs and files that have been copied in the sync-folder on the other hand were transfered without any problem. Do you have the same problem, or is it just an general transfer error?

  13. 12 remaining items

  14. PVince81 commented on Mar 19, 2015

    @PVince81

    @SebStaeubert do you have encryption enabled ?

  15. PVince81 commented on Mar 19, 2015

    @PVince81

    I really hope we can get the checksum idea moving: owncloud/core#12417

  16. PVince81 commented on Mar 19, 2015

    @PVince81

    @SebStaeubert do you also happen to use mod_fastcgi_handler ? Some version was known to have bugs that caused corruption during transfers. You might want to try and upgrade to its latest version.

  17. dragotin commented on Mar 19, 2015

    @dragotin
    Contributor
  18. PVince81 commented on Mar 19, 2015

    @PVince81

    Something else to check: if you don't have encryption, try and find the corrupted file inside of the ownCloud "data" directory. Then compare it with the version from client1 and client2.
    Then we can at least see whether it was an upload problem (if the version in "data" is already corrupt) or a download problem (if the version in "data" is ok but the version in client2 isn't)

  19. SebStaeubert commented on Mar 19, 2015

    @SebStaeubert

    @PVince81

  20. SebStaeubert commented on Mar 24, 2015

    @SebStaeubert

    Today i found some more Infos for this issue:

    • on the client (this one who pushed the files initially) i found for every corrupted file a corresponding file with "conflict_" in the filename. This file contents the original uncorrupted version of the file! Any idea what is going wrong here?
    • i did another test-run with uploading a bunch of folders and files: in the owncloud-client appears in the log/activity-tab a lot of Errors in downloading with "Internal Server Errors". Some of these files are successfully up- or downloaded late on. By the way: why do i see a lot of "downloading", when i add files in to the owncloud-folder? Why does the owncloud-client not just upload the files? Are these downloads the internal owncloud-check for conflicts with the repository on the server? If so, this is confusing for a user - i think, the only information a user needs is: file successfully synced or not!
  21. SebStaeubert commented on Jun 23, 2015

    @SebStaeubert

    Updates of the ownCloud-Server to Version 8.0.2 and the ownCloud-Client to 1.8.1 fixes the problem.
    After this, only one file was corrupted, but this was not reproduceable.

  22. marlemion commented on Jul 28, 2015

    @marlemion

    I still have this problem. It appears to be present from windows (client) to server (gentoo linux) only (EDIT: seems to be a general problem, see below).

    The client is current 1.8.4, the server 8.1

    Apache is at 2.4.16

    Encryption is not enabled.

    Fastcgi is not installed.

    No redirection.

    PHP 5.6

    '#####', 'passwordsalt' => '#####', 'trusted_domains' => array ( 0 => '#####', ), 'overwrite.cli.url' => '/owncloud', 'datadirectory' => '/var/www/localhost/htdocs/owncloud/data', 'dbtype' => 'mysql', 'version' => '8.1.0.8', 'dbname' => '#####', 'dbhost' => '#####', 'dbtableprefix' => 'oc_', 'dbuser' => '#####', 'dbpassword' => '#####', 'installed' => true, 'theme' => '', 'maintenance' => false, 'secret' => '#####', 'loglevel' => 0, ); As mentioned above - this is crucial. I already messed up some of my work due to this bug. EDIT: Dropping the file to the server via the web interface and letting it sync to the file system via the windows client does also not work. Downloading directly from the web interface does also result in a corrupted docx file. So apparently ANY DOCX FILE GETS DAMAGED.
  23. dragotin commented on Jul 28, 2015

    @dragotin
    Contributor

    @marlemion please open a new issue for that. Especially with the information you gave in "EDIT:" I do not think it's a client issue. Please check your server logfiles to see if you find a hint in there for anything failing on server side.

  24. moscicki commented on Jul 28, 2015

    @moscicki
    Contributor

    @marlemion, @dragotin: if you tell me how to reproduce this I can verify on our independent server implementation if this is a client issue or a server issue.

  25. marlemion commented on Jul 28, 2015

    @marlemion

    Well, there are no server side errors in the logs. Reproduction is simple: just upload a docx file to the server and try to open it from it afterwards: MS Office will tell you that it is damaged and cannot be opened. I will open another ticket for this.

  26. danimo commented on Jul 28, 2015

    @danimo
    Contributor

    @marlemion With office files you mean the new formats (ending in 'x' (docx, pptx, xlsx, ...)? If so, then I'd be looking out for anything that touches zip files in your infrastructure, as New MS Office formats simply use ZIP as a container.

  27. marlemion commented on Jul 28, 2015

    @marlemion

    @danimo Correct, that's what I meant. New ticket is here: #3511

    I will also check the apache log files.

    EDIT: Nothing serious in the apache log files either.

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