[Solved] Groupfolder --scan throws getACLManager error

Nextcloud version (eg, 20.0.5): 25.0.8
Operating system and version (eg, Ubuntu 20.04): Debian Buster
Apache or nginx version (eg, Apache 2.4.25): nginx/1.14.2
PHP version (eg, 7.4): 8.1 fpm
Group folders App: 13.1.14

sudo -u www-data /var/www/nextcloud/occ groupfolder --scan <groupfolder number>
fails with the following error;

TypeError: OCA\GroupFolders\ACL\ACLManagerFactory::getACLManager(): Argument #1 ($user) must be of type OCP\IUser, null given, called in /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php on line 206 and defined in /var/www/nextcloud/apps/groupfolders/lib/ACL/ACLManagerFactory.php:37
Stack trace:
#0 /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php(206): OCA\GroupFolders\ACL\ACLManagerFactory->getACLManager()
#1 /var/www/nextcloud/apps/groupfolders/lib/Command/Scan.php(52): OCA\GroupFolders\Mount\MountProvider->getMount()
#2 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\GroupFolders\Command\Scan->execute()
#3 /var/www/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#4 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#5 /var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#7 /var/www/nextcloud/lib/private/Console/Application.php(214): Symfony\Component\Console\Application->run()
#8 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#9 /var/www/nextcloud/occ(11): require_once('...')
#10 {main}

I am, however, able to occ userscan and this is has scanned the users group folders.

Is this the first time you’ve seen this error? (Y/N): Y

The command was working in Nextcloud 24, this is the first time I’ve had to run this command in NC 25. There’s nothing in the nextcloud log or the nginx error log that relate to the command.

Having the exact same error with NC 27, php 8.2.
Have you checked on github or solved the error?

No I haven’t solved it myself, but there is now an issue raised and a patch issued;

…but I’m unsure how to apply the patch without manually editing the app code :
The patch has been merged, so the fix should be in the new build of groupfolders…

Patching is easy!

I’ve patched and it’s working nicely

1 Like

Lovely, I was confused trying to find the download link for the .patch file but there isn’t one… I didn’t read to the end of the patching instructions :slight_smile:
All good now !