Android client downloads failing

I’m having trouble downloading files on the Android client version 2.0.1, server version 12.0.3 running on OpenBSD httpd with PHP 5.6.31, with PostgreSQL 9.6.6. All files and folders show up, upload/auto-upload works fine, thumbnails display correctly – everything else seems to be in order except downloading.

When I tap a file to download, the progress bar appears but does nothing:

…then after a few seconds it gives the triangle-exclamation and says “Download failed”:

While this is happening, the status bar shows “Downloading … 2147483657% Downloading …”, then finally returns with “Could not download ”:

Here is what httpd logs while doing all this:

Upon selecting the file to download:

[24/Nov/2017:10:53:40 -0500] "GET /index.php/apps/files/api/v1/thumbnail/256/256/InstantUpload/Camera/2017/07/IMG_20170728_173442.jpg HTTP/1.1" 200
[24/Nov/2017:10:53:40 -0500] "GET /ocs/v1.php/cloud/capabilities?format=json HTTP/1.1" 200 0                           
[24/Nov/2017:10:53:40 -0500] "GET /remote.php/webdav/InstantUpload/Camera/2017/07/IMG_20170728_173440.jpg HTTP/1.1" 200 0

Upon hitting the back button after download fails:

[24/Nov/2017:10:53:45 -0500] "GET /ocs/v1.php/cloud/user?format=json HTTP/1.1" 200 0                           
[24/Nov/2017:10:53:46 -0500] "PROPFIND /remote.php/webdav/InstantUpload/Camera/2017/07/ HTTP/1.1" 207 0
[24/Nov/2017:10:53:46 -0500] "GET /ocs/v2.php/apps/files_sharing/api/v1/shares?path=%252FInstantUpload%252FCamera%252F2017%252F07%252F%26reshares=t
[24/Nov/2017:10:53:49 -0500] "GET /index.php/apps/files/api/v1/thumbnail/256/256/InstantUpload/Camera/2017/07/IMG_20170728_173442.jpg HTTP/1.1" 200

Viewing an image in the Web Gallery:

[24/Nov/2017:10:58:55 -0500] "GET /index.php/apps/gallery/slideshow HTTP/1.1" 200 0                        
[24/Nov/2017:10:58:55 -0500] "GET /core/img/actions/view-next.svg?v=1 HTTP/1.1" 200 452                        
[24/Nov/2017:10:58:55 -0500] "GET /core/img/actions/view-play.svg?v=1 HTTP/1.1" 200 396                        
[24/Nov/2017:10:58:55 -0500] "GET /core/img/actions/view-previous.svg?v=1 HTTP/1.1" 200 494                        
[24/Nov/2017:10:58:55 -0500] "GET /core/img/actions/view-pause.svg?v=1 HTTP/1.1" 200 424                        
[24/Nov/2017:10:58:55 -0500] "GET /core/img/actions/view-close.svg?v=1 HTTP/1.1" 200 598                        
[24/Nov/2017:10:58:55 -0500] "GET /core/img/actions/view-download.svg?v=1 HTTP/1.1" 200 405                        
[24/Nov/2017:10:58:56 -0500] "GET /apps/gallery/img/toggle.svg HTTP/1.1" 200 818                        
[24/Nov/2017:10:58:56 -0500] "GET /apps/gallery/img/view-delete.svg HTTP/1.1" 200 723                        
[24/Nov/2017:10:58:56 -0500] "GET /apps/gallery/img/share-white.svg HTTP/1.1" 200 474                        
[24/Nov/2017:10:58:56 -0500] "GET /index.php/apps/gallery/preview/35106?width=1400%26height=1400%26c=27843ed3b681d23e0ba808bafb6fa7e8%26requesttoke
[24/Nov/2017:10:59:01 -0500] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 0

Downloading image from Web Gallery (which works fine):

[24/Nov/2017:10:59:45 -0500] "GET /index.php/apps/gallery/files/download/35106?c=27843ed3b681d23e0ba808bafb6fa7e8%26requesttoken=jW8PwqoqHe0rFIIZYz

Even with all logging options enabled, nextcloud.log shows nothing during all of this. I’ve tried the same client on https://demo.nextcloud.com and it works flawlessly. Everything under the web server’s folder structure is owned by the www user. What might I be missing?

Those look like access logs, can you output the error logs please?

Sorry, should have mentioned that – httpd hasn’t logged any errors during any of this, even with verbose logging enabled.

Edit to add: I’ve also tried disabling my firewall to make sure nothing is getting filtered.

I did manage to see a single file successfully download this weekend – then it promptly quit working again. All logs looked normal, no errors or anything else untoward.

What might I be missing? Is there some additional logging I can enable on the client side?

So you use chunking on the server side? Afaik the client has an issue with chunked downloads for which @tobiasKaminsky has created a fix for the next release.

So you use chunking on the server side?

Heh, evidently I do! I haven’t read much about httpd’s implementation. Glad to know I’m not crazy. :slight_smile:

Afaik the client has an issue with chunked downloads for which @tobiasKaminsky has created a fix for the next release.

Sure enough, these exactly match my experience:

https://github.com/nextcloud/android/issues/113
https://github.com/nextcloud/android-library/pull/98

I’ll keep an eye out for the dev client to be updated. Thanks!

1 Like

I`m facing the same problem, is this fix valid for the latest version of nextcloud / android client too?

I missed that this was five years ago, I’m having this problem now too and searched this up and saw it’ll be fixed soon message from November, ok great! :laughing:

Then after an app update and the problem didn’t go away, I come back and see jp’s message “5 years later” and realize my folly. BUT, then I just uninstalled nextcloud and reinstalled, and now it works fine. So be sure and try that anyone google brings here, I think my android permissions were just messed up and my fresh install prompted me to set them up right.

You can solve the problem by going to Settings - Apps - Special App access - access to all files and allow Nextcloud to access your files. That’s it. On reinstalling you will be ask to grant this permission.