Iphone - Will not upload in background - Error: Cannot create subfolders


I have installed NextCloud on Centos7 on a Vmware Workstation as a Private cloud in my home.

The Iphone will not upload pictures or videos in the background, giving the following error
"Cannot create subfolders". Picture below (in norwegian).
I can see from the log that it is trying to upload every day.
When I open the app in Iphone, everything work fine.
We also have an Android, which is doing background uploads just fine.

The iphone setting is upload everything when on WIFI. Reinstalling the app and rebooting the phone has not worked.

Kind regards

1 Like

I am also having this problem. I get this error when using the option to upload entire camera roll. It shows “Creating Archive… May take a…” then after a minute or two shows large red error “unable to create folders”

I thought permissions were to blame, but I can upload new photos without problem, I can create folders on the web client and from the ios app manually but the automatic uploads are failing.

I can see in the activity that it says

You created Photos/Text, Photos/2017/02, Photos/2016/10…

then the next entry is for

Auto upload https://mydomain.com/nextcloud/remote.php/webdav/Photos/2017/02 Error creating subfolders

Nextcloud 12.0.4
IOS app 2.18.200001


After trawling through logs last night I eventually found this -

Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTOoc_file_locks(key,lock,ttl) SELECT ?,?,? FROMoc_file_locksWHEREkey= ? HAVING COUNT(*) = 0' with params ["files\/c43fefb2658bed7562aaa2fcc61bb210", 1, 1512521839, "files\/c43fefb2658bed7562aaa2fcc61bb210"]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'files/c43fefb2658bed7562aaa2fcc61bb210' for key 'lock_key_index'

Which looks like the record relating to the file exists in the db but the directory and file do not physically exist. Too late and too tired to attempt to fix last night.

I guess all that we need to do is remove these entries from the table??

@thealce can you log into the web client, click admin from the menu, then logging. Do you see any messages there when trying to upload?


I get this message:
Sabre\DAV\Exception\MethodNotAllowed: The resource you tried to create already exists
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 590: Sabre\DAV\Server->createCollection(‘Photos’, Object(Sabre\DAV\MkCol))
[internal function] Sabre\DAV\CorePlugin->httpMkcol(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit(‘method MKCOL’, Array)
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/nextcloud/apps/dav/appinfo/v1/webdav.php - line 76: Sabre\DAV\Server->exec()
/var/www/html/nextcloud/remote.php - line 162: require_once(’/var/www/html/n…’)

So I’ve done a clean install, no apps or anything, deleted the iphone app and reinstalled from the app store.

I can create files and folders manually without problems, in settings advanced I select the option to optimise, in auto upload I enable auto upload photos wifi only, no videos, use subfolders, most compatible and whole camera roll. After a while it errors with unable to create folders. It will however create folders and upload photos taken after this point.

If i do not use the option for Use subfolders it seems to work ok, it starts syncing photos (about 3500 in the queue).

My belief if that the function is broken and needs fixed.