Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted Microsoft Word files (docx) #3511

Closed
marlemion opened this issue Jul 28, 2015 · 23 comments
Closed

Corrupted Microsoft Word files (docx) #3511

marlemion opened this issue Jul 28, 2015 · 23 comments

Comments

@marlemion
Copy link

Microsoft Word files cannot be opened after being uploaded to owncloud. MS Office claims that they are damaged.

Reproduce the bug: Drop the file to the server via the web interface and let it sync to the file system via the windows client or upload it directly via the windows client. Downloading directly from the web interface does also result in a corrupted docx file. So apparently ANY DOCX FILE GETS DAMAGED.

The windows 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, apache PHP at 5.6. The log file does not show any error message.

<?php
$CONFIG = array (
'instanceid' => '#####',
'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,
);

This is crucial. I already messed up some of my work due to this bug.

@guruz
Copy link
Contributor

guruz commented Jul 28, 2015

Can you upload a sample (correct) file somewhere that can be used for reproducing?

@guruz guruz added the p2-high Escalation, on top of current planning, release blocker label Jul 28, 2015
@Dianafg76
Copy link

I tried this , and does it well , I can open the .docx file. And if I believe in a .zip several .docx I can see them with no problem.

Desktop v ownCloud-2.0.0.5308-nightly20150729-setup.exe, In WIN
Server v {"installed":true,"maintenance":false,"version":"8.1.0.8","versionstring":"8.1 RC2","edition":"Enterprise"}
Desktop v ownCloud-2.0.0.2576-nightly20150730.pkg

@danimo danimo removed the p2-high Escalation, on top of current planning, release blocker label Aug 1, 2015
@danimo
Copy link
Contributor

danimo commented Aug 1, 2015

@marlemion This is a problem with your local setup then, not a client bug anyway. Something seems to recompress zip files. Which apps are installed on your owncloud server?

@danimo
Copy link
Contributor

danimo commented Aug 1, 2015

@marlemion Also, if you upload zip files the same way, are they still identical? (same size/hash)

@marlemion
Copy link
Author

Apps are pretty much standard: files, activities, calendar, contacts, images

It happens to any zipped MS office file. But I can assure you that it also affects xlsx files. Just messed up a very important Excel file right now. Versioning back does not help. It used to work beforehand. So I could work on already uploaded files without any problem. But if I upload them or change the version, it corrupts the zip container.

Normal zip files work.

md5sum is different after upload as is the size (it is bigger).

@danimo
Copy link
Contributor

danimo commented Aug 3, 2015

@marlemion Normal zip files work. Yes, they may work, but are they also different (hash-wise)?

@danimo
Copy link
Contributor

danimo commented Aug 3, 2015

@DeepDiver1975 @MorrisJobke any idea how to debug what repacks the file?

@marlemion
Copy link
Author

Normal zip files remain original, i.e. no change in md5sums.

@guruz
Copy link
Contributor

guruz commented Aug 3, 2015

Any virus scanners or other security solutions running locally?

Are you syncing through a proxy?

Drop the file to the server via the web interface and let it sync to the file system via the windows client or upload it directly via the windows client. Downloading directly from the web interface does also result in a corrupted docx file.

So also docx files uploaded via web and then downloaded via web (no sync client involved) has this issue?

@marlemion
Copy link
Author

No virus scanners.

No proxy (it runs on apache in the directory "owncloud" behind a router, which forwards the port).

Yes, the corruption also appears when uploading via the web client (just retested a minute ago).

@guruz
Copy link
Contributor

guruz commented Aug 3, 2015

Then we need to exclude local vs server problem.

Do you have a chance to try this with a different computer (e.g. try a Mac) from a different network (friend, work, etc) ?

Does your webserver have any fancy pagespeed or similar modules?

@marlemion
Copy link
Author

I have the same problem from my Windows PC (at work) and my linux PC (at home).

apache2ctl modules:

Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_event_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_anon_module (shared)
 authn_core_module (shared)
 authn_dbm_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_dbm_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_owner_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 cgid_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 info_module (shared)
 log_config_module (shared)
 logio_module (shared)
 mime_module (shared)
 mime_magic_module (shared)
 negotiation_module (shared)
 proxy_module (shared)
 proxy_http_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 socache_shmcb_module (shared)
 speling_module (shared)
 ssl_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 usertrack_module (shared)
 vhost_alias_module (shared)
 proxy_html_module (shared)
 xml2enc_module (shared)
 php5_module (shared)

@guruz
Copy link
Contributor

guruz commented Aug 3, 2015

@guruz guruz removed this from the 2.0 - Multi-account milestone Aug 3, 2015
@guruz guruz self-assigned this Aug 3, 2015
@marlemion
Copy link
Author

Well, I do proxy something through that server, but not owncloud. Shall I disable ext_filter and try again? (right now I can't remember why I enabled it)

@guruz
Copy link
Contributor

guruz commented Aug 3, 2015

Both modules look like they can rewrite things passed through, so who knows.. yes :)

@marlemion
Copy link
Author

Nope. Same problem. Btw. the ext_filter module is enabled by default in the gentoo configuration.

@guruz
Copy link
Contributor

guruz commented Aug 3, 2015

Check your other modules.. ? Check if you really disabled the modules?

Use a binary diff tool to compsare the correct file vs the corrupt file, maybe there is a (plaintext) clue..

@marlemion
Copy link
Author

What would be a certified module constellation to be working with owncloud? I don't have the time to disable each module.

I will compare the files when I am back home at my Linux PC.

@guruz
Copy link
Contributor

guruz commented Aug 3, 2015

Would first need to see if it is really the modules, but that's my only guess now..

In general if it is a module, then it is probably because it modified the file.

Maybe it's not a module.

don't ask me about certified though ;) https://owncloud.com/owncloud-server-or-enterprise-edition/

@marlemion
Copy link
Author

Ok, some progress. I started owncloud with a very simplistic module environment of apache:

apache2ctl modules
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_event_module (static)
 access_compat_module (shared)
 auth_basic_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 dir_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 socache_shmcb_module (shared)
 ssl_module (shared)
 unixd_module (shared)
 proxy_html_module (shared)
 xml2enc_module (shared)
 php5_module (shared)

Now it works. So I have to find the module, which is responsible for the rewrite. :(

@guruz
Copy link
Contributor

guruz commented Aug 5, 2015

@marlemion Great! Good luck and comment here if you found out...

@dragotin @moscicki @DeepDiver1975 ...something which would have been prevented by transfer checksums FYI #2542

@guruz guruz closed this as completed Aug 5, 2015
@marlemion
Copy link
Author

Ok, I narrowed it down. It wasn't any module, but rather a virtual host, which is a redirection from my XBMC/KODI control web interface to my outer url/xbmc:

# -*- apache -*-

Servername servername
ProxyPreserveHost On

<Location /xbmc>
        ProxyPass http://ipadress:8081/xbmc
        ProxyPassReverse http://ipadress:8081/xbmc
</Location>

<Location /xbmc/jsonrpc>
        ProxyPass http://ipadress:8081/jsonrpc
        ProxyPassReverse http://ipadress:8081/jsonrpc
</Location>

SetOutputFilter INFLATE;proxy-html;DEFLATE

ProxyHTMLEnable On

ProxyHTMLDocType "<!DOCTYPE html>"

# these directives need to be duplicated since we're in a
# different scope. We actually only want to add "img data-src"
ProxyHTMLLinks  a       href
ProxyHTMLLinks  area    href
ProxyHTMLLinks  link    href
ProxyHTMLLinks  img     src longdesc usemap data-src
ProxyHTMLLinks  object  classid codebase data usemap
ProxyHTMLLinks  q       cite
ProxyHTMLLinks  blockquote      cite
ProxyHTMLLinks  ins     cite
ProxyHTMLLinks  del     cite
ProxyHTMLLinks  form    action
ProxyHTMLLinks  input   src usemap
ProxyHTMLLinks  head    profile
ProxyHTMLLinks  base    href
ProxyHTMLLinks  script  src for

# finally, rewrite URLs
ProxyHTMLURLMap http://ipadress:8081/xbmc /xbmc

I have disabled it so far. Maybe this is of any help for you. Thanks a lot. I was able to recover my lost data thanks to the versioning feature. :) Apparently, I copied the file from some forum, so I don't have any clue what it does.

@daxprather
Copy link

Had same data corruption problem with MS Word files. Completely removing recently installed Kodi from client to see if problem fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants