android icon indicating copy to clipboard operation
android copied to clipboard

conflict if server takes too long to process uploaded file

Open morta5 opened this issue 2 years ago • 5 comments

Steps to reproduce

  1. Have a slow server (f.e. a Raspberry Pi )
  2. upload a large file
  3. File is on 100% for some time, gives an unknown error and tries to re-upload although it has already been uploaded and the server is processing it

Expected behaviour

  • It should not try to re-upload the file or skip it, because the checksum is the same and it should not fail if the server needs more time to process the upload

Actual behaviour

  • It fails after ~ 1 minute and tries to re-upload to whole file again

Can you reproduce this problem on https://try.nextcloud.com?

No, because the servers are way faster

Environment data

Android version: Android 12

Device model: Motorola edge plus

Stock or customized system: stock

Nextcloud app version: 3.20.3

Nextcloud server version: 24.0.1

Reverse proxy: yes, nginx with YunoHost

Logs

Web server error log

Nothing about Nextcloud, just something about my matrix server

Nextcloud log (data/nextcloud.log)

Nothing about this specific problem

morta5 avatar Jun 26 '22 22:06 morta5

I can confirm this. If I remember correctly the error message happens every time. The conflict frequently.

svenb1234 avatar Jun 27 '22 09:06 svenb1234

I have the same behavior only for my videos (~50Mb) uploading to rpi4. It worked for month/years but since some time more or less all video uploads yield a conflict dialog showing same size for local and remote. I always just "delete" the conflict and than have to dismiss notification by notification. It is tedious and I don't understand why this dialog is always shown

thrillfall avatar Jul 10 '22 18:07 thrillfall

Does it happen with any files, or just media files? Just trying to figure out where the "stuck at 100%" thing may be coming from.

Also, if some of you who can reproduce it easily can get a logcat from the device that would be cool.

AlvaroBrey avatar Jul 11 '22 13:07 AlvaroBrey

I'll give you logs as soon as I have server access again 🏖

thrillfall avatar Jul 12 '22 20:07 thrillfall

I have the same behavior (and my server is a dedicated server not a rpi4, slow, but acceptable). I created an autoconflict-rule where it creates a copy with a modified name (with (2) (2) (2)) and it just overflow my server.

May I suggest to have some intelligence for the file conflict resolving based on: 1/ md5sum 2/ sha256 3/ file size 4/ file name ==> if ALL of them are matching both on android and on server, then the file on the server is ALREADY the same and the conflict resolution is upload task from android app has been successfully DONE

rloutrel avatar Sep 13 '22 20:09 rloutrel

I have the same error, but in my case its an backup file with 1G size. Nextcloud logs are empty. And the only thing i see are timeouts from nginx.

stop5 avatar Sep 26 '22 20:09 stop5

We need logs from a device (not the server though that wouldn't hurt too) to understand what's triggering this situation:

https://github.com/nextcloud/android#getting-debug-info-via-logcat-mag

(Or built-in if you're using a Dev build)

joshtrichards avatar Nov 16 '23 18:11 joshtrichards

loggcatOutput.txt

I have generated a log file for this issue. In short the issue is a Socket timeout exception, it timed out in 30 seconds.

I have several video files larger than 10MB and with all I experience the same behaviour on 2 different phones:

  • File is created
  • File is uploaded
  • After upload progress bar is 100%, a 30 seconds freeze of the progress bar
  • Error on the upload
  • Refresh the uploads view manually (drag from the top)
  • The failed upload file is now presented as a conflict
  • Retrying the upload to resolve the conflict just repeats the process

For a server I'm using Nextcloud AIO on a Raspberry Pi 4 8GB RAM, with storage mounted via NFS on Gigabit network to my NAS.

This issue does not happen with the desktop app.

On the server side I have only this log that could be related:

Expected filesize of 40960000 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 24649728 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.

madpipeline avatar Jan 22 '24 23:01 madpipeline

A brief look suggests recent PR #12345 may assist, at least in part, with this

joshtrichards avatar Jan 25 '24 02:01 joshtrichards