Problems with large files upload (again)

(update : And even with little files)

Nextcloud version 29.0.7 (fresh install)
Operating system Debian 12
Apache 2.4.62
PHP 8.2 (FPM)

The issue you are facing:

  1. Upload a big file like 15GB via web browser doesn’t work and creates a lot of logs like these (debug mode) :

Update : Little files create the same logs also…

Exception dirty table reads: SELECT fileid…
Exception dirty table reads: SELECT path…
Exception dirty table reads: SELECT filecache…

For instance (sorry, the log page is having hard time displaying everything and I can’t use it as I want…) :

*{"reqId":"3MlWgOw2meyIzE6g0CBU","level":0,"time":"2024-09-18T18:21:16+02:00","remoteAddr":"don't_want_my_IP_here","user":"bcouturier","app":"no app in context","method":"PUT","url":"/remote.php/dav/uploads/bcouturier/web-file-upload-68905bd8c3c5e364/137","message":"dirty table reads: SELECT fileidFROMPREFIXfilecache WHERE (storage = :dcValue1) AND (path_hash= :dcValue2)","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0","version":"29.0.7.1","exception":{"Exception":"Exception","Message":"dirty table reads: SELECTfileidFROMPREFIXfilecache WHERE (storage = :dcValue1) AND (path_hash= :dcValue2)","Code":0,"Trace":[{"file":"/usr/share/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":344,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/cloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":384,"function":"executeQuery","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/usr/share/cloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/usr/share/cloud/lib/private/Files/Cache/Cache.php","line":497,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/usr/share/cloud/lib/private/Files/Cache/Cache.php","line":263,"function":"getId","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/usr/share/cloud/lib/private/Files/View.php","line":1613,"function":"put","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/usr/share/cloud/apps/dav/lib/Connector/Sabre/File.php","line":401,"function":"putFileInfo","class":"OC\\Files\\View","type":"->"},{"file":"/usr/share/cloud/apps/dav/lib/Connector/Sabre/Directory.php","line":148,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/usr/share/cloud/apps/dav/lib/Upload/UploadFolder.php","line":51,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/cloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/usr/share/cloud/apps/dav/lib/Server.php","line":383,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/usr/share/cloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/usr/share/cloud/remote.php","line":172,"args":["/usr/share/cloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/usr/share/cloud/lib/private/DB/Connection.php","Line":320,"message":"dirty table reads: SELECTfileidFROMPREFIXfilecache WHERE (storage = :dcValue1) AND (path_hash= :dcValue2)","tables":["oc_filecache"],"reads":["oc_filecache"],"exception":[],"CustomMessage":"dirty table reads: SELECTfileidFROMPREFIXfilecache WHERE (storage = :dcValue1) AND (path_hash = :dcValue2)"},"id":"66eafdfe28fa5"}*

  1. When moving a very big file to the browser, either nothing happens, or the progress bar shows up but stays on Pause and doesn’t starts.

Update : The progress bar doesn’t show eitehr with little files. But they upload at least.

  1. Uploading the same file via the windows desktop client sometimes works, sometimes the file just desappears.

-I have put big values in my php.ini, 32G even on memory-limit just to try. I am using php-fpm but I changed also the CLI php.ini just in case. I don’t think the problem comes from PHP (unsure).

-I don’t understand these SABRE stuff and don’t know how to resolve the problem ^^

-My config .php :

<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxxxxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => 'xxxxxxxxxxxxxxxxxx',
  ),
  'datadirectory' => '/usr/share/cloud/data',
  'skeletondirectory' => '',
  'dbtype' => 'mysql',
  'version' => '29.0.7.1',
  'overwrite.cli.url' => 'xxxxxxxxxxxxxxxxxx',
  'dbname' => 'cloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxxxxxxxxxxxxxxxx',
  'dbpassword' => 'xxxxxxxxxxxxxxxxxx',
  'installed' => true,
  'maintenance_window_start' => 1,
  'default_phone_region' => 'FR',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'xxxxxxxxxxxxxxxxxx',
  'mail_smtphost' => 'xxxxxxxxxxxxxxxxxx',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxxxxxxxxxxxxxxxxx',
  'mail_smtppassword' => 'xxxxxxxxxxxxxxxxxx',
  'logtimezone' => 'Europe/Paris',
  'force_locale' => 'fr/FR',
  'loglevel' => 0,
  'debug' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
    'password' => 'xxxxxxxxxxxxxxxxxx',
  ),
  'default_language' => 'fr',
  'maintenance' => false,
  'log_type' => 'file',
  'log_file' => '/usr/share/cloud/cloud.log',
  'log_level' => '3',
  'log_rotate_size' => 10 * 1024 * 1024,
  'logdateformat' => 'F d, Y H:i:s',
  'trashbin_retention_obligation' => '7,30',
);

(I’d like to add that the ‘log_file’ directive doesn’t work, the log file is the native nextcloud.log)
(plus, is it normal that the config.php doesn’t end with a “>” ?)

-I have force the chunk size to 20M with the OCC command. Is it normal it doesn’t show in the config.php ?

-I have run some OCC commands to check my nextcloud instance and no issues are detected.

-No issue reported in the admin panel.

-I have setup a redis cache on locahost, which seem to work. Don’t know if it’s related.


Any help would be veeeery much appreciated :smiley:

Thank you !

What does your browser inspector indicate? Check your Network tab during the upload to see what transactions file and why. Same with Console tab.

I have put big values in my php.ini, 32G even on memory-limit just to try

All of the official clients (including the Web UI) use chunking so setting these to huge numbers is not relevant.

I’d like to add that the ‘log_file’ directive doesn’t work, the log file is the native nextcloud.log)

That’s because the directive is logfile: Logging — Nextcloud latest Administration Manual latest documentation

'loglevel' => 0,

Also set your loglevel to the default (2). Chances are that whatever is going on here will show up w/o needing debug level logging. Having unnecessary logging will only make it more challenging for legitimate errors to standout.

Hello !

Thank you for you help !

I have rectified the logfile and loglevel directives (oops).

I have put back some normal values in php.ini’s :

memory_limit = 1024M
max_execution_time = 3600
max_input_time = 3600
post_max_size = 16G
upload_max_filesize = 16G

(Anyway they weren’t making it work better…)

-I’m looking at the browser network inspector, that’s very interesting. The 15GB file got uploaded by 729 chunks of 20MB (as I have set), which means 15Go.

-The progress bar didn’t show up.

-The file is not present in the folder (I have SSH access), nor the Web ui or desktop client. And doesn’t use space. Just didn’t upload in the end, or got deleted I don’t know why.

I think this is the associate log (basically : Sabre-DAV Exception - Service unavailable - unable to open the file) :

[webdav] Erreur: Impossible d'ouvrir le fichier
	MOVE /remote.php/dav/uploads/bcouturier/web-file-upload-42e6937271ae8502/.file
	de my_IP par bcouturier à 18 sept. 2024, 21:12:12

“reqId”: “ooWQZKScSTlFXtG1geci”,
“level”: 3,
“time”: “2024-09-18T21:12:12+02:00”,
“remoteAddr”: “my_ip”,
“user”: “bcouturier”,
“app”: “webdav”,
“method”: “MOVE”,
“url”: “/remote.php/dav/uploads/bcouturier/web-file-upload-42e6937271ae8502/.file”,
“message”: “Impossible d’ouvrir le fichier”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0”,
“version”: “29.0.7.1”,
“exception”: {
“Exception”: “Sabre\DAV\Exception\ServiceUnavailable”,
“Message”: “Impossible d’ouvrir le fichier”,
“Code”: 0,
“Trace”: [
{
“file”: “/usr/share/cloud/apps/dav/lib/Upload/AssemblyStream.php”,
“line”: 294,
“function”: “get”,
“class”: “OCA\DAV\Connector\Sabre\File”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/dav/lib/Upload/AssemblyStream.php”,
“line”: 164,
“function”: “getStream”,
“class”: “OCA\DAV\Upload\AssemblyStream”,
“type”: “->”
},
{
“function”: “stream_read”,
“class”: “OCA\DAV\Upload\AssemblyStream”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/icewind/streams/src/Wrapper.php”,
“line”: 55,
“function”: “fread”
},
{
“file”: “/usr/share/cloud/3rdparty/icewind/streams/src/CallbackWrapper.php”,
“line”: 96,
“function”: “stream_read”,
“class”: “Icewind\Streams\Wrapper”,
“type”: “->”
},
{
“function”: “stream_read”,
“class”: “Icewind\Streams\CallbackWrapper”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/icewind/streams/src/Wrapper.php”,
“line”: 55,
“function”: “fread”
},
{
“file”: “/usr/share/cloud/3rdparty/icewind/streams/src/CallbackWrapper.php”,
“line”: 96,
“function”: “stream_read”,
“class”: “Icewind\Streams\Wrapper”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/files_antivirus/lib/CallbackReadDataWrapper.php”,
“line”: 54,
“function”: “stream_read”,
“class”: “Icewind\Streams\CallbackWrapper”,
“type”: “->”
},
{
“function”: “stream_read”,
“class”: “OCA\Files_Antivirus\CallbackReadDataWrapper”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/lib/private/Files/Storage/Local.php”,
“line”: 339,
“function”: “file_put_contents”
},
{
“file”: “/usr/share/cloud/lib/private/Files/Storage/Local.php”,
“line”: 650,
“function”: “file_put_contents”,
“class”: “OC\Files\Storage\Local”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php”,
“line”: 653,
“function”: “writeStream”,
“class”: “OC\Files\Storage\Local”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php”,
“line”: 653,
“function”: “writeStream”,
“class”: “OC\Files\Storage\Wrapper\Wrapper”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/files_antivirus/lib/AvirWrapper.php”,
“line”: 83,
“function”: “writeStream”,
“class”: “OC\Files\Storage\Wrapper\Wrapper”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/lib/private/Files/Storage/Wrapper/Wrapper.php”,
“line”: 653,
“function”: “writeStream”,
“class”: “OCA\Files_Antivirus\AvirWrapper”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/dav/lib/Connector/Sabre/File.php”,
“line”: 250,
“function”: “writeStream”,
“class”: “OC\Files\Storage\Wrapper\Wrapper”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/dav/lib/Connector/Sabre/Directory.php”,
“line”: 148,
“function”: “put”,
“class”: “OCA\DAV\Connector\Sabre\File”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Tree.php”,
“line”: 325,
“function”: “createFile”,
“class”: “OCA\DAV\Connector\Sabre\Directory”,
“type”: “->”,
“args”: [
“*** sensitive parameters replaced ***”
]
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Tree.php”,
“line”: 151,
“function”: “copyNode”,
“class”: “Sabre\DAV\Tree”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Tree.php”,
“line”: 181,
“function”: “copy”,
“class”: “Sabre\DAV\Tree”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/dav/lib/Upload/ChunkingPlugin.php”,
“line”: 94,
“function”: “move”,
“class”: “Sabre\DAV\Tree”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/dav/lib/Upload/ChunkingPlugin.php”,
“line”: 76,
“function”: “performMove”,
“class”: “OCA\DAV\Upload\ChunkingPlugin”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php”,
“line”: 89,
“function”: “beforeMove”,
“class”: “OCA\DAV\Upload\ChunkingPlugin”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php”,
“line”: 603,
“function”: “emit”,
“class”: “Sabre\DAV\Server”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php”,
“line”: 89,
“function”: “httpMove”,
“class”: “Sabre\DAV\CorePlugin”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Server.php”,
“line”: 472,
“function”: “emit”,
“class”: “Sabre\DAV\Server”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Server.php”,
“line”: 253,
“function”: “invokeMethod”,
“class”: “Sabre\DAV\Server”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/3rdparty/sabre/dav/lib/DAV/Server.php”,
“line”: 321,
“function”: “start”,
“class”: “Sabre\DAV\Server”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/dav/lib/Server.php”,
“line”: 383,
“function”: “exec”,
“class”: “Sabre\DAV\Server”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/apps/dav/appinfo/v2/remote.php”,
“line”: 35,
“function”: “exec”,
“class”: “OCA\DAV\Server”,
“type”: “->”
},
{
“file”: “/usr/share/cloud/remote.php”,
“line”: 172,
“args”: [
“/usr/share/cloud/apps/dav/appinfo/v2/remote.php”
],
“function”: “require_once”
}
],
“File”: “/usr/share/cloud/apps/dav/lib/Connector/Sabre/File.php”,
“Line”: 505,
“message”: “Impossible d’ouvrir le fichier”,
“exception”: ,
“CustomMessage”: “Impossible d’ouvrir le fichier”
},
“id”: “66eb2744cd7cc”
}

I think the error was about the MOVE request on the file “.file”, right after the upload. But I have just disabled the antivirus app and the uploads are now finishing correctly. What’s weird is I had issues before installing the antivirus… I may have made a good change somehow.

The problem is the progress bar is still not showing up which will be confusing for users.

Any idea what to look at ?

Always the same issue with the upload progress bar not showing up when uploading using the web interface :cry:

The problem occurs only while drag and drop. When using the + button it’s working.