Errors when running sudo -u www-data php occ files:scan --all --repair

Hi,

Version:ownCloud 10.0.10
OS: 16.04 LTS
Apache: 2.4.18
Mysql: 8.42 Distrib 5.7.24, for Linux on x86_64

I receive these errors for root when I run the following owncloud command on our self-hosted owncloud server

sudo -u www-data php occ files:scan --all --repair

How can I resolve this? So far I also run the following commands, yet did not resolve it though.

sudo -u www-data php occ files:checksums:verify
sudo -u www-data php occ files:checksums:verify —repair
sudo -u www-data php occ files:cleanup

sudo -u www-data php occ files:scan --all --repair
Starting scan for user 30 out of 43 (jraxxxxx)
Starting scan for user 31 out of 43 (lloxxxxx)
Starting scan for user 32 out of 43 (maxxxx)
Starting scan for user 33 out of 43 (mhexxxx)
Starting scan for user 34 out of 43 (mjoxxxx)
Starting scan for user 35 out of 43 (mnoxxxx)
Starting scan for user 36 out of 43 (mvoxxxxx)
Starting scan for user 37 out of 43 (nchxxxxx)
Starting scan for user 38 out of 43 (rlexxxxx)
Starting scan for user 39 out of 43 (rmaxxxxx)
Starting scan for user 40 out of 43 (root)
Exception during scan: OCP\Lock\LockedException: “files/43ce1114e7f16c2878f015d7d41d8ec9” is locked
#0 /var/www/owncloud/lib/private/Files/Storage/Common.php(657): OC\Lock\DBLockingProvider->acquireLock(‘files/43ce1114e…’, 2)
#1 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(588): OC\Files\Storage\Common->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#2 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(588): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#3 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(588): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#4 /var/www/owncloud/lib/private/Files/Cache/Scanner.php(322): OC\Files\Storage\Wrapper\Wrapper->acquireLock(‘scanner::’, 2, Object(OC\Lock\DBLockingProvider))
#5 /var/www/owncloud/lib/private/Files/Utils/Scanner.php(245): OC\Files\Cache\Scanner->scan(’’, true, 3)
#6 /var/www/owncloud/apps/files/lib/Command/Scan.php(245): OC\Files\Utils\Scanner->scan(’/root’, false)
#7 /var/www/owncloud/apps/files/lib/Command/Scan.php(392): OCA\Files\Command\Scan->scanFiles(‘root’, ‘/root’, false, Object(Symfony\Component\Console\Output\ConsoleOutput), false, false)
#8 /var/www/owncloud/apps/files/lib/Command/Scan.php(355): OCA\Files\Command\Scan->userScan(Array, NULL, false, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#9 /var/www/owncloud/apps/files/lib/Command/Scan.php(321): OCA\Files\Command\Scan->processUserChunks(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput), Array, NULL, false)
#10 /var/www/owncloud/lib/composer/symfony/console/Command/Command.php(251): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/owncloud/core/Command/Base.php(159): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/owncloud/lib/composer/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/owncloud/lib/composer/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/owncloud/lib/composer/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/owncloud/lib/private/Console/Application.php(161): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/owncloud/console.php(106): OC\Console\Application->run()
#17 /var/www/owncloud/occ(11): require_once(’/var/www/ownclo…’)
#18 {main}
Starting scan for user 41 out of 43 (rpaxxxx)
Starting scan for user 42 out of 43 (rphxxxxx)
Starting scan for user 43 out of 43 (truxxxxx)
±--------±------±-------------±-----------------+
| Folders | Files | Elapsed time | Items per second |
±--------±------±-------------±-----------------+
| 16176 | 93890 | 00:04:13 | 434 |
±--------±------±-------------±-----------------+
root@vm-owncloud-s1:/var/www/owncloud# /etc/init.d/mysql restart
[ ok ] Restarting mysql (via systemctl): mysql.service.
root@vm-owncloud-s1:/var/www/owncloud# /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.
root@vm-owncloud-s1:/var/www/owncloud#

Regards,
Markus

Hey,

have you tried this: https://central.owncloud.org/search?q="is%20locked"

which leads me to this: File is locked - how to unlock.

From what i have read in the past you could avoid such locking situations by configuring redis for file locking.