Large file (4GB) upload fails on both webclient and app (flow upload error?)

Hello, I have a problem that is making nextcloud unusable. I need to store large files but it seems like it’s impossible to upload anything large. I can download, but not upload.

Steps I’ve taken to address the issue

I have searched both the nextcloud and owncloud servers and found several related topics. However, none of them have offered a solution that works. I have tried following the instructions here:
Nextcloud instructions https://docs.nextcloud.com/server/14/admin_manual/configuration_files/big_file_upload_configuration.html
Increasing max_chunk_size Nextcloud 13 chunking upload not working
All of the settings here: https://central.owncloud.org/t/expected-filesize-xxx-got-yyy-0/816

So far, nothing works. Anyone knows what else could be wrong?

Nextcloud version : 14.0.3
Operating system and version : Ubuntu 18.04.1 LTS
Apache or nginx version: Apache/2.4.29
PHP version: PHP 7.2.10
MySQL version: mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64)

The server is an amazon EC2 instance.

The issue you are facing:

Whenever I try to upload a large file (~4GB), uploading fails through either the app or the web browser. I get both of the below error messages:

Sabre\DAV\Exception\BadRequest: expected filesize 4199287209 got 1101824

Sabre\DAV\Exception: Error while copying file to target location (copied bytes: 548864, expected filesize: 10000000 )

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

No, it is very consistent.

Steps to replicate it:

On the browser

  1. Drag and drop a file or folder on to the website
  2. The upload starts
  3. Shortly after it fails with the above message.

On the application

  1. Create a folder sync.
  2. The app will download files from the server.
  3. Add a file on to the synced folder.
  4. The app will start the upload but eventually fails with the message “Connection closed”

The output of your Nextcloud log in Admin > Logging:

https://pastebin.com/kF2LrndY

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

https://pastebin.com/XqWqpjXZ

The output of your Apache log in /var/log/apache2/error.log:

https://pastebin.com/YmMKurR6

It seems php is cancelling the upload due to the max upload size restriction.
Under “Settings” => “Administration” => “File upload”, default is 512MB I think.
Make it larger than the largest files you expect to upload.

And also if that does not work, configure $nextcloud_home/.htaccess under the corresponding php version, i.e. 5 or 7, there are settings as well.

@Apollo, @Starfish thank you both but I’ve already changed both of those settings without luck. I have essentially solved the problem by installing SeaFile…

Have you also checked the settings in /etc/php.ini?

@Starfish Indeed I have!

This is very strange, and not something I have come across before. Glad you solved it but would still like to know why you couldn’t get it working on NC itself.

{"reqId":"wjeVWAIg0zL9uUdSEW33","level":3,"time":"2018-11-21T11:39:59+00:00","remoteAddr":"1.1.1.1","user":"vm","app":"no app in context","method":"PUT","url":"\/remote.php\/dav\/uploads\/vm\/2875465401\/00000000","message":{"Exception":"Sabre\\DAV\\Exception","Message":"Error while copying file to target location (copied bytes: 557056, expected filesize: 10000000 )","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre

It fails to copy file to the target location, do you use external storages? Or do you have the data folder on a different disk?

no app in context

I don’t know exactly what Nextcloud is missing. By any chance, is this an older setup where there could be stuff from an old app that is not running on the system any more? Just to make sure that it is not related to some old stuff, do you have the same problems on a new user?

I have seen in the configuration, that you disabled file locking:
'filelocking.enabled' => 'false',
But you have installed redis and could use it as a file locking cache.

@tflidd

Thank you for looking into this. The installation is fresh, yes. The storage is on an NFS volume… Is it your suggestion that the NFS volume connection is not stable enough for large files?

@tflidd Ah wait, you meant apps. i did uninstall flow upload…

I’m new to Nextcloud … but recently wanted to upload mail archives - btwn 20-35gb each. The uploads failed consistently … with Safari … but worked perfectly when I repeated the process with Firefox. Not sure why … but I’m not complaining :wink:

I have the same problem but when uploading via webdav via a network drive from windows. So this eliminates the suspicion of apache. Or not?