Error when assembling chunks, status code 504

Hello CICfe, the value is default (0), so if I understand well, it should not cause a timeout as it is disabled.

The main Apache Timeout was set to 10… :sweat:
I raised it to 3600 and the error message disappeared.

1 Like

Hi there,

same message, same behavior but I could not fix this issue with raising timeout.

First I set in php.ini

max_execution_time = 21600

Then in /etc/apache2/apache2.conf I set

Timeout 21600

Last thing I tried was adding

fastcgi_read_timeout 1d;
proxy_read_timeout 1d;

in the http section of /etc/nginx/nginx.conf

Nothing worked.
Can somebody tell me what I am missing?

Best regards

Nextcloud version: 16.0.3
Operating system and version : Ubuntu 16.04
Apache or nginx version: Apache/2.4.18 and nginx/1.14.2
PHP version: 7.3.7

Is this the first time you’ve seen this error?: Yes

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => 'id',
  'passwordsalt' => 'secret',
  'secret' => 'victoria',
  'trusted_domains' =>
  array (
    0 => '',
  'datadirectory' => '/opt/nextcloud/data',
  'overwrite.cli.url' => '',
  'dbtype' => 'mysql',
  'version' => '',
  'dbname' => 'db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'admin',
  'dbpassword' => 'admin',
  'installed' => true,
  'maintenance' => false,
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'my',
  'mail_domain' => 'adress',
  'mail_smtpsecure' => 'tls',
  'mail_smtphost' => 'smtp',
  'mail_smtpport' => '587',
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpauth' => 1,
  'app_install_overwrite' =>
  array (
    0 => 'calendar',
  'filelocking.ttl' => 21600,
  'updater.secret' => 'secret',

Yep, I can confirm - I had to increase and set TimeOut 3600 in the global httpd.conf to resolve the same problem. I think this should be added the the Admin documentation and somehow properly explained, TimeOut setting is not even present in the default apache conf file in Fedora/CentOS.


sorry for popping up this issue again, but where do I raise the timeout on nginx?
and what is the setting for it?


For my nginx setup it was enough to set the timeout to 10 min (600 seconds).

PHP FPM config

Add this line:

request_terminate_timeout = 600

Location of the config on my system: /usr/local/etc/php-fpm.d/nextcloud.conf

nginx config

Around/below the line fastcgi_pass php-handler; add this line:

fastcgi_read_timeout 600;

Location of my nginx conf: /usr/local/etc/nginx/conf.d/nextcloud.conf

I’m curious to figure out why this is taking so long tho, so made a thread about it:

1 Like

just updated to 20.0.02, still getting the [Error when assembling chunks, status code 504] error

Had the same issue. When uploading is finished i timed 30 seconds until i got the 504 error. Tried all apache en php settings mentioned, none worked.

Responsible was a HAProxy backend setting:
default is 30seconds:

timeout connect  30000
timeout server  30000

I hope you are not bored with this topic. I would like to ask for assistance concerning same issue. I have OMV5 on my raspberry pi and installed nginx and nextcloud via docker. At the end of uploading big file (8GB in my case) to NextCloud I am seeing “Error when assembling chunks, status code 504”. What are the full paths to config files you are advising to change on raspberry pi? Is “nano” ok for editing operation?

I found /etc/php/7.3/fpm/php.ini
I found /etc/nginx/nginx.conf
I didn’t find /etc/apache2/apache2.conf - i see only “conf-available” and “mods-available”
Where is global httpd.conf? Or should it be apache2.conf

I hope you tell me what worked with you guys. Thanks.

Where can I find them?

Has anybody ever managed to fix this when using nextcloud in a docker configuration behind NPM? Because I cannot for the life of me find the proper config files, I can find a .htaccess file in the nextcloud docker volume folder, but there’s no apache, nginx, or php.ini config files to be found at any default locations on the system, nor in the mounted container itself, very odd

Is that the *.conf file in /data/compose/*/data/nginx/proxy_host/ ?

there has to be a vhost conf file inside your npm container. can’t tell you right now the exact path, maybe inside a folder named “sites-enabled”…?
right now i’m only running apache proxy, I will take a look at NPM this weekend.

inside the nextcloud container, you have to change php-local.ini:
max_execution_time = 3600
post_max_size = 21G
upload_max_filesize = 20G

and also nginx.conf:
httpd {
fastcgi_connect_timeout 60;
fastcgi_send_timeout 1800;
fastcgi_read_timeout 1800;

I’m using the image: linuxserver/nextcloud
restart both containers

Hm, I cannot seem to find that in my npm container, no idea why, however I have some numbered .conf files for each container in the nginx proxy_host folder, could these be the correct ones? An example would be looking like this (changed some identifiable info):



server {
set $forward_scheme http;
set $server “”;
set $port 553;

listen 80;
listen [::]:80;

listen 443 ssl http2;
listen [::]:443 ssl http2;


Let’s Encrypt SSL

include conf.d/include/letsencrypt-acme-challenge.conf;
include conf.d/include/ssl-ciphers.conf;
ssl_certificate /etc/letsencrypt/live/npm-3/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-3/privkey.pem;

Block Exploits

include conf.d/include/block-exploits.conf;

HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

add_header Strict-Transport-Security “max-age=63072000; preload” always;

# Force SSL
include conf.d/include/force-ssl.conf;

access_log /data/logs/proxy-host-3_access.log proxy;
error_log /data/logs/proxy-host-3_error.log warn;

location / {

HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

add_header Strict-Transport-Security “max-age=63072000; preload” always;

# Proxy!
include conf.d/include/proxy.conf;



include /data/nginx/custom/server_proxy[.]conf;

looks right!

put it inside */conf.d/include/proxy.conf

proxy_connect_timeout 1d;
proxy_send_timeout 1d;
proxy_read_timeout 1d;
send_timeout 1d;

Hm in that case, I may have tried it already, but apparently I appended it to the end of the file instead of placing it inside that area, I’ll have to get back with you on that, I’ll still have to find the nginx.conf file then for the fastrcgi timeouts, or is that supposed to be the same file?

Edit: It seems placing it in that section worked, apparently that was what I did wrong, I’ve only tested it once so I’m not gonna cheer too soon, but it looks hopeful, you’re a lifesaver mate :+1:t2: thank you

1 Like

you’re welcome! :wink:
in case of aborting after 60 seconds into “processing”, then change following for image linuxserver/nextcloud:

httpd {
fastcgi_connect_timeout 60;
fastcgi_send_timeout 1800;
fastcgi_read_timeout 1800;

1 Like

I changed mine to 3600 and I still get the same error.

One of NextCloud’s core functions - uploading and storing large files and out of the box NextCloud can’t handle it. It’s disgraceful if you ask me.

I’m wondering why such an essential thing like uploading a file doesn’t work out of the box. first I have to increase the max file size somewhere deep in the system internals. then this error happens and there is no 1 simple solution. why is all open source so nerd oriented? these are rhetorical questions I ask myself and the more I ask the more I’m looking into returning back to good old FTP :slight_smile: