El otro día he sufrido uno bloqueos de ficheros de nextcloud. El cliente informaba de un error 423 fichero bloqueado. Para solventarlo es muy sencillo, encendemos el modo mantenimiento limpiamos con redis-cli y quitamos el modo de mantenimiento.
Aquí lo pongo en mas detalle como desbloquear todos los ficheros
Nos logamos localmente en la maquina de nextcloud
| \| |_____ _| |_ __| |___ _ _ __| | | .` / -_) \ / _/ _| / _ \ || / _` | |_|\_\___/_\_\\__\__|_\___/\_,_\__,_| https://www.nextcloud.com WAN IPv4: WAN IPv6: LAN IPv4: 192.168.XX.XX
Chequeamos si existen bloqueos en algún usuario.
admin@nextcloud:~$ sudo -u www-data php /var/www/nextcloud/occ files:scan --all [sudo] password for ncadmin: Starting scan for user 1 out of 1 (XXXXXXX) Exception during scan: "files/87f798f9f1a941123bdb47404813a476" is locked, existing lock on file: exclusive #0 /var/www/nextcloud/lib/private/Files/Storage/Common.php(743): OC\Lock\MemcacheLockingProvider->acquireLock('files/87f798f9f...', 1) #1 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(593): OC\Files\Storage\Common->acquireLock('files/grafica.x...', 1, Object(OC\Lock\MemcacheLockingProvider)) #2 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(145): OC\Files\Storage\Wrapper\Wrapper->acquireLock('files/grafica.x...', 1, Object(OC\Lock\MemcacheLockingProvider)) #3 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(438): OC\Files\Cache\Scanner->scanFile('files/grafica.x...', 3, 27, Object(OC\Files\Cache\CacheEntry), true) #4 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(406): OC\Files\Cache\Scanner->handleChildren('files', true, 3, 27, true, 100185243) #5 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(409): OC\Files\Cache\Scanner->scanChildren('files', true, 3, 27, true) #6 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(338): OC\Files\Cache\Scanner->scanChildren('', true, 3, 25, true) #7 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(245): OC\Files\Cache\Scanner->scan('', true, 3) #8 /var/www/nextcloud/apps/files/lib/Command/Scan.php(145): OC\Files\Utils\Scanner->scan('/XXXXXX', true, NULL) #9 /var/www/nextcloud/apps/files/lib/Command/Scan.php(201): OCA\Files\Command\Scan->scanFiles('XXXXXX', '/XXXXXX', Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false) #10 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #11 /var/www/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #12 /var/www/nextcloud/3rdparty/symfony/console/Application.php(908): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(269): 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/nextcloud/3rdparty/symfony/console/Application.php(145): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #16 /var/www/nextcloud/console.php(97): OC\Console\Application->run() #17 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...') #18 {main} +---------+-------+--------------+ | Folders | Files | Elapsed time | +---------+-------+--------------+ | 100 | 460 | 00:00:25 | +---------+-------+--------------+
Nos ponemos en modo mantenimiento.
admin@nextcloud:~$ sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on Maintenance mode enabled
Usamos el cliente redis.
admin@nextcloud:~$ sudo redis-cli -s /var/run/redis/redis.sock
limpiamos todo y salimos.
redis /var/run/redis/redis.sock> flushall OK (20.51s) redis /var/run/redis/redis.sock> exit
quitamos el modo mantenimiento de nextcloud.
admin@nextcloud:~$ sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off Maintenance mode disabled
Volvemos a comprobar que todo esta correcto.
admin@nextcloud:~$ sudo -u www-data php /var/www/nextcloud/occ files:scan --all Starting scan for user 1 out of 1 (XXXXXX) +---------+-------+--------------+ | Folders | Files | Elapsed time | +---------+-------+--------------+ | 3072 | 23354 | 00:02:43 | +---------+-------+--------------+ ncadmin@nextcloud:~$
Espero que sea de ayuda.