Can't upload a file: ""Admin/files/Movies/File.mp4.upload.part" is locked"

The issue you are facing:
I can’t upload 3 specific Files. I use the Browser to access Nextcloud.
It shows the error: “Admin/files/Movies/File.mp4.upload.part” is locked"
I guess it is my own fault. I closed the Nextcloud window and rebooted the server after some minutes. before I did I relogged and checked if the processing is still running and it wasn’t
After that reboot, I checked if the Files were in the Folders with WinSCP and they weren’t there but there were the three File.mp4.uploadidXXXXX.part-Files. I thought “shiet” deleted the part/temp-Files and reuploaded the Files with the Browser but this error appeared. How can I fix that. I already deleted oc_file_locks in the mariadb and I made a occ file:scan --all but it didn’t fix it. Also I tried Flowupload. How can I fix that?

I renamed the Files in Windows and tried to upload it with another Filename and it worked flawlessly, but after those are some movies I would like to use the Name of the movie as the Filename. When I try to rename the file to the original name of it, i get an error, that renaming failed. I could rename it in another Folder, but I was not able to move it in the Folder I wanted it to be.

I guess I only need to “deleted” the rests of my processing-hard-reset i accidentily made.
But I don’t know how.

Is this the first time you’ve seen this error? Yes

The output of your Nextcloud log in Admin > Logging:

{"reqId":"Dll1ZYICenGRlvLqXZc9","level":0,"time":"2022-02-04T21:58:37+00:00","remoteAddr":"88.134.142.106","user":"Admin","app":"webdav","method":"MOVE","url":"/remote.php/dav/uploads/Admin/web-file-upload-cde90ecaf7bbf8eec92a3038ebbe7f25-1644010695428/.file","message":"\"Admin/files/Movies/File.mp4.upload.part\" is locked","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36","version":"23.0.1.1","exception":{"Exception":"OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked","Message":"\"Admin/files/Movies/File.mp4.upload.part\" is locked","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":307,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":133,"function":"copyNode","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":163,"function":"copy","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":94,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":76,"function":"performMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":603,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":339,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","Line":167,"Previous":{"Exception":"OCP\\Lock\\LockedException","Message":"\"Admin/files/Movies/File.mp4.upload.part\" is locked","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":2079,"function":"lockPath","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":153,"function":"lockFile","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":307,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":133,"function":"copyNode","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":163,"function":"copy","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":94,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":76,"function":"performMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":603,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":339,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/View.php","Line":1969,"Previous":{"Exception":"OCP\\Lock\\LockedException","Message":"\"files/00b47c3ac0d55549ea3f99f2b06b1fc7\"(\"home::Admin::files/Admin/files/Movies/File.upload.part\") is locked","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Storage/Common.php","line":753,"function":"acquireLock","class":"OC\\Lock\\DBLockingProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":610,"function":"acquireLock","class":"OC\\Files\\Storage\\Common","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1964,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":2079,"function":"lockPath","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":153,"function":"lockFile","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":307,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":133,"function":"copyNode","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":163,"function":"copy","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":94,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/ChunkingPlugin.php","line":76,"function":"performMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMove","class":"OCA\\DAV\\Upload\\ChunkingPlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":603,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":339,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":166,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Lock/DBLockingProvider.php","Line":209}},"CustomMessage":"--"}}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'id',
  'passwordsalt' => 'pasw',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => 'IP',
    1 => 'url',
    2 => 'url',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '23.0.1.1',
  'overwrite.cli.url' => 'url',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => false,
  'dbuser' => 'oc_Admin',
  'dbpassword' => 'password',
  'installed' => true,
  'app_install_overwrite' => 
  array (
    0 => 'documents',
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'updater.secret' => 'secret',
  'updater.release.channel' => 'beta',
  'mariadb.utf8mb4' => false,
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Edit:
I should ask in Forums more often. As always I could fix it shortly after the first post.
I could fix it by adding:

'filelocking.enabled' => false,

to config.php
ATTENTION!!! Filelocking prevents uploading the same files by multiple users at the same time to avoid file corruption!
Only deactivate if you know what you are doing.

I would prefer to install redis and add the following lines to your config.php.

array (
‘host’ => ‘/var/run/redis/redis-server.sock’,
‘port’ => 0,
‘timeout’ => 1.5,
‘dbindex’ => 0,
),

Plz have a look at this one here: https://docs.nextcloud.com/server/latest/admin_manual/installation/server_tuning.html#using-redis-based-transactional-file-locking

1 Like

Thanks, for the answer. I wanted to do that, but I use debian testing and there were some missing dependencies. I will, when Nextcloud properly supports my debian version. Like php8.1 or mariadb10.6.5.