Error during encryption

Hello,

I am trying to encrypt my files on the server with the command

sudo -u www-data php occ encryption:encrypt-all

You are about to encrypt all files stored in your Nextcloud installation.
Depending on the number of available files, and their size, this may take quite some time.
Please ensure that no user accesses their files during this time!
Note: The encryption module you use determines which files get encrypted.

Do you really want to continue? (y/n) y

Encrypt all files with the Default encryption module

Use master key to encrypt all files.

Start to encrypt users files

encrypt files for user user1 (1): /user1/files/Test - EY/Q3 2024.zip
[—>------------------------]An unhandled exception has been thrown:
TypeError: OC\Files\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/View.php on line 500 and defined in /var/www/nextcloud/lib/private/Files/View.php:1176
Stack trace:
#0 /var/www/nextcloud/lib/private/Files/View.php(500): OC\Files\View->basicOperation()
#1 /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php(339): OC\Files\View->file_exists()
#2 /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php(104): OCA\Files_Versions\Listener\FileEventsListener->pre_renameOrCopy_hook()
#3 /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php(68): OCA\Files_Versions\Listener\FileEventsListener->handle()
#4 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(220): OC\EventDispatcher\ServiceEventListener->__invoke()
#5 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#6 /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(67): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#7 /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(79): OC\EventDispatcher\EventDispatcher->dispatch()
#8 /var/www/nextcloud/lib/private/Files/Node/HookConnector.php(155): OC\EventDispatcher\EventDispatcher->dispatchTyped()
#9 /var/www/nextcloud/lib/private/legacy/OC_Hook.php(82): OC\Files\Node\HookConnector->rename()
#10 /var/www/nextcloud/lib/private/Files/View.php(751): OC_Hook::emit()
#11 /var/www/nextcloud/apps/encryption/lib/Crypto/EncryptAll.php(282): OC\Files\View->rename()
#12 /var/www/nextcloud/apps/encryption/lib/Crypto/EncryptAll.php(254): OCA\Encryption\Crypto\EncryptAll->encryptFile()
#13 /var/www/nextcloud/apps/encryption/lib/Crypto/EncryptAll.php(224): OCA\Encryption\Crypto\EncryptAll->encryptUsersFiles()
#14 /var/www/nextcloud/apps/encryption/lib/Crypto/EncryptAll.php(198): OCA\Encryption\Crypto\EncryptAll->encryptAllUserFilesWithMasterKey()
#15 /var/www/nextcloud/apps/encryption/lib/Crypto/EncryptAll.php(148): OCA\Encryption\Crypto\EncryptAll->encryptAllUsersFiles()
#16 /var/www/nextcloud/apps/encryption/lib/Crypto/Encryption.php(467): OCA\Encryption\Crypto\EncryptAll->encryptAll()
#17 /var/www/nextcloud/core/Command/Encryption/EncryptAll.php(88): OCA\Encryption\Crypto\Encryption->encryptAll()
#18 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(326): OC\Core\Command\Encryption\EncryptAll->execute()
#19 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run()
#20 /var/www/nextcloud/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand()
#21 /var/www/nextcloud/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun()
#22 /var/www/nextcloud/lib/private/Console/Application.php(183): Symfony\Component\Console\Application->run()
#23 /var/www/nextcloud/console.php(87): OC\Console\Application->run()
#24 /var/www/nextcloud/occ(33): require_once(‘…’)

I see that the file Test - EY/Q3 2024.zip does not exist in the /user1/files/ directory.

I’m experiencing the same thing with other accounts.

I tried the command: sudo -u www-data php occ files:scan --all
but it did nothing.

[Nextcloud Hub 9] (30.0.8)

Could you help me please?

The problem seems to occur with shared folders and files. Is there any action to take, please?