Today I got following exception after I copied over some files via rsync and wanted to add them to nextcloud via the files:scan
command.
Exception during scan: File entry could not be inserted but could also not be selected with getId() in order to perform an update. Please try again.
#0 /var/www/html/lib/private/Files/Cache/Scanner.php(300): OC\Files\Cache\Cache->insert('files/epub/Cave...', Array)
#1 /var/www/html/lib/private/Files/Cache/Scanner.php(233): OC\Files\Cache\Scanner->addToCache('files/epub/Cave...', Array, -1)
#2 /var/www/html/lib/private/Files/Cache/Scanner.php(457): OC\Files\Cache\Scanner->scanFile('files/epub/Cave...', 3, 261498, false, true, Array)
#3 /var/www/html/lib/private/Files/Cache/Scanner.php(397): OC\Files\Cache\Scanner->handleChildren('files/epub', true, 3, 261498, true, 0)
#4 /var/www/html/lib/private/Files/Cache/Scanner.php(400): OC\Files\Cache\Scanner->scanChildren('files/epub', true, 3, 261498, true, -1)
#5 /var/www/html/lib/private/Files/Cache/Scanner.php(400): OC\Files\Cache\Scanner->scanChildren('files', true, 3, 2, true, -1)
#6 /var/www/html/lib/private/Files/Cache/Scanner.php(347): OC\Files\Cache\Scanner->scanChildren('', true, 3, 1, true, 101447318850)
#7 /var/www/html/lib/private/Files/Utils/Scanner.php(269): OC\Files\Cache\Scanner->scan('', true, 3)
#8 /var/www/html/apps/files/lib/Command/Scan.php(164): OC\Files\Utils\Scanner->scan('/admin', true, NULL)
#9 /var/www/html/apps/files/lib/Command/Scan.php(219): OCA\Files\Command\Scan->scanFiles('admin', '/admin', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#10 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/3rdparty/symfony/console/Application.php(301): 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/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/console.php(100): OC\Console\Application->run()
#17 /var/www/html/occ(11): require_once('/var/www/html/c...')
#18 {main}
I checked all the file permissions of the new files (including the one which results in the error), they are correct.
I can also remove the file in question, but than it will break on the next file I copied today…
Any ideas what’s the cause and solution?
Nextcloud Version is 27, running in Docker via AIO