nextcloud / ios

📱 Nextcloud iOS App
https://itunes.apple.com/us/app/nextcloud/id1125420102
GNU General Public License v3.0
1.89k stars 862 forks source link

Failed uploads stay in queue and never try again #770

Open instantlinux opened 5 years ago

instantlinux commented 5 years ago

Expected behaviour

If the server is temporarily unable to accept an upload (for example, permissions or file-size restrictions) of one or more files/images, a user should be able to manually trigger a retry for queued files.

Actual behaviour

During a server migration last month, 140 images/videos got stuck in queue. Each queue element looks like:

<More Transfers
[IMG] 18-12-20 16-04-04 7127.jpg
Error code 413
O
[IMG] 18-12-20 16-04-15 7128.jpg
Error code 413
O
...
[IMG] 19-01-03 19-22-50 7573.jpg
You don't have permission to complete the...
O
[IMG] 18-12-30-14-22-03 7328.jpg
Internal server error
O

The circle at right has a square "stop" button but that only cancels the transfer of that item, permanently. There is no other option, so I leave the queue in place hoping for a fix.

Steps to reproduce

1) Install an nginx reverse-proxy in front of Nextcloud server 2) Set the client-body-buffer-size / proxy-body-size nginx parameters to a value smaller than the images you have on your phone, say 100K 3) Take a few pictures 4) Start Nextcloud IOS app and look for the 413 errors to show up 5) Adjust the nginx parameters back to a normal level (unlimited, or >=1G) 6) Go back into this IOS app and see the queued pictures remain stuck

iOS version

12.1.1

App version

2.22.7.4

Server configuration

16GB RAM 1TB SSD gigE Ethernet

Operating system: Ubuntu 18.04

Web server: nginx from quay.io kubernetes plus the apache2 built into docker image

Database: Internal sqlite

PHP version: 7.2.13 built into official image

Nextcloud version: (see Nextcloud admin page) NextCloud 15.0.0 official docker image, 4GB allocated

marinofaggiana commented 5 years ago

@instantlinux try with the new version in TestFlight (22.2.9) but for install it all the queue are cleared :(

ne20002 commented 5 years ago

I can confirm this with app 2.22.8. It is very anoying. Failed transfers should be automatically retried if the cause for the error is not based on the device itself (e.g. file has been deleted).

erdoukki commented 5 years ago

May be the parameter in advanced parameters, "most compatible" may be the responsible ?! After disabling it, a mass upload of 18.000 photos seem to work better.

I am using the default 2.22.8.20 on iPhone and iPad. My NextCloud server is 15.0.2.

The folders for uploading photos are on remote share, which is also a nfs mounted share. May be it's related with the https://github.com/nextcloud/server/issues/13297

doomi commented 5 years ago

I liked the classic version, where we could cancel, stop and restart the uploads. Now we can only cancel it and there’s no retry button anymore.

The stop/retry button was also usefull, when a huge file was in top of the queue and smaller, more important files below. Then I could temporarily stop the big one until the others were uploaded and then just hit retry on the big one. Now I have to completely cancel the big one and manually upload it again later.

instantlinux commented 5 years ago

I haven't tried forcing failures to see if retry logic works yet; haven't seen photos stuck in queue since the 2.23.0.0 update a couple weeks ago. However I do see many photos getting uploaded twice: the Activity log shows such images "created" and then "changed". This is causing the server to use much more storage, as it makes a 2nd copy of those pictures in a directory called _filesversions. If I look in the files_versions directory for 2019/03, I see 153 files; there are 348 pictures in the main files directory so this is happening 43% of the time. (295MB and we're less than halfway through March; these directories last year averaged about 20MB/mo.) This normally only happens to the much smaller percentage of pics that I have to manually edit (rotate, usually).