docker icon indicating copy to clipboard operation
docker copied to clipboard

"Error when assembling chunks, status code 502" when uploading huge files

Open MartiniMoe opened this issue 6 years ago • 8 comments

When uploading huge files (> 4GB) via the webinterface the following error occurs after the upload finished: Error when assembling chunks, status code 502 I've found hints changing the PHP timeout etc, but I dont know how to do that with the docker-compose.yml

MartiniMoe avatar Feb 12 '20 11:02 MartiniMoe

Hi, I have the same issue here. Did you manage to solve this problem? In my case I get the 502 when trying to assemble 38 chunks of 100Mb each. I have already set a high memory limit, increased all possible timeout related values, and still the script returns a 502 after 3 seconds.

ouissla avatar Apr 01 '20 00:04 ouissla

I have the same issue, but already with 1GB Files. I use S3 storage as the primary storage. Without S3 it works fine. The weird thing is though, that the file is uploaded completely after page refresh. I also can see it in the S3 Storage. While uploading it stores 10MB chunks, after page refresh there is a 1GB file.

jorisbaiutti avatar Sep 09 '20 06:09 jorisbaiutti

any luck of getting things to work out of the box ?

killarbyte avatar Sep 09 '20 22:09 killarbyte

any luck of getting things to work out of the box ?

If you mean without s3 storage, yes that works. I used this for the setup https://github.com/nextcloud/docker/tree/master/.examples/docker-compose/with-nginx-proxy/mariadb/fpm

jorisbaiutti avatar Sep 10 '20 06:09 jorisbaiutti

@jorisbaiutti I have the same problem, just that it sometimes doesn't store the file/reports the wrong size @ouissla How did you increase these limits? I'm using the conteainer with the apache inside

supermar1010 avatar Jan 25 '21 19:01 supermar1010

Having the exact same issue. Steps to reproduce:

  • Nextcloud 20 or 21 docker image
  • Configure S3 as primary storage according to the nextcloud documentation
  • upload a 5GB file ---> Error when assembling chunks, status code 502

sebastiansterk avatar Mar 03 '21 17:03 sebastiansterk

Guys, I was able to fix the issue. The problem is that when the upload finished, Nextcloud is trying to assemble the chunks. The frontend sends a MOVE request to the Nextcloud server, this request runs in a timeout. The default timeout for ProxyTimeout is the value of Timeout. Default value is set to 60 seconds. In this case, nextcloud cannot finish assembling the chunks within the defined timeout of your Reverse Proxy. To fix this issue you have to increase the ProxyTimeout and/or Timeout of your reverse proxy that is routing the requests to your nextcloud docker container. I'm using apache, so adding the following part to my httpd.conf fixed the issue for me (restart of apache is required):

Timeout 2400
ProxyTimeout 2400

sebastiansterk avatar Mar 03 '21 18:03 sebastiansterk

Thanks a lot! Guess this can get closed then :)

MartiniMoe avatar Mar 04 '21 22:03 MartiniMoe