-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
upload of large files fails with connection error #5609
Comments
Hi, It's happening with same version of Nexctloud (application and Docker container official image) mentioned above. Tried on different smartphones, same problem. Logs from NGINX Proxy: nginx--proxy | MY_IP - - [09/Mar/2020:18:30:29 +0000] "GET /index.php/204 HTTP/1.1" 204 0 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.10.1" "-" Other attempt of same file from NextCloud Webserver: cloud-app | 172.20.0.4 - MY_USER [09/Mar/2020:18:35:51 +0000] "HEAD /remote.php/webdav/Documents/52.pdf HTTP/1.0" 404 556 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.10.1" Server configuration: Operating system: Linux 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 Webserver: Apache/2.4.38 (Debian) (apache2handler) Database: mysql 10.4.12 PHP version: 7.3.15 Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, apache2handler, apcu, exif, gd, gmp, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache Nextcloud version: 18.0.1 - 18.0.1.3 |
@tobiasKaminsky the original description by @alecbl points to a timeout issue for assembly of really large files. @Unclezz your issue rather seems to be a server missconfiguration issue since 1mb is the chunk size so chunking seems to be broken on the server side. Cc @rullzer |
How big is the file? |
@tobiasKaminsky I've virtually disabled the php timeouts, either infinite or pretty big numbers (max_execution_time = 21600, max_input_time = -1). Nextcloud is running in a VM with 8 virtual cpu threads on a amd threadripper gen. 1. The VM has 3GB ram. Neither load nor RAM usage gets anywhere high enough for it to be a bottleneck. It errors with connection error in less than a minute. Also, faling in that particular place leads to a retry starting over at 0 and with big files I often end up with the same file uploaded multiple times with (2) (3) etc. appended and the client still listing a failed upload job. Why does it timeout so soon? Is that intended? |
Same problem here. |
Assembling the chunks uses MoveMethod, but not MoveFileRemoteOperation, so it has its default timeout. @nextcloud/server-triage do you have an idea how long we should wait? @alecbl if I provide you a test APK with a much longer timeout, can you test this? |
@tobiasKaminsky |
Until it is done basically. |
I'm guessing the timing out is supposed to provide a way for the client to error out eventually in case the assembly fails, so that it can retry or notify the user and not leave the waiting state indefinetly. Alternatively maybe the server could inform the client as to the state of the ongoing operation, or notify the client when the state changes (pending, done, failed). |
So, if I increase the timeout on final move operation to e.g. 20mins? |
This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you! |
This is a bug I am experiencimg as well, with large (>2GB) files. I strongly suspect a timeout as discussed. Is there a test APK available with a longer timeout? |
This timeout is on server side, not on client side. |
I have the same issue, and the upload always succeeds (so far), but the Android app doesn't know this and detects a conflict on trying to reupload. |
@tobiasKaminsky Any thoughts on which server settings to change? Edit: or how to track it down, I see no obvious error messages. |
@nextcloud/server-triage what can we do in cases when assembly of chunks takes too long, but then finishes in background, but still gives clients an error? |
I have the same issue with autouploading Signal backups (~2GB each). The server documentation mentions, that the Nextcloud sync client is not affected by upload limits as it is uploading files in smaller chunks. I uploaded the same signal backup with the Nextcloud sync client and checked the nginx access.log. The output looks similar for the upload in the Android app and the Nextcloud sync client on Ubuntu. But the latter shows the green tick for successful upload directly after the MOVE /remote.php/dav/uploads/tobi/2372184706/.file line in access.log. So maybe the android app could use the same mechanism as the Ubuntu Nextcloud sync client? |
Nothing really. |
As this hits me now as well and I unsuccessfully tried to fiddle a little on the server timeout settings - is there any hint, which timeout affects this? |
i am also affected by this, running nextcloud on a VM on my server with nginx. I don't have issues uploading files via PC-Browser but always with the android-app for big files which results in high bandwidth usage (every upload is retried) and high IO load on the server. Is there any infor which variable i can tweak on the server side? of course i could always recompile the app (apk) to get this running (if somebody points me to the correct setting for the timeout :-) ). |
Android (and all other clients) just rely on server chunked upload option. |
My minor question to this was: Which timeout is to be increased? Could not yet manage to figure out this. |
afaik i increased all timeouts for nginx and php-fpm. still the uploads fail on big files. so it would be good to know which values to increase on server-side. the logs don't show anything relevant on the server side. maybe i am wrong but i get the impression that the timeout is on the android app as suggested above?
as said this does only happen on this client. i.e. the web-client is working fine for files that are pretty big (16GB and more on my machine) maybe i can give you access to VM running this config?. |
can someone please tell me what variable to change to increase the timeout? i will happily provide another APK so this will be usable until a proper fix has been applied. |
I moved over to FolderSync https://play.google.com/store/apps/details?id=dk.tacit.android.foldersync.lite for my Signal backup uploads and have not had any fail where before everyone failed while using Nextcloud android app so there is a way to program auto upload to handle uploads of big files. |
Any updates on this? I am getting tons of duplicate video files being uploaded because of this... |
I think it's here based on this old commit : nextcloud/android-library@7d83efa |
Thanks, I will check that on the weekend! |
Looks like the file structure has changed quite a bit since 2016, I found this in the current version which looks similar but I can't see the timeout: https://github.com/nextcloud/android-library/blob/master/src/main/java/com/owncloud/android/lib/resources/files/ChunkedFileUploadRemoteOperation.java |
This looks promissing though : nextcloud/android-library#696 |
I am currently using a fix for this that I pushed here: |
Any chance of a precompiled APK for Android? |
good work! i checked the commit and this seems pretty valid to me! :-) i will compile and test it later on. @gomme600 although not advised, i can provide a prebuilt APK then. but this is a security concern to install an APK from a "stranger" |
@minfaer do you mind creating a PR with your changes? This will automatically compile an apk that we will be able to test. Thank you! :) |
Oh I see, since the change is in the library I fear the PR in the anddroid app would need to point to that specific branch to be able to automatically compile the apk correctly as long as the change isn't officially part of the library... |
@szaimen I can file the pull request for the library any time - I was hoping on a "go ahead"-like comment from a maintainer in nextcloud/android-library#696, as called for in the readme about the development process, though... Alternatively, I could create a pr to the app pointing to my branch on jitpack exclusively for the automatic compilation of the apk, but I am not sure if that would be good manners.... @Ryk97 You can just follow the instructions on the app repo and clone my library branch. In more detail:
|
@minfaer great! testing the upload right now, seems good so far. I hope this will make it into the official repo - having the same algorithm applied for desktop and mobile is the best way IMHO! |
I think this would be fine for testing purposes 👍 |
i uploaded a debug build here: https://www.dropbox.com/s/rfcfxdnmjzbdyn8/nextcloud-upload-fix_3.17.0_generic-debug-30170090.apk?dl=1 This build is based on the 3.17.0 version of the app and 2.7.0 of the android-libraries, just applied the patch from @minfaer to only use this, if you really know what you are doing. installing unknown apps is a big risk! just for testing purposes! A better way is to recompile the app yourself as described here: #5609 (comment) Thanks @minfaer for the patch! so far it's working great. |
For me this is still an issue on two different devices with v3.19.0. Still connection error after ~60 sec after 100% upload. File appears on the server shortly after. I tried to tune the server and avoid any timeout issues. No luck so far. |
I still had problem getting it to work after the update until I managed to tune timeout settings both in my Nextcloud Apache conf and my reverse proxy Apache conf to keep the connection active until my slow server managed to finish processing my 3+ gb file. I don't really remember what I did but this is one snippet of code I tested and I still have in my conf:
I also added:
To the end of my ProxyPass line in my reverse proxy server. I hope this can get you started in the right direction :) |
@SigLinJo now it works, Thank you! |
This comment was marked as off-topic.
This comment was marked as off-topic.
@SigLinJo My testfile is a Signal Backup around 5 GB. Interesting is also that sometimes the Server has the error, when i look in my files it is, but only has a size of around 40-50% of the original one. [no app in context] Warnung: Sabre\DAV\Exception\NotFound: File with name /Test/signal-********.backup could not be located at <>
HEAD /remote.php/dav/files///Test/signal-***.backup Anyone an idea? |
Steps to reproduce
Expected behaviour
Actual behaviour
Environment data
Android version:
LineageOS 17.1
(I observe this behaviour on several devices, all running LineageOS versions 16 and 17.1)
Device model:
Xiaomi MiA2, Xiaomi Mi5, Xiaomi Redmi Note 7
Stock or customized system:
customized
Nextcloud app version:
3.10.1
Nextcloud server version:
18.0.1
Logs
Web server error log
Nextcloud log (data/nextcloud.log)
NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate
This seems similar to Bug #2637.
The server in question has decent cpu and ram specs. The I/O performance for the data disk isn't great, and the 30s window only allows assembly of files up to around 600mb, more than that the upload fails.
The text was updated successfully, but these errors were encountered: