Folder Scan is locked. Tried everything

I can the command files:scan --path=cn

Output:
Starting scan for user 1 out of 1 (cn)
Exception during scan: “files/5195a7f2e41b4242d536b84d6c5d647c”(“home::cn::scanner::”) is locked
#0 /var/www/html/lib/private/Files/Storage/Common.php(751): OC\Lock\DBLockingProvider->acquireLock(‘files/5195a7f2e…’, 2, ‘home::cn::scann…’)
#1 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(594): OC\Files\Storage\Common->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#2 /var/www/html/lib/private/Files/Cache/Scanner.php(333): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#3 /var/www/html/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan(’’, true, 3)
#4 /var/www/html/apps/files/lib/Command/Scan.php(152): OC\Files\Utils\Scanner->scan(’/cn’, true, NULL)
#5 /var/www/html/apps/files/lib/Command/Scan.php(208): OCA\Files\Command\Scan->scanFiles(‘cn’, ‘/cn’, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#6 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/3rdparty/symfony/console/Application.php(1000): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/console.php(100): OC\Console\Application->run()
#13 /var/www/html/occ(11): require_once(’/var/www/html/c…’)
#14 {main}

I have also tried:

  • I fixed permission at host-level
  • Nextcloud log is empty/no new entries
  • Running DELETE FROM nextcloud_db.oc_file_locks WHERE extcloud_db.oc_file_locks.lock='1'; in my database.
  • I tried maintenance:repair
  • No issues in Security & setup warnings.

I’m stuck.

Same here, have you ever found a solution?