Nextcloud 17 Upload Large Files Error

[details=“Support intro”]

Hi:
I have installed Nextcloud 17 on my Rasberry pi 4 with 4 GB Ram.
Using PHP 7.3 and Apache with Mariadb

When i upload a Large file, the Interface tells me Errors
( With the Desktop Client all is working same with flow uploads )

I tryed to edit the php.ini, htaccess and config.php with
php_value upload_max_filesize 20G
php_value post_max_size 20G

on php.ini
upload_max_filesize 20G
post_max_size 20G

Sorry for my bad english, but i hope you can help. 3 Days Googel havent helped me ^^

( I changed ip and Database for this post)
config.php

<?php
$CONFIG = array (
  'instanceid' => 'ocnhgcvrejia',
  'passwordsalt' => '***',
  'secret' => '*****',
  'trusted_domains' => 
  array (
    0 => 'networkip',
    1 => 'externaldns',
  ),
  'datadirectory' => '/media/hdd/data',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'tempdirectory' => '/media/hdd/data/tmp',
  'dbtype' => 'mysql',
  'version' => '17.0.0.9',
  'overwrite.cli.url' => 'http://networkip/nextcloud',
  'dbname' => 'dbname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'user',
  'dbpassword' => 'mypw',
  'installed' => true,
  'app_install_overwrite' => 
  array (
    0 => 'dashboard',
    1 => 'extract',
    2 => 'folderplayer',
    3 => 'video_converter',
    4 => 'documents',
    5 => 'weather',
  ),
);

Log of the Interface:

Sabre\DAV\Exception: Error while copying file to target location (copied bytes: 0, expected filesize: -1 )

    /var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 156:

    OCA\DAV\Connector\Sabre\File->put(null)

    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 316:

    OCA\DAV\Connector\Sabre\Directory->createFile("the-file.rar", null)

    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 130:

    Sabre\DAV\Tree->copyNode(OCA\DAV\Upload\FutureFile {}, OCA\DAV\Files\FilesHome {}, "the-file.rar")

    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 161:

    Sabre\DAV\Tree->copy("uploads/Pfa ... e", "files/Pfann ... v")

    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 642:

    Sabre\DAV\Tree->move("uploads/Pfa ... e", "files/Pfann ... v")

    <<closure>>

    Sabre\DAV\CorePlugin->httpMove(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

    /var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:

    call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])

    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:

    Sabre\Event\EventEmitter->emit("method:MOVE", [ Sabre\HTTP ... }])

    /var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:

    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

    /var/www/html/nextcloud/apps/dav/lib/Server.php - line 317:

    Sabre\DAV\Server->exec()

    /var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

    OCA\DAV\Server->exec()

    /var/www/html/nextcloud/remote.php - line 163:

    require_once("/var/www/ht ... p")

Apache error LOG

[Tue Oct 15 00:00:54.739649 2019] [mpm_prefork:notice] [pid 14112] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Tue Oct 15 00:00:54.739729 2019] [core:notice] [pid 14112] AH00094: Command line: '/usr/sbin/apache2'
[Tue Oct 15 08:48:22.356069 2019] [php7:error] [pid 15028] [client 212.241.111.9:49294] script '/var/www/html/index.php' not found or unable to stat
[Tue Oct 15 11:54:06.992957 2019] [mpm_prefork:notice] [pid 14112] AH00169: caught SIGTERM, shutting down
[Tue Oct 15 11:54:07.308117 2019] [mpm_prefork:notice] [pid 20898] AH00163: Apache/2.4.38 (Raspbian) configured -- resuming normal operations
[Tue Oct 15 11:54:07.308293 2019] [core:notice] [pid 20898] AH00094: Command line: '/usr/sbin/apache2'

apache 2 access log:

192.168.178.45 - - [15/Oct/2019:13:20:39 +0100] "PUT /nextcloud/remote.php/dav/uploads/Pfann/web-file-upload-2c64d98ecb0873d3178e037517bf8cd1-1571142040304/0 HTTP/1.1" 201 612 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
::1 - - [15/Oct/2019:13:20:40 +0100] "OPTIONS * HTTP/1.0" 200 128 "-" "Apache/2.4.38 (Raspbian) (internal dummy connection)"
192.168.178.45 - - [15/Oct/2019:13:20:40 +0100] "PUT /nextcloud/remote.php/dav/uploads/Pfann/web-file-upload-2c64d98ecb0873d3178e037517bf8cd1-1571142040304/10485760 HTTP/1.1" 201 612 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
192.168.178.45 - - [15/Oct/2019:13:20:41 +0100] "PUT /nextcloud/remote.php/dav/uploads/Pfann/web-file-upload-2c64d98ecb0873d3178e037517bf8cd1-1571142040304/20971520 HTTP/1.1" 201 612 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
::1 - - [15/Oct/2019:13:20:42 +0100] "OPTIONS * HTTP/1.0" 200 128 "-" "Apache/2.4.38 (Raspbian) (internal dummy connection)"
192.168.178.45 - - [15/Oct/2019:13:20:41 +0100] "PUT /nextcloud/remote.php/dav/uploads/Pfann/web-file-upload-2c64d98ecb0873d3178e037517bf8cd1-1571142040304/31457280 HTTP/1.1" 201 612 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"
::1 - - [15/Oct/2019:13:20:44 +0100] "OPTIONS * HTTP/1.0" 200 128 "-" "Apache/2.4.38 (Raspbian) (internal dummy connection)"
::1 - - [15/Oct/2019:13:20:45 +0100] "OPTIONS * HTTP/1.0" 200 128 "-" "Apache/2.4.38 (Raspbian) (internal dummy connection)"
192.168.178.45 - - [15/Oct/2019:13:20:43 +0100] "PUT /nextcloud/remote.php/dav/uploads/Pfann/web-file-upload-2c64d98ecb0873d3178e037517bf8cd1-1571142040304/41943040 HTTP/1.1" 201 612 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0"

  • How big is the File? More than 4 GB?
  • How you upload it? Via Client sync, via GUI (I think so), or via WebDav?

My knowledge that this will not work as you have only 4GB of RAM. So you will be limited to 4 GB.

P.S. did you checked this? Trouble uploading bigger files

The Error happen, if i upload it via the Browser ( Firefox )
The file is 11 Gb ( on 4GB it stops )
I hoped with the /media/hdd/data/tmp file it will be fixed

“My knowledge that this will not work as you have only 4GB of RAM. So you will be limited to 4 GB.”

My Testrootserver ( Vserver ) have 8 GB of Ram and it works, so i thought it works with the Raspberry too

Maybe the Problem could be the External Drive?

I already changed the upload size and the other option in the php.ini, htaccess and user.ini

but i used the grep commands and see

/etc/php/7.3/cli/php.ini:memory_limit = -1
/etc/php/7.3/apache2/php.ini:memory_limit = 1024M
/etc/php/7.3/cgi/php.ini:memory_limit = 128M

i will them change and try again. I will report the result

Havent worked, still the error

RAM has nothing with external drive :wink: You simply hit the RAM limit when upload so big file. When you upload files via GUI it will use RAM to upload full file first and then move it to drive. There is even Application exist to solve this limitation of RAM and make it possible to upload huge files.
Client has also no limitations, because doing chunking.
Via WebDAV you will have the same limitation.

Yes this App i tryed, but takes really long to upload

But what happen with the tmp file. isnt it possible that nextcloud loads it into a tmp file and then move it ?

chunking: Is there a way, to do it with the regular upload? I think i had read something about this.

and i dont understand why the ram blocks this, because my Vserver got 8 GB ram and i can upload large files.

It could be because it doing exactly this job: cut file into pieces/chunks, upload and merge…

You can address it to developers via Issues · nextcloud/server · GitHub. It was discussed at least here Allow chunked public upload · Issue #4109 · nextcloud/server · GitHub

Could be that you have swap file that extends you RAM. Or you can virtually extend you RAM with e.g. ZRAM. But this is not 100% sure.