I have a quite young nextcloud running at home on a Pi 4.
I started not to move some data there. To speed this up (and to avoid strange errors when using the nextcloud desktop client), I copied the files directly to the USB HDD.
Then, I ran “ncp’s fix permissions” and then “ncp-scan”.
With the first set up files this worked fine.
Now, I copied the next couple of GBs, and when I run ncp-scan, I get this error message:
pi@nextcloudpi:~ $ sudo ncp-scan
Nextcloud is in maintenance mode - no apps have been loaded
In Application.php line 583:
[Symfony\Component\Console\Exception\NamespaceNotFoundException]
There are no commands defined in the "files" namespace.
Exception trace:
at /var/www/nextcloud/3rdparty/symfony/console/Application.php:583
Symfony\Component\Console\Application->findNamespace() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:632
Symfony\Component\Console\Application->find() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:236
Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:214
OC\Console\Application->run() at /var/www/nextcloud/console.php:99
require_once() at /var/www/nextcloud/occ:11
I think that is in reference to occ which (I think) is being run on the backend when you run ncp-scan. On a normal installation you would run occ files:scan to do that.
there is a easier way:
dont put your cloud under maintenance mode
You must do the scan under “live-environment”…i dont know why, but i tested it:
if my cloud was put in maintenance mode i get this error: There are no commands defined in the “files” namespace.
if i do the scan NOT under maintenance it scans all correctly.
I’m not aware of any actual risks, and you don’t have much choice anyways since the occ files command doesn’t work when Nextcloud is in maintenance mode. However, you could stop your web server if you want to prevent your users from accessing Nextcloud while the scan is running, which might have a positive impact on performance.