nextcloud / backup

Backup now. Restore later.
GNU Affero General Public License v3.0
249 stars 37 forks source link

[Bug] Upload to external storage fails due to getUID() on null in flow notifications #468

Closed bogie closed 11 months ago

bogie commented 1 year ago

First of all I am not sure if this bug belongs here or on any of the other involved apps:

Specs:

I have no workflows on my install.

Reproduction:

  1. Create full restore point via CLI
  2. Pack restore point via CLI
  3. Upload restore point via CLI

Error:

20:23:55 [root@comm]:/usr/share/webapps/nextcloud$ sudo -u www-data php occ backup:point:upload 20230108034249-full-5z3pxk6ErvtrMCr
PHP Warning:  Module 'ldap' already loaded in Unknown on line 0
PHP Warning:  Module 'mbstring' already loaded in Unknown on line 0
- uploading 20230108034249-full-5z3pxk6ErvtrMCr to external folders
 - checking external folder 35:backups
  > restoring point not found
  * Creating Restoring Point on external folder: An unhandled exception has been thrown:
Error: Call to a member function getUID() on null in /usr/share/webapps/nextcloud/apps/workflowengine/lib/Entity/File.php:140
Stack trace:
#0 /usr/share/webapps/nextcloud/apps/workflowengine/lib/Service/RuleMatcher.php(157): OCA\WorkflowEngine\Entity\File->isLegitimatedForUserId()
#1 /usr/share/webapps/nextcloud/apps/workflowengine/lib/Service/RuleMatcher.php(128): OCA\WorkflowEngine\Service\RuleMatcher->getMatchingOperations()
#2 /usr/share/webapps/nextcloud/apps/flow_notifications/lib/Flow/Operation.php(112): OCA\WorkflowEngine\Service\RuleMatcher->getFlows()
#3 /usr/share/webapps/nextcloud/apps/workflowengine/lib/AppInfo/Application.php(106): OCA\FlowNotifications\Flow\Operation->onEvent()
#4 /usr/share/webapps/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(251): OCA\WorkflowEngine\AppInfo\Application->OCA\WorkflowEngine\AppInfo\{closure}()
#5 /usr/share/webapps/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#6 /usr/share/webapps/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(88): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#7 /usr/share/webapps/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php(99): OC\EventDispatcher\EventDispatcher->dispatch()
#8 /usr/share/webapps/nextcloud/lib/private/Files/Node/HookConnector.php(115): OC\EventDispatcher\SymfonyAdapter->dispatch()
#9 /usr/share/webapps/nextcloud/lib/private/legacy/OC_Hook.php(106): OC\Files\Node\HookConnector->postWrite()
#10 /usr/share/webapps/nextcloud/lib/private/Files/View.php(1294): OC_Hook::emit()
#11 /usr/share/webapps/nextcloud/lib/private/Files/View.php(1222): OC\Files\View->runHooks()
#12 /usr/share/webapps/nextcloud/lib/private/Files/View.php(705): OC\Files\View->basicOperation()
#13 /usr/share/webapps/nextcloud/lib/private/Files/Node/Folder.php(191): OC\Files\View->file_put_contents()
#14 /usr/share/webapps/nextcloud/apps/backup/lib/Service/ExternalFolderService.php(530): OC\Files\Node\Folder->newFile()
#15 /usr/share/webapps/nextcloud/apps/backup/lib/Service/ExternalFolderService.php(452): OCA\Backup\Service\ExternalFolderService->updateMetadataFile()
#16 /usr/share/webapps/nextcloud/apps/backup/lib/Service/ExternalFolderService.php(385): OCA\Backup\Service\ExternalFolderService->createPoint()
#17 /usr/share/webapps/nextcloud/apps/backup/lib/Service/UploadService.php(318): OCA\Backup\Service\ExternalFolderService->confirmPoint()
#18 /usr/share/webapps/nextcloud/apps/backup/lib/Service/UploadService.php(178): OCA\Backup\Service\UploadService->uploadToExternalFolder()
#19 /usr/share/webapps/nextcloud/apps/backup/lib/Command/PointUpload.php(143): OCA\Backup\Service\UploadService->uploadPoint()
#20 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Backup\Command\PointUpload->execute()
#21 /usr/share/webapps/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#22 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#23 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#24 /usr/share/webapps/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#25 /usr/share/webapps/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#26 /usr/share/webapps/nextcloud/console.php(100): OC\Console\Application->run()
#27 /usr/share/webapps/nextcloud/occ(11): require_once('/usr/share/weba...')

Temporary fix:

Disable the following apps:

  1. Activity (See issue), maybe not needed
  2. flow_notifications
e-bits commented 1 year ago

Same here, but disabling Activity doesn't help.

nyok92 commented 1 year ago

CLI working on fresh install of Nextcloud 26.0.1 docker but I had to disable the versions app. I can create, pack and upload to a SMB external share

solracsf commented 11 months ago

https://github.com/nextcloud/server/pull/41404 should fix it.