Error with occ files:scan --all

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version 20.00
Operating system and version alpine linuxe edge
Apache or nginx version nginx
PHP version PHP 7.4.11
Data base PostgreSQL 12.4 on x86_64-alpine-linux-musl, compiled by gcc (Alpine 10.2.0) 10.2.0, 64-bit

The issue you are facing:
Update file list fail

sudo -u nginx php -f /var/www/localhost/nextcloud/occ files:scan --all
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Starting scan for user 1 out of 5 (administrateur)
[...]
Starting scan for user 5 out of 5 (Remy)
Exception during scan: An exception occurred while executing 'UPDATE "oc_filecache" SET "size" = ? WHERE ("fileid" = ?) AND (("size" <> ?) OR ("size" IS NULL))' with params [286357292, 207376, 286357292]:

SQLSTATE[25P02]: In failed sql transaction: 7 ERROR:  current transaction is aborted, commands ignored until end of transaction block
#0 /var/www/localhost/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(169): Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException()
#1 /var/www/localhost/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(149): Doctrine\DBAL\DBALException::wrapException()
#2 /var/www/localhost/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1071): Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
#3 /var/www/localhost/nextcloud/lib/private/DB/Connection.php(214): Doctrine\DBAL\Connection->executeUpdate()
#4 /var/www/localhost/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(209): OC\DB\Connection->executeUpdate()
#5 /var/www/localhost/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(217): Doctrine\DBAL\Query\QueryBuilder->execute()
#6 /var/www/localhost/nextcloud/lib/private/Files/Cache/Cache.php(361): OC\DB\QueryBuilder\QueryBuilder->execute()
#7 /var/www/localhost/nextcloud/lib/private/Files/Cache/Scanner.php(399): OC\Files\Cache\Cache->update()
#8 /var/www/localhost/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#9 /var/www/localhost/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#10 /var/www/localhost/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#11 /var/www/localhost/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#12 /var/www/localhost/nextcloud/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->scanChildren()
#13 /var/www/localhost/nextcloud/lib/private/Files/Cache/Scanner.php(340): OC\Files\Cache\Scanner->scanChildren()
#14 /var/www/localhost/nextcloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan()
#15 /var/www/localhost/nextcloud/apps/files/lib/Command/Scan.php(152): OC\Files\Utils\Scanner->scan()
#16 /var/www/localhost/nextcloud/apps/files/lib/Command/Scan.php(208): OCA\Files\Command\Scan->scanFiles()
#17 /var/www/localhost/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#18 /var/www/localhost/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#19 /var/www/localhost/nextcloud/3rdparty/symfony/console/Application.php(1000): OC\Core\Command\Base->run()
#20 /var/www/localhost/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand()
#21 /var/www/localhost/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun()
#22 /var/www/localhost/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#23 /var/www/localhost/nextcloud/console.php(100): OC\Console\Application->run()
#24 /var/www/localhost/nextcloud/occ(11): require_once('/var/www/localh...')
#25 {main}

Any tips ?
I don’t see what’s going wrong, it’s works weel during a time.
Thanks

I still have the error after update tu 20.0.3
Thanks

Very strange, I do a test on a backup who i know everything works ,and i get the same error !

Are you using redis ? I know I have to run redis-cli -s /var/run/redis/redis.sock flushall when I run occ files:scan-app-data after a previous failed attempt. Might be the same problem.

Thanks for the reply
I fact, it’s look, i have a wrong postgresql version!

But at the same time I came across a bug that makes me think that nextcloud is not mature and is more of a beta version ! I’m really very disappointed to discover such a bug!