desktop icon indicating copy to clipboard operation
desktop copied to clipboard

"Connection closed" message when syncing files larger then +- 100Mb

Open Jhutjens92 opened this issue 3 years ago • 156 comments
trafficstars

I have my nextcloud installation running in a docker container. It's connected to a MySQL DB (another docker container) and exposed to the web using SWAG. All the relevant php.ini/config files have the following settings

  • client_max_body_size set 0
  • upload_max_filesize 16G
  • post_max_size 16G
  • max_input_time 3600
  • max_execution_time 3600

Uploading via webserver is no problem but whenever i try to sync the same file using the windows sync client i receive a "Connection Closed"

Expected behaviour

Files should just upload to the nextcloud server.

Actual behaviour

Files aren't being uploaded and client throws an error:

Steps to reproduce

  1. Run nextcloud in docker container.
  2. Use SWAG (docker container) to link (sub)domain to nextcloud
  3. Upload large file (larger then 100Mb) (in my case a .mp4)
  4. See response in client log.

Client configuration

Client version: 3.4.2

Operating system: Microsoft Windows 10 Pro (10.0.19041 Build 19041)

OS language: Dutch

Installation path of client: C:\Program Files\Nextcloud

Nextcloud version: Nextcloud Hub II (23.0.0)

Storage backend: Local server storage

Logs

  1. Client logfile: Client_20220213_2039_owncloud.log.0.txt

  2. Web server error log: N.A.

  3. Server logfile: nextcloud log (data/nextcloud.log): nextcloud.log

(ignore the failed login)

Jhutjens92 avatar Feb 13 '22 21:02 Jhutjens92

are you using Cloudflare in your setup? I'm running into the same issue because of Cloudflare's 100 MB upload limit and the client not seeming to chunk. https://github.com/nextcloud/desktop/issues/4271

metheis avatar Feb 13 '22 22:02 metheis

are you using Cloudflare in your setup? I'm running into the same issue because of Cloudflare's 100 MB upload limit and the client not seeming to chunk. #4271

I am using cloudflare for SSL on SWAG with my domain. I didn't even stop to think about it. Did you figure out a way around it/fix? Nextcloud is chunking the file (correct me if I'm wrong) so something is not working as intented. I could turn off cloudflare for my subdomain but that would defeat the purpose of using it in the first place.

Jhutjens92 avatar Feb 13 '22 22:02 Jhutjens92

Right, agreed, I prefer to keep Cloudflare on. What I found works is if I uninstall the client (I had version 3.4.1) and reinstall version 3.3.6 from October, the issue goes away. I think the issue must be with how the newer client chunks (or lack there of).

metheis avatar Feb 13 '22 23:02 metheis

Version 3.3.6 is confirmed to be working. Just tested it out. So something in 3.4.1 broke the chunking.

Jhutjens92 avatar Feb 14 '22 07:02 Jhutjens92

@allexzander is it possible you could weigh in on this? Thank you for your help

metheis avatar Feb 14 '22 17:02 metheis

same here

xt0x1c avatar Feb 15 '22 11:02 xt0x1c

I can confirm that I have the same issue. I recently upgraded to 3.4.2 and my client app would not sync files larger than 100mb. I just downgraded to 3.3.6 and it works without any issues. I am using CloudFlare, MacOS Monterey, and the latest NextCloud server.

tusharraval102 avatar Feb 16 '22 20:02 tusharraval102

@Valdnet or @er-vin it seems like a number of users are running into this issue starting with 3.4.1 (and still present in 3.4.2). Any thoughts on what change lead to this?

metheis avatar Feb 16 '22 21:02 metheis

@nextcloud/desktop Is it possible to check the described error in issue. Users still have a problem with this. Thanks.

Valdnet avatar Feb 17 '22 13:02 Valdnet

I'm on 3.4.1 as well and utilize SSL via CF with Nginx. Running into the same issue as described.

ThatTallGuy21 avatar Feb 18 '22 14:02 ThatTallGuy21

I was experiencing the same issue with 3.4.2.

v3.3.6 working well.

Vixavius avatar Feb 22 '22 01:02 Vixavius

This is happening to me, I am using cloudflare and the 100MB limit doesn't affect my upload but the client is bringing up errors when uploading files, i'm trying 3.3.6 now to see if this is just a bug

ghost avatar Feb 24 '22 14:02 ghost

Yep I can confirm on my side aswell version 3.3.6 works fine then latest client broke chunking and possibly keep alive "closing connection"

ghost avatar Feb 26 '22 08:02 ghost

Can confirm that 3.4.3 does not work for me, but 3.3.6 does.

mitohund avatar Mar 17 '22 21:03 mitohund

Confirmed happening here too

Rami-Pastrami avatar Mar 18 '22 17:03 Rami-Pastrami

I'm suprised no one has picked this up yet from nextcloud desktop team. No mention of it in the new 3.5.0 RC1

Jhutjens92 avatar Mar 25 '22 06:03 Jhutjens92

ping @mgallien @camilasan @claucambra

Valdnet avatar Mar 25 '22 07:03 Valdnet

Same issue here with client v3.4.3 on Linux (Manjaro) + cloudflare.

Kn-ut99 avatar Mar 31 '22 08:03 Kn-ut99

Same here on Android. If in cloudflare I check DNS only - it works, switch back to proxied - dosen't work.

relains avatar Apr 02 '22 07:04 relains

Dropping a comment here to say I'm experiencing the same issue as above and am also using cloudflare.

Edit: I'll add that reverting to 3.3.6 also fixed the issue for me and all my large files upload just fine now

WasabiCarpet avatar Apr 11 '22 15:04 WasabiCarpet

I randomly put this thing into nextcloud.cfg (in [General] section) and somehow it works for me. (I don't know if it works for other people or not)

chunkSize=10000000
minChunkSize=1000000
maxChunkSize=50000000
targetChunkUploadDuration=6000

Note: I use version 3.4.3 on Manjaro Linux Note 2: I read from https://docs.nextcloud.com/desktop/3.0/advancedusage.html because, in the documentation, I didn't see [General] section in 3.4 🤔

PaperMemo avatar Apr 13 '22 16:04 PaperMemo

that is interesting, if that works for others perhaps we can update the documentation at least.

jospoortvliet avatar Apr 14 '22 08:04 jospoortvliet

I randomly put this thing into nextcloud.cfg (in [General] section) and somehow it works for me. (I don't know if it works for other people or not)

chunkSize=10000000
minChunkSize=1000000
maxChunkSize=50000000
targetChunkUploadDuration=6000

Note: I use version 3.4.3 on Manjaro Linux Note 2: I read from https://docs.nextcloud.com/desktop/3.0/advancedusage.html because, in the documentation, I didn't see [General] section in 3.4 🤔

I confirm that this works for Nextcloud 3.4.4 (Windows).

weeix avatar Apr 14 '22 09:04 weeix

I randomly put this thing into nextcloud.cfg (in [General] section) and somehow it works for me. (I don't know if it works for other people or not)

chunkSize=10000000
minChunkSize=1000000
maxChunkSize=50000000
targetChunkUploadDuration=6000

Note: I use version 3.4.3 on Manjaro Linux Note 2: I read from https://docs.nextcloud.com/desktop/3.0/advancedusage.html because, in the documentation, I didn't see [General] section in 3.4 thinking

I too can confirm that this solved the issue (Nextcloud client 3.4.3, Manjaro). Only setting "chunkSize" does not work, I had to set all 4 settings in the config file. I don't really understand why, but hey, it works. Thank you :heart:

Kn-ut99 avatar Apr 14 '22 09:04 Kn-ut99

I can confirm this fixes it on Nextcloud 4.4.4 on Windows 10.

The only setting I needed was this: targetChunkUploadDuration=6000

That matches what I noticed empirically, which was that the syncing failed and restarted about every 6 seconds.

Iirc from the log, the default was like 20 or 28 seconds.

Gwindalmir avatar Apr 14 '22 09:04 Gwindalmir

review/feedback on the above welcome!

jospoortvliet avatar Apr 14 '22 13:04 jospoortvliet

The only setting I needed was this: targetChunkUploadDuration=6000

What surprises me is that according to the docs, this is the default...

jospoortvliet avatar Apr 14 '22 13:04 jospoortvliet

targetChunkUploadDuration=6000

I'm confused as to where you would put this setting when running Nextcloud in Docker since the aformentioned .cfg file does not seem to exist.

Jhutjens92 avatar Apr 14 '22 18:04 Jhutjens92

I was mistaken, I reverted the change to check, and the default is 60000...

2022-04-14 11:09:41:146 [ info nextcloud.sync.propagator.upload.ng C:\Users\sysadmin\AppData\Local\Temp\2\windows-9586\client-building\desktop\src\libsync\propagateuploadng.cpp:418 ]: Chunked upload of 10000000 bytes took 2552 ms, desired is 60000 ms, expected good chunk size is 235109717 bytes and nudged next chunk size to 122554858 bytes

Gwindalmir avatar Apr 14 '22 18:04 Gwindalmir

targetChunkUploadDuration=6000

I'm confused as to where you would put this setting when running Nextcloud in Docker since the aformentioned .cfg file does not seem to exist.

It took me a while to figure that out too, it goes on the client, not the server. I don't know if it's already possible, but it would be nice to set the preferred chunking settings on the server-side, so it propagates to all clients.

Gwindalmir avatar Apr 14 '22 18:04 Gwindalmir