Can't upload a 3,7GB file

I use Nextcloud 20.0.0 with nginx. I modified php.ini:
max_execution_time = 7200

and /etc/nginx/sites-enabled/default:
proxy_connect_timeout 7200;
proxy_send_timeout 7200;
fastcgi_send_timeout 7200;
fastcgi_read_timeout 7200;

In WebUI is written, that maximum execution time ist set to 3600.

Why? The transfer of large files is interrupted after approx 1 hour.

The Flow Upload app might be a solution for you: https://apps.nextcloud.com/apps/flowupload.

Thanks for you answer.
But normally Nextcloud settings allow uploading big files if correctly configured. Is this a bug? Did I configured wrong?

I’m sure that there are some parameters to configure (do a search in the forum as this issue has been raised quite a few times). I myself am using the Flow Upload app as an alternative.

Thanks! I searched for 5 days and read a lot of threads. But I didn’t find the correct setup :frowning:

Check your php.ini file

memory_limit = 1024M
upload_max_filesize = 16G
post_max_size = 16G
max_input_time = 3600
max_execution_time = 3600
upload_tmp_dir = /var/www/html/data/upload_tmp
output_buffering = 0

My configuration:

/etc/php/7.3/fpm/php.ini

memory_limit = 2048M
upload_max_filesize = 20G
post_max_size = 20G
max_input_time = 60
max_execution_time = 7200
;upload_tmp_dir =
output_buffering = 4096

I installed flowupload:

Clone the contents of the repository into your  `apps`  directory and rename it to  `flowupload` , if necessary. Otherwise simply download it from the Nextcloud app store within your Nextcloud instance: https://apps.nextcloud.com/apps/flowupload

and:

npm ci
npm run build

Now NexCloud dosen’t start :anguished:
How could I remove again?

There is no need to change your php.ini. Nextcloud overrides the values anyway. In lib/base.php:

 //try to set the maximum filesize to 10G
@ini_set('upload_max_filesize', '10G');
@ini_set('post_max_size', '10G');
@ini_set('file_uploads', '50');

but also in the same file

@ini_set('max_execution_time', '3600');

This is 3600 seconds = 1h.

So it is not about the size, it is just that any execution is simply stopped after 1h.

Unless you can simply increase your upload bandwidth, the solution is to increase the max_execution_time.

AFAICS there is no way to increase it, except edit lib/base.php manually and change that value. Of course you would have to do this again after every update.

WebUI and official clients upload files in chunks (in small pieces) hence the max upload size is not so important.

Make sure the timeouts for the webserver are high enough.

Thanks! I also changed @set_time_limit(7200); at lib/base.php

But it still dosen’t work. I get the following error message:
Connection terminated (skipped due to earlier error, try again in 2 hours)

Where could I find a log file? hopefully I could find some hints there.

Where and when do you get this message?

Regarding the logfile: https://docs.nextcloud.com/server/stable/admin_manual/issues/general_troubleshooting.html?highlight=logfile#nextcloud-logfiles

Where and when do you get this message?

I use Nextcloud at a MacBook, and if I click on the Icon in the menu bar, there is a popup window.

Check your /etc/nginx/sites-available/nextcloud

There should be client_max_body_size
So edit it

# set max upload size
    client_max_body_size 20480M;
    fastcgi_buffers 64 4K;

directory /etc/nginx/sites-available/ is empty. I have a file:
/etc/nginx/sites-enabled/default

It is set:

set max upload size

client_max_body_size 20G;
fastcgi_buffers 64 4K;

  1. i have asked you to check the logfile which you didn’t do.

  2. “icon in the menu bar” is not a precise description of the symptoms. You should be more specific or provide screenshots.

Under these circumstances I am out. We can only help you, if you provide us with a useful and acurrate problem description and answer relevant questions. It is not my responsibility to ask you for information several times. Good luck.

Sorry, I did, but forgot to give you an answer! There were only entries from 5 days ago. I added in “/var/www/html/config/config.php”
‘log_type’ => ‘file’,
‘logfile’ => ‘nextcloud.log’,
‘loglevel’ => 3,
‘logdateformat’ => ‘F d, Y H:i:s’,

to get more information. I find this line (sorry, is extremely long!):

{"reqId":"M0VVRYvDne55a7nodwE7","level":3,"time":"2020-10-10T13:44:53+00:00","remoteAddr":"145.253.237.208","user":"User1","app":"PHP","method":"MOVE","url":"/remote.php/dav/uploads/User1/2312646122/.file","message":{"Exception":"Error","Message":"file_put_contents(): content truncated from 3965190144 to 2147483647 bytes at /var/www/html/lib/private/Files/Storage/Local.php#560","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"file_put_contents(): content truncated from 3965190144 to 2147483647 bytes","/var/www/html/lib/private/Files/Storage/Local.php",560,{"path":"files/PC1/Kartenmaterial 2019/Sicherung.img","stream":null,"size":null}]},{"file":"/var/www/html/lib/private/Files/Storage/Local.php","line":560,"function":"file_put_contents","args":["/home/pi/daten/User1/files/PC1/Kartenmaterial 2019/Sicherung.img",null]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":631,"function":"writeStream","class":"OC\\Files\\Storage\\Local","type":"->","args":["files/PC1/Kartenmaterial 2019/Sicherung.img",null,null]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","line":207,"function":"writeStream","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["files/PC1/Kartenmaterial 2019/Sicherung.img",null]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","line":155,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[null]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":311,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["Sicherung.img",null]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":135,"function":"copyNode","class":"Sabre\\DAV\\Tree","type":"->","args":[{"__class__":"OCA\\DAV\\Upload\\FutureFile"},{"__class__":"OCA\\DAV\\Connector\\Sabre\\Directory"},"Sicherung.img"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":167,"function":"copy","class":"Sabre\\DAV\\Tree","type":"->","args":["uploads/User1/2312646122/.file","files/User1/PC1/Kartenmaterial 2019/Sicherung.img"]},{"file":"/var/www/html/apps/dav/lib/Upload/ChunkingPlugin.php","line":95,"function":"move","class":"Sabre\\DAV\\Tree","type":"->","args":["uploads/User1/2312646122/.file","files/User1/PC1/Kartenmaterial 2019/Sicherung.img"]},{"file":"/var/www/html/apps/dav/lib/Upload/ChunkingPlugin.php","line":77,"function":"performMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->","args":["uploads/User1/2312646122/.file","files/User1/PC1/Kartenmaterial 2019/Sicherung.img"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->","args":["uploads/User1/2312646122/.file","files/User1/PC1/Kartenmaterial 2019/Sicherung.img"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":632,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeMove",["uploads/User1/2312646122/.file","files/User1/PC1/Kartenmaterial 2019/Sicherung.img"]]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:MOVE",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":325,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":167,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh) mirall/3.0.2git (build 3559) (Nextcloud)","version":"20.0.0.9"}

I agree, but that’s the way I get the information, sorry. Hope log-file helps better!

It seems to be originating in SabreDAV, not Nextcloud directly. Maybe solvable by tuning PHP parameters. Check this out, maybe you’ll find a solution: https://github.com/nextcloud/server/issues/16431

Here is a formatted output, for others looking at this (I’m not happy with Nextcloud loggin in JSON):

{
  "reqId": "M0VVRYvDne55a7nodwE7",
  "level": 3,
  "time": "2020-10-10T13:44:53+00:00",
  "remoteAddr": "145.253.237.208",
  "user": "User1",
  "app": "PHP",
  "method": "MOVE",
  "url": "/remote.php/dav/uploads/User1/2312646122/.file",
  "message": {
    "Exception": "Error",
    "Message": "file_put_contents(): content truncated from 3965190144 to 2147483647 bytes at /var/www/html/lib/private/Files/Storage/Local.php#560",
    "Code": 0,
    "Trace": [
      {
        "function": "onError",
        "class": "OC\\Log\\ErrorHandler",
        "type": "::",
        "args": [
          2,
          "file_put_contents(): content truncated from 3965190144 to 2147483647 bytes",
          "/var/www/html/lib/private/Files/Storage/Local.php",
          560,
          {
            "path": "files/PC1/Kartenmaterial 2019/Sicherung.img",
            "stream": null,
            "size": null
          }
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Local.php",
        "line": 560,
        "function": "file_put_contents",
        "args": [
          "/home/pi/daten/User1/files/PC1/Kartenmaterial 2019/Sicherung.img",
          null
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line": 631,
        "function": "writeStream",
        "class": "OC\\Files\\Storage\\Local",
        "type": "->",
        "args": [
          "files/PC1/Kartenmaterial 2019/Sicherung.img",
          null,
          null
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
        "line": 207,
        "function": "writeStream",
        "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type": "->",
        "args": [
          "files/PC1/Kartenmaterial 2019/Sicherung.img",
          null
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php",
        "line": 155,
        "function": "put",
        "class": "OCA\\DAV\\Connector\\Sabre\\File",
        "type": "->",
        "args": [
          null
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 311,
        "function": "createFile",
        "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
        "type": "->",
        "args": [
          "Sicherung.img",
          null
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 135,
        "function": "copyNode",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\DAV\\Upload\\FutureFile"
          },
          {
            "__class__": "OCA\\DAV\\Connector\\Sabre\\Directory"
          },
          "Sicherung.img"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 167,
        "function": "copy",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "uploads/User1/2312646122/.file",
          "files/User1/PC1/Kartenmaterial 2019/Sicherung.img"
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Upload/ChunkingPlugin.php",
        "line": 95,
        "function": "move",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "uploads/User1/2312646122/.file",
          "files/User1/PC1/Kartenmaterial 2019/Sicherung.img"
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Upload/ChunkingPlugin.php",
        "line": 77,
        "function": "performMove",
        "class": "OCA\\DAV\\Upload\\ChunkingPlugin",
        "type": "->",
        "args": [
          "uploads/User1/2312646122/.file",
          "files/User1/PC1/Kartenmaterial 2019/Sicherung.img"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "beforeMove",
        "class": "OCA\\DAV\\Upload\\ChunkingPlugin",
        "type": "->",
        "args": [
          "uploads/User1/2312646122/.file",
          "files/User1/PC1/Kartenmaterial 2019/Sicherung.img"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 632,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "beforeMove",
          [
            "uploads/User1/2312646122/.file",
            "files/User1/PC1/Kartenmaterial 2019/Sicherung.img"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpMove",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 474,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "method:MOVE",
          [
            {
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 251,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 319,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/lib/Server.php",
        "line": 325,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/remote.php",
        "line": 167,
        "args": [
          "/var/www/html/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/lib/private/Log/ErrorHandler.php",
    "Line": 91,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (Macintosh) mirall/3.0.2git (build 3559) (Nextcloud)",
  "version": "20.0.0.9"
}

I can upload the file now, but it is not correctly available. There is written at WebUI behind file name (in German: Ausstehend) outstanding. If I click in WebUI at logging, I get:

Sabre\DAV\Exception\ServiceUnavailable: Could not open file
/var/www/html/apps/dav/lib/Upload/AssemblyStream.php - line 294:
OCA\DAV\Connector\Sabre\File->get()
/var/www/html/apps/dav/lib/Upload/AssemblyStream.php - line 164:
OCA\DAV\Upload\AssemblyStream->getStream(OCA\DAV\Connector\Sabre\File {})
<>
OCA\DAV\Upload\AssemblyStream->stream_read(8192)
/var/www/html/3rdparty/icewind/streams/src/Wrapper.php - line 91:
fread(null, 8192)
/var/www/html/lib/private/Files/Stream/HashWrapper.php - line 64:
Icewind\Streams\Wrapper->stream_read(8192)
<>
OC\Files\Stream\HashWrapper->stream_read(8192)
/var/www/html/3rdparty/icewind/streams/src/Wrapper.php - line 91:
fread(null, 8192)
/var/www/html/lib/private/Files/Stream/HashWrapper.php - line 64:
Icewind\Streams\Wrapper->stream_read(8192)
<>
OC\Files\Stream\HashWrapper->stream_read(8192)
/var/www/html/3rdparty/icewind/streams/src/Wrapper.php - line 91:
fread(null, 8192)
/var/www/html/lib/private/Files/Stream/HashWrapper.php - line 64:
Icewind\Streams\Wrapper->stream_read(8192)
<>
OC\Files\Stream\HashWrapper->stream_read(8192)
/var/www/html/3rdparty/icewind/streams/src/Wrapper.php - line 91:
fread(null, 8192)
/var/www/html/3rdparty/icewind/streams/src/CallbackWrapper.php - line 98:
Icewind\Streams\Wrapper->stream_read(8192)
<>
Icewind\Streams\CallbackWrapper->stream_read(8192)
/var/www/html/lib/private/Files/Storage/Local.php - line 560:
file_put_contents("/home/pi/da … g", null)
/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php - line 631:
OC\Files\Storage\Local->writeStream(“files/Kobo, … g”, null, null)
/var/www/html/apps/dav/lib/Connector/Sabre/File.php - line 207:
OC\Files\Storage\Wrapper\Wrapper->writeStream(“files/Kobo, … g”, null)
/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php - line 155:
OCA\DAV\Connector\Sabre\File->put(null)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 311:
OCA\DAV\Connector\Sabre\Directory->createFile(“Sicherung”, null)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 135:
Sabre\DAV\Tree->copyNode(OCA\DAV\Upload\FutureFile {}, OCA\DAV\Conn … {}, “Sicherung”)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php - line 167:
Sabre\DAV\Tree->copy(“uploads/Bla … e”, “files/Blaub … g”)
/var/www/html/apps/dav/lib/Upload/ChunkingPlugin.php - line 95:
Sabre\DAV\Tree->move(“uploads/Bla … e”, “files/Blaub … g”)
/var/www/html/apps/dav/lib/Upload/ChunkingPlugin.php - line 77:
OCA\DAV\Upload\ChunkingPlugin->performMove(“uploads/Bla … e”, “files/Blaub … g”)
/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
OCA\DAV\Upload\ChunkingPlugin->beforeMove(“uploads/Bla … e”, “files/Blaub … g”)
/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 632:
Sabre\DAV\Server->emit(“beforeMove”, [ “uploads/B … “])
/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpMove(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 474:
Sabre\DAV\Server->emit(“method:MOVE”, [ Sabre\HTTP … }])
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 251:
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:
Sabre\DAV\Server->start()
/var/www/html/apps/dav/lib/Server.php - line 325:
Sabre\DAV\Server->exec()
/var/www/html/apps/dav/appinfo/v2/remote.php - line 35:
OCA\DAV\Server->exec()
/var/www/html/remote.php - line 167:
require_once(”/var/www/ht … p”)

It looks strange. Last night I uploaded this file from a Ubuntu computer, and it works. It seems to be a MacOS problem. At WebUI I still get the information behind the file name “outstanding”