Update to groupfolders 14.0.3 throws errors concerning /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php on line 206

Updated the groupfolders app to 14.0.3 (seems to be latest stable for NC 26.x instances)
and got now errors like

[cron] Fehler: 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 at <>

and detailed

[cron] Fehler: 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 at <<closure>>

0. /var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php line 206
   OCA\GroupFolders\ACL\ACLManagerFactory->getACLManager()
1. /var/www/nextcloud/apps/groupfolders/lib/Versions/VersionsBackend.php line 172
   OCA\GroupFolders\Mount\MountProvider->getMount()
2. /var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php line 68
   OCA\GroupFolders\Versions\VersionsBackend->getAllVersionedFiles()
3. /var/www/nextcloud/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php line 59
   OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireFolder()
4. /var/www/nextcloud/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php line 43
   OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireAll()
5. /var/www/nextcloud/lib/public/BackgroundJob/Job.php line 78
   OCA\GroupFolders\BackgroundJob\ExpireGroupVersions->run()
6. /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php line 103
   OCP\BackgroundJob\Job->start()
7. /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php line 93
   OCP\BackgroundJob\TimedJob->start()
8. /var/www/nextcloud/cron.php line 152
   OCP\BackgroundJob\TimedJob->execute()

at 2023-07-19T18:35:01+02:00

The error seems to occur during cron jobs but the error does not to be logged as often as cron jobs are running. So only a few cron jobs cause the log to be triggered by these errors - unknown root / where does this come from?

Thanks for any help or ideas.

Hello ! Same issue here, doesn’t seem serious. On our part the cron is called every 15 min, but for some reason the error is thrown only at 11:00 CEST…

See

Fix already in pipeline

2 Likes

Is the fix in pipeline or released?
I am facing the same issues still…

[root@nextcloud ~]# sudo -u apache php --define apc.enable_cli=1  /var/www/nextcloud/occ groupfolders:scan --all
An unhandled exception has been thrown:
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(82): OCA\GroupFolders\Mount\MountProvider->getMount()
#2 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): 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(1040): OC\Core\Command\Base->run()
#5 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#6 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#7 /var/www/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#8 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#9 /var/www/nextcloud/occ(11): require_once('...')

I have followed the steps.
I get no errors with all commands without the command:
sudo -u apache php --define apc.enable_cli=1 /var/www/nextcloud/occ groupfolders:scan --all, the output is on top of my message.

hope someone can provide information

It is in the pipeline. In other words, there is already a PR with a fix (as you could have seen if you did read the above link).
This is the PR (Pull Request) with that fix:

You can apply that fix by adapting the changes to your server according to → this diff ←

or patch your server: → Here is explained how to apply a patch ←

Or - if all this looks too complicated, just wait until the next bugfix release.

Hope that helps,
much luck!

1 Like

thank you i haved missed the ->this diff ← part :slight_smile:
This fixed it directly.
Waiting for the update so its also patched in further versions!

But the hotfix is at easy as changing 4 lines of code.

1 Like

Groupfolders 13.1.4 unter Nextcloud 25.0.9 hat das gleiche Problem.
(Nextcloud 25.0.9 ist die aktuellste Version auf Univention Server)

[cron] Fehler: TypeError: OCA\GroupFolders\ACL\ACLManagerFactory::getACLManager(): Argument #1 ($user) must be of type OCP\IUser, null given, called in /var/www/html/apps/groupfolders/lib/Mount/MountProvider.php on line 206 at <>

  1. /var/www/html/apps/groupfolders/lib/Mount/MountProvider.php line 206
    OCA\GroupFolders\ACL\ACLManagerFactory->getACLManager()
  2. /var/www/html/apps/groupfolders/lib/Versions/VersionsBackend.php line 172
    OCA\GroupFolders\Mount\MountProvider->getMount()
  3. /var/www/html/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php line 68
    OCA\GroupFolders\Versions\VersionsBackend->getAllVersionedFiles()
  4. /var/www/html/apps/groupfolders/lib/Versions/GroupVersionsExpireManager.php line 59
    OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireFolder()
  5. /var/www/html/apps/groupfolders/lib/BackgroundJob/ExpireGroupVersions.php line 43
    OCA\GroupFolders\Versions\GroupVersionsExpireManager->expireAll()
  6. /var/www/html/lib/public/BackgroundJob/Job.php line 78
    OCA\GroupFolders\BackgroundJob\ExpireGroupVersions->run()
  7. /var/www/html/lib/public/BackgroundJob/TimedJob.php line 103
    OCP\BackgroundJob\Job->start()
  8. /var/www/html/lib/public/BackgroundJob/TimedJob.php line 93
    OCP\BackgroundJob\TimedJob->start()
  9. /var/www/html/cron.php line 152
    OCP\BackgroundJob\TimedJob->execute()

at 2023-08-06T03:50:02+00:00

klappt der Fix (s.o)?
bei mir war’s ok nach Anwendung diff
Check if $user is set before calling it by solracsf · Pull Request #2476 · nextcloud/groupfolders · GitHub

Da es eine andere Version ist, traue ich mich nicht, blind so etwas auszuführen. Auch ist mir nicht klar, welche Version(en) gefixt ist/sind.

the yesterday outcoming 15.0.2 contains the patch (it seems to be the version for NC 27.x instances)

1 Like

I will try with my Nextcloud 25, too, because there also is an new version of groupfolders available now. Thank you for the hint.

Edit
It seems to work now.
Previous to the update of the app I received the error message above every 12 hours.
After update to version 13.1.5 for Nextcloud 25.0.9 the error messages disappeared.

Edit 2:
Seems to work properly now. No error message since installing the new groupfolder update.

I can confirm that group folder scan works again with app version 14.04 on NC 26.0.4 (snap).

there seems to be something wrong with the file count though.
Scan of groupfolders report:

+-----------+---------+-------+--------------+
| Folder Id | Folders | Files | Elapsed time |
+-----------+---------+-------+--------------+
| 1         | 20986   | 1930  | 00:00:39     |
| 2         | 0       | 1     | 00:00:00     |
| 3         | 642     | 2     | 00:00:00     |
+-----------+---------+-------+--------------+

while the folder #1 contains

1929 directories, 20981 files

issue reported already here: groupfolders:scan --all inverts files and folders count in report · Issue #2492 · nextcloud/groupfolders · GitHub

1 Like