owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.77k stars 3.05k forks source link

[BUG] Selective download behaviour #3951

Closed C8opmBM closed 4 months ago

C8opmBM commented 1 year ago

I'm running ocis web, desktop and android without issues (oidc is Authelia).

Today I noticed a weird behaviour, where the android client won't download some file types (e.g. .txt and .opml). Other file types I tested, images (png, jpg) and documents in pdf, they download normally.

I made a screen grab and post some logs with a 404 response for the files I mention above.

Any insights?

D: 2023-03-07 12:14:11:251(LogBuilder.kt:38) .logHttp()[Network, response] [body] [62fbff8b-39c4-4882-82e7-eec6ed261a96] --> Body start for response
D: 2023-03-07 12:14:11:254(LogBuilder.kt:38) .logHttp()[Network, response] [body] [62fbff8b-39c4-4882-82e7-eec6ed261a96] <d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"><d:response><d:href>/remote.php/dav/files/myuser/</d:href><d:propstat><d:prop><d:resourcetype><d:collection/></d:resourcetype><d:getlastmodified>Tue, 07 Mar 2023 10:13:48 GMT</d:getlastmodified><d:getetag>"e6e4e159a742acb775208a2d43038c65"</d:getetag><d:quota-used-bytes>5854090</d:quota-used-bytes><d:quota-available-bytes>-2</d:quota-available-bytes><oc:permissions></oc:permissions><oc:id>84b97425-0b5f-4132-8fd5-d04ed1defb9c!84b97425-0b5f-4132-8fd5-d04ed1defb9c</oc:id><oc:size>5854090</oc:size><oc:privatelink>https://cloud.mydomain.net/f/84b97425-0b5f-4132-8fd5-d04ed1defb9c%2184b97425-0b5f-4132-8fd5-d04ed1defb9c</oc:privatelink></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><d:displayname></d:displayname><d:getcontenttype></d:getcontenttype><d:getcontentlength></d:getcontentlength><d:creationdate></d:creationdate><oc:share-types></oc:share-types></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/myuser/feeds.txt</d:href><d:propstat><d:prop><d:getcontenttype>text/plain</d:getcontenttype><d:resourcetype></d:resourcetype><d:getcontentlength>9948</d:getcontentlength><d:getlastmodified>Mon, 06 Mar 2023 20:03:58 GMT</d:getlastmodified><d:getetag>"73dffcd645f7b069ec99fe15b442ebfb"</d:getetag><oc:permissions>RDNVWZ</oc:permissions><oc:id>3f06c9c0-b4c6-4194-9891-7a85dfe9040f$84b97425-0b5f-4132-8fd5-d04ed1defb9c!3e2040ea-2044-44b6-876d-dee52d3820b8</oc:id><oc:size>9948</oc:size><oc:privatelink>https://cloud.mydomain.net/f/3f06c9c0-b4c6-4194-9891-7a85dfe9040f$84b97425-0b5f-4132-8fd5-d04ed1defb9c%213e2040ea-2044-44b6-876d-dee52d3820b8</oc:privatelink></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><d:displayname></d:displayname><d:creationdate></d:creationdate><d:quota-used-bytes></d:quota-used-bytes><d:quota-available-bytes></d:quota-available-bytes><oc:share-types></oc:share-types></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/myuser/feeds.opml</d:href><d:propstat><d:prop><d:getcontenttype>text/x-opml</d:getcontenttype><d:resourcetype></d:resourcetype><d:getcontentlength>10042</d:getcontentlength><d:getlastmodified>Tue, 07 Mar 2023 09:56:54 GMT</d:getlastmodified><d:getetag>"ed41cd158e0c5398e381aa4e8e63793d"</d:getetag><oc:permissions>RDNVWZ</oc:permissions><oc:id>3f06c9c0-b4c6-4194-9891-7a85dfe9040f$84b97425-0b5f-4132-8fd5-d04ed1defb9c!ea50b975-fea5-4985-a607-cd28caec9232</oc:id><oc:size>10042</oc:size><oc:privatelink>https://cloud.mydomain.net/f/3f06c9c0-b4c6-4194-9891-7a85dfe9040f$84b97425-0b5f-4132-8fd5-d04ed1defb9c%21ea50b975-fea5-4985-a607-cd28caec9232</oc:privatelink></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><d:displayname></d:displayname><d:creationdate></d:creationdate><d:quota-used-bytes></d:quota-used-bytes><d:quota-available-bytes></d:quota-available-bytes><oc:share-types></oc:share-types></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/myuser/entry_ex.jpg</d:href><d:propstat><d:prop><d:getcontenttype>image/jpeg</d:getcontenttype><d:resourcetype></d:resourcetype><d:getcontentlength>100446</d:getcontentlength><d:getlastmodified>Fri, 18 Nov 2022 18:25:34 GMT</d:getlastmodified><d:getetag>"b5062790f777009daf0e97eba95146a5"</d:getetag><oc:permissions>RDNVWZ</oc:permissions><oc:id>3f06c9c0-b4c6-4194-9891-7a85dfe9040f$84b97425-0b5f-4132-8fd5-d04ed1defb9c!1d5adf3f-7003-405b-ad4b-ae9ac1467925</oc:id><oc:size>100446</oc:size><oc:privatelink>https://cloud.mydomain.net/f/3f06c9c0-b4c6-4194-9891-7a85dfe9040f$84b97425-0b5f-4132-8fd5-d04ed1defb9c%211d5adf3f-7003-405b-ad4b-ae9ac1467925</oc:privatelink></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><d:displayname></d:displayname><d:creationdate></d:creationdate><d:quota-used-bytes></d:quota-used-bytes><d:quota-available-bytes></d:quota-available-bytes><oc:share
D: 2023-03-07 12:14:11:255(LogBuilder.kt:38) .logHttp()[Network, response] [body] [62fbff8b-39c4-4882-82e7-eec6ed261a96] <-- Body end for response -- Omitted: 0 bytes
I: 2023-03-07 12:14:11:258(ReadRemoteFolderOperation.kt:96) .run()Synchronized / with 5 files. Operation finished with HTTP status code -1 (success)

ocis

abelgardep commented 1 year ago

Hi @C8opmBM , thanks for reporting this!

We are not able to reproduce this.

Let us know the android app version and the server version.

It would be great if you can send us more extended logs to android-app@owncloud.com

Also, we are close to releasing the first beta to support spaces, stay tuned!

C8opmBM commented 1 year ago

Hello @abelgardep

Phone is a Pixel 6 running Android 13. Android app version is: 3.0.3

ownCloud is Infinite Scale (Community Edition) Version 2.0.0+8bd4c3a9a Web client version 7.0.0-rc.16 Desktop client version: 3.2.0.10193

Will try to capture more logs and will get back to you, or maybe I will wait for the release of the next android version to test it there. Thank you!

jesmrec commented 1 year ago

something in the middle of the app and the server (proxies or similar)?

C8opmBM commented 1 year ago

You mean VPN or something, or reverse proxy? If reverse proxy, yes I use caddy v2 with my domain, and auth is done via Authelia oidc. But all other clients work normally (web, desktop), even the android works, the issue, as said is with some files only, which is weird.

Just tested now with some other file types, even .yaml or .log cannot be downloaded, yet their preview appear (as in a thumbnail with text). If there was an issue with the proxy, I assume all files would have had issues, which is not the case.

Tested download ok so far for: images (jpg, jpeg, png, ico) archives (zip, 7z) pdfs

Not working: .txt .yaml .log opml

C8opmBM commented 1 year ago

I've sent the logs to the email you provided, the file I tested with is feeds.opml (to seach against the log)

I've also browsed Owncloud folder in the phone with the file explorer and tried to open the files there, same error, file cannot be downloaded.

I will link you the log here as well, just in case: https://privatebin.net/?89f8e469afc2f0f8#QCiUFzR4EvMdZEP6P6jv85daAws6B1TxRAzW53mRNjn

LE: just to mention, there's no issues with uploading these files or similar files. Problem only with the download.

abelgardep commented 1 year ago

I see, thanks for the logs.

We try to recover the Content-Length header from the response and it's missing. You can check the download with this request id: 577b51d5-5071-4e05-9f18-0c2be50f89cd That header is missing.

In the logs for the downloads of images check if the Content-Length header is there.

Could be related to the reverse proxy, as this issue -> https://github.com/owncloud/android/issues/3800

C8opmBM commented 1 year ago

Thanks, yes I see it's missing. I've searched the logs, and Content-Length appear for other files pdf zip jpg but not for the ones I described txt opml yaml log

The issue is, I have no additional headers added in the caddyfile (as opposed to issue #3800 which added the gzip header).

Still unsure where the problem is, why some get the header while others don't. Will look more into it, thank you!

C8opmBM commented 1 year ago

Coming back to this, running the latest android version 4.0 (2d8ded605) still exhibits the same behaviour. Some files won't download.

JuancaG05 commented 1 year ago

Hi @C8opmBM! After your report in March, we created this issue to try to solve it: https://github.com/owncloud/android/issues/3967. It's pending and we'll work on that ASAP! Thanks for your feedback! We'll keep you updated 😃

C8opmBM commented 10 months ago

@JuancaG05 I understand this takes time and you have a lot on your plates, but the title above reads [FEATURE REQUEST], whereas this is a bug which makes the android app unreliable and thus unusable.

michaelstingl commented 10 months ago

I’d more interested in fixing the root cause. Content length still missing with latest oCIS version? Can it reproduced? Issue open in the oCIS repository?

C8opmBM commented 4 months ago

Hello, android version 4.2.0, same behaviour, missing content lenght. Some filetypes work, some don't.

Server info:

ownCloud 6.0.0.12867-alpha.1 7aea4b Libraries Qt 6.6.0, OpenSSL 3.1.4 24 Oct 2023 Using virtual files plugin: wincfapi OS: windows-10.0.19045 (build arch: x86_64, CPU arch: x86_64) QPA: windows

C8opmBM commented 4 months ago

I see, thanks for the logs.

We try to recover the Content-Length header from the response and it's missing. You can check the download with this request id: 577b51d5-5071-4e05-9f18-0c2be50f89cd That header is missing.

In the logs for the downloads of images check if the Content-Length header is there.

Could be related to the reverse proxy, as this issue -> #3800

I feel pretty dumb, as my caddy config have been importing all this time a longish snippet which also contains encode zstd gzip therefore the issue was related indeed to #3800 All this time :)

Removed it, and all is fine. I really am sorry, this can be closed. Have a great day!

jesmrec commented 4 months ago

Thanks for your engagement @C8opmBM !. Happy that the issue is not there anymore.

Closing.