iOS app fails uploading larger files than 100MB

Nextcloud version (eg, 29.0.5): 29.0.5
Operating system and version (eg, Ubuntu 24.04): Debian GNU/Linux 12 (bookworm)
Apache or nginx version (eg, Apache 2.4.25): Server version: Apache/2.4.61 (Debian)
PHP version (eg, 8.3): 8.2

The issue you are facing:

When uploading larger files(videos) than 100MB only from iOS app, the upload fails. Nextcloud app gives an error message “Invalid, or could not parse URI”.

Once i try to upload a file like that, the app keeps on trying to upload and constantly popping up the error message. Tried to convert the same video file with different sizes, and as soon as it was under 100MB (66MB), app upload was successful.

I can get rid of the iOS error message by clearing cache in app, but file is not uploaded then.

Also found the below in iOS app log. Seems like when the actual file size is larger than the CHUNK it fails:

That chunk size is not set by me, what more, it has nothing to do with the max chunk size set.

I tried to set it with the below command, and it was successful, still nothing changed in the iOS app log.

# sudo -u www-data php8.2 ./occ config:app:set files max_chunk_size --value 20971520
Config value 'max_chunk_size' for app 'files' is now set to '20971520', stored as mixed in fast cache

There must not be any connection with the maximum upload size set, as I modified it to 2000M, and also no issue at all when uploading anything in browser. I only face this issue in iOS app.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Try to upload any file that larger than 100MB

The output of your Nextcloud log in Admin > Logging:

{"reqId":"7JPPaU9xFQXU6XWe0I3c","level":3,"time":"2024-09-01T07:49:38+02:00","remoteAddr":"192.168.88.114","user":"***","app":"webdav","method":"PUT","url":"/remote.php/dav/uploads/***/EDCD56DF-4565-4A65-A790-759A92252A93/1","message":"Invalid, or could not parse URI","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/5.5.5","version":"29.0.5.1","exception":{"Exception":"Sabre\\Uri\\InvalidUriException","Message":"Invalid, or could not parse URI","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/3rdparty/sabre/uri/lib/functions.php","line":120,"function":"Sabre\\Uri\\parse"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":565,"function":"Sabre\\Uri\\normalize"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/QuotaPlugin.php","line":100,"function":"calculateUri","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeCreateFile","class":"OCA\\DAV\\Connector\\Sabre\\QuotaPlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1094,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/Server.php","line":385,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/remote.php","line":172,"args":["/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/3rdparty/sabre/uri/lib/functions.php","Line":206,"message":"Invalid, or could not parse URI","exception":[],"CustomMessage":"Invalid, or could not parse URI"},"id":"66d40088aac97"}

Hi, I’m getting exactly the same behaviour with files > 100MB on ios app.
It stops uploading at 95.4MB and then throws error in app.

Did you by any chance manage to solve this for you?
Any help would be greatly appreciated, thanks!

Hi. No solution so far :confused: Still looking forward if anyone could solve this issue :frowning:

there is an older and pretty long thread about it here
https://github.com/nextcloud/desktop/issues/4278#issuecomment-1099587102

indicating the problem is on client side, but searching further I found that in 2023 ios app has moved from manual chunk size option to automatic:
https://github.com/nextcloud/ios/issues/2547

so we can’t change that option anymore, and still not clear if that’s causing the issue.

Which NC are you running? aio, vm, manual etc.

also what I’m not entirely sure, where to precisely look for all the php and apache conf files? I’m using AIO and I can see that containers don’t have even nano installed, so I’m kind of limited using "container exec " approach as in your initial post.

Looking also into
https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/big_file_upload_configuration.html

for noob like me has a pretty “figure it yourself” vibe since it doesn’t tackle different paths based on selected installation option…

This looks different than the typical problem that hits ~100MB if using Cloudflare. At least it’s not failing in quite the way I’d expect. Though, it is relevant to mention that is a potential factor if you’re using the free level of Cloudflare.

When this particular error has come up in the past, it’s been related to encoding certain characters in filenames - e.g.

The first two are fixed, but I’m not sure about the last one which is still open and seems most relevant since it’s in the iOS client.

I have not investigated further.

Indeed I have my domain at Cloudflare, but to be honest i am not using any of their application layer stuff, not doing ssl decryption with Cloudflare. I assume it shouldnt be an issue like that, i am only using it as a DNS provider. There is no special charater in any of the folder or file name, so that shouldnt be an issue either. Also as i stated, it is working fine on any other platform but iOS.

Using a manual installation on a bare metal server. Nothing fancy… i checked that also, but still i assume if there was an issue with general config I would experience the same from other clients too not only iOS.