Exception during scan: Invalid path

Nextcloud version 17.0.1
Operating system and version Ubuntu 18.04
Apache or nginx version Apache 2.4.25
PHP version 7.12

root@cloud:/mnt/nextcloud/data/igor/files# sudo -u www-data php /var/www/nextcloud/occ files:scan --path=/igor
Starting scan for user 1 out of 1 (igor)
Exception during scan: Invalid path
#0 /var/www/nextcloud/lib/private/Files/Storage/Local.php(133): OC\Files\Storage\Local->getSourcePath(’’)
#1 /var/www/nextcloud/lib/private/Files/Storage/Common.php(146): OC\Files\Storage\Local->is_dir(’’)
#2 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(164): OC\Files\Storage\Common->isCreatable(’’)
#3 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(204): OC\Files\Storage\Wrapper\Wrapper->isCreatable(’’)
#4 /var/www/nextcloud/apps/files/lib/Command/Scan.php(145): OC\Files\Utils\Scanner->scan(’/igor’, true, NULL)
#5 /var/www/nextcloud/apps/files/lib/Command/Scan.php(201): OCA\Files\Command\Scan->scanFiles(‘igor’, ‘/igor’, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#6 /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))
#7 /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))
#8 /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))
#9 /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))
#10 /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))
#11 /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))
#12 /var/www/nextcloud/console.php(97): OC\Console\Application->run()
#13 /var/www/nextcloud/occ(11): require_once(’/var/www/nextcl…’)
#14 {main}
±--------±------±-------------+
| Folders | Files | Elapsed time |
±--------±------±-------------+
| 0 | 0 | 00:00:00 |
±--------±------±-------------+
root@cloud:/mnt/nextcloud/data/igor/files#

same.

Nextcloud version 25.0.3
Operating system and version Linux 3.10.0-1160.83.1.el7.x86_64 x86_64
Apache 2.4.6
MySQL 10.2.44
PHP version 8.1.14

~/ php81 occ files:scan ****
Starting scan for user 1 out of 1 (****)
Exception during scan: Invalid path: /.htaccess
#0 /home/***/public_html/lib/private/Files/Storage/Common.php(896): OC\Files\Storage\Common->getMetaData()
#1 /home/***/public_html/lib/private/Files/Storage/Wrapper/PermissionsMask.php(157): OC\Files\Storage\Common->getDirectoryContent()
#2 [internal function]: OC\Files\Storage\Wrapper\PermissionsMask->getDirectoryContent()
#3 /home/***/public_html/lib/private/Files/Cache/Scanner.php(412): iterator_to_array()
#4 /home/***/public_html/lib/private/Files/Cache/Scanner.php(391): OC\Files\Cache\Scanner->handleChildren()
#5 /home/***/public_html/lib/private/Files/Cache/Scanner.php(342): OC\Files\Cache\Scanner->scanChildren()
#6 /home/***/public_html/lib/private/Files/Utils/Scanner.php(256): OC\Files\Cache\Scanner->scan()
#7 /home/***/public_html/apps/files/lib/Command/Scan.php(161): OC\Files\Utils\Scanner->scan()
#8 /home/***/public_html/apps/files/lib/Command/Scan.php(217): OCA\Files\Command\Scan->scanFiles()
#9 /home/***/public_html/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#10 /home/***/public_html/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#11 /home/***/public_html/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#12 /home/***/public_html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#13 /home/***/public_html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#14 /home/***/public_html/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#15 /home/***/public_html/console.php(100): OC\Console\Application->run()
#16 /home/***/public_html/occ(11): require_once('...')
#17 {main}