"occ file:scan --all -v" terminates with errorr

Hi,

today I ran occ file:scan --all -v to rescan the files. I had to terminate it because of a reboot.
Now I want to re-run it but now it terminates with a few errors:

[root@HOST ]# sudo -u apache php /usr/share/nextcloud/occ file:scan --all -v

Scanning files for 3 users

Starting scan for user 1 out of 3 (admin)
Folder /admin/
Folder /admin/files
File /admin/files/Nextcloud Manual.pdf
File /admin/files/Nextcloud.mp4
Folder /admin/files/Documents
File /admin/files/Documents/About.odt
File /admin/files/Documents/About.txt
Folder /admin/files/Photos
File /admin/files/Photos/Coast.jpg
File /admin/files/Photos/Hummingbird.jpg
File /admin/files/Photos/Nut.jpg
Folder /admin/cache
Folder /admin/thumbnails
Folder /admin/thumbnails/9
File /admin/thumbnails/9/1100-734-max.png
File /admin/thumbnails/9/400-400.png
Folder /admin/thumbnails/10
File /admin/thumbnails/10/2000-1333-max.png
File /admin/thumbnails/10/400-400.png
Folder /admin/thumbnails/11
File /admin/thumbnails/11/2000-1333-max.png
File /admin/thumbnails/11/400-400.png

Starting scan for user 2 out of 3 (USER1)

Starting scan for user 3 out of 3 (USER)
Exception while scanning: “files/332f3d75108abb001bd776c0edca62a3” is locked
#0 /usr/share/nextcloud/lib/private/Files/Storage/Common.php(651): OC\Lock\DBLockingProvider->acquireLock(‘files/332f3d751…’, 2)
#1 /usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(584): OC\Files\Storage\Common->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#2 /usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(584): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#3 /usr/share/nextcloud/lib/private/Files/Cache/Scanner.php(325): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#4 /usr/share/nextcloud/lib/private/Files/Utils/Scanner.php(196): OC\Files\Cache\Scanner->scan(’’, true, 3)
#5 /usr/share/nextcloud/apps/files/lib/Command/Scan.php(159): OC\Files\Utils\Scanner->scan(’/USER’)
#6 /usr/share/nextcloud/apps/files/lib/Command/Scan.php(227): OCA\Files\Command\Scan->scanFiles(‘USER’, ‘/USER’, true, Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#7 /usr/share/php/Symfony/Component/Console/Command/Command.php(257): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /usr/share/nextcloud/core/Command/Base.php(159): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /usr/share/php/Symfony/Component/Console/Application.php(850): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /usr/share/php/Symfony/Component/Console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /usr/share/php/Symfony/Component/Console/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /usr/share/nextcloud/lib/private/Console/Application.php(146): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /usr/share/nextcloud/console.php(82): OC\Console\Application->run()
#14 /usr/share/nextcloud/occ(11): require_once(’/usr/share/next…’)
#15 {main}

±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 9 | 13 | 00:00:02 |
±--------±------±-------------+
[root@HOST ]#

How can I resolve the issue?

You use Redis for file locking? As far as I remember the locked files will be released automatically after 24 hours. You can also unlock them manually by clearing the related database table: File is locked - how to unlock