Repository navigation
Nextcloud 21 beta 1 Error: Call to a member function getContainer() on null #24711
Copy link
Copy link
Closed
Closed
Copy link
Description
Error: Call to a member function getContainer() on null
Error: Undefined index: workflowengine at /var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php#368
{
"reqId": "tkApzuW9IxJofzWJ1Bl2",
"level": 3,
"time": "2020-12-15T15:59:22+00:00",
"remoteAddr": "10.211.55.2",
"user": "axheli",
"app": "no app in context",
"method": "POST",
"url": "/index.php/settings/apps/enable",
"message": {
"Exception": "Error",
"Message": "Call to a member function getContainer() on null",
"Code": 0,
"Trace": [
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php",
"line": 143,
"function": "delegateContainerRegistrations",
"class": "OC\\AppFramework\\Bootstrap\\RegistrationContext",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php",
"line": 86,
"function": "registerApps",
"class": "OC\\AppFramework\\Bootstrap\\Coordinator",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Installer.php",
"line": 144,
"function": "runLazyRegistration",
"class": "OC\\AppFramework\\Bootstrap\\Coordinator",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php",
"line": 448,
"function": "installApp",
"class": "OC\\Installer",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 218,
"function": "enableApps",
"class": "OCA\\Settings\\Controller\\AppSettingsController",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 127,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 157,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 301,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/base.php",
"line": 1008,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/nextcloud/index.php",
"line": 37,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php",
"Line": 369,
"CustomMessage": "Error during service alias registration of workflowengine: Call to a member function getContainer() on null"
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",
"version": "21.0.0.8",
"id": "5fd8eb1ac2eec"
}
{
"reqId": "tkApzuW9IxJofzWJ1Bl2",
"level": 3,
"time": "2020-12-15T15:59:22+00:00",
"remoteAddr": "10.211.55.2",
"user": "axheli",
"app": "PHP",
"method": "POST",
"url": "/index.php/settings/apps/enable",
"message": {
"Exception": "Error",
"Message": "Undefined index: workflowengine at /var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php#368",
"Code": 0,
"Trace": [
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php",
"line": 368,
"function": "onError",
"class": "OC\\Log\\ErrorHandler",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php",
"line": 143,
"function": "delegateContainerRegistrations",
"class": "OC\\AppFramework\\Bootstrap\\RegistrationContext",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php",
"line": 86,
"function": "registerApps",
"class": "OC\\AppFramework\\Bootstrap\\Coordinator",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Installer.php",
"line": 144,
"function": "runLazyRegistration",
"class": "OC\\AppFramework\\Bootstrap\\Coordinator",
"type": "->"
},
{
"file": "/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php",
"line": 448,
"function": "installApp",
"class": "OC\\Installer",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 218,
"function": "enableApps",
"class": "OCA\\Settings\\Controller\\AppSettingsController",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 127,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
"line": 157,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Route/Router.php",
"line": 301,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/nextcloud/lib/base.php",
"line": 1008,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/nextcloud/index.php",
"line": 37,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
"Line": 91,
"CustomMessage": "--"
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",
"version": "21.0.0.8",
"id": "5fd8eb1ac2f20"
}
Reactions are currently unavailable
Activity
kesselb commentedon Dec 15, 2020
cc @ChristophWurst
dartcafe commentedon Dec 28, 2020
Still present with NC21 beta-3.
Error occurs when enabling any app. In polls it seems, that the migration doesn't run properly then (preSchemaChange seems not to be executed). I can't confirm if this relates to this issue, but with NC20 migrations run as expected.
AndyXheli commentedon Jan 16, 2021
Still present with NC21 beta-6.
szaimen commentedon Feb 20, 2021
Also seeing this issue on 21.0.0 final
szaimen commentedon Feb 20, 2021
cc @ChristophWurst
TomasTokaMrazek commentedon Feb 21, 2021
Is there a known fix?
ChristophWurst commentedon Feb 22, 2021
is there any other error logged before the one about the undefined index or the getContainer? I don't see how the code can take that path without any preceding error
szaimen commentedon Feb 22, 2021
I get this one for every app before the getContainer error:
{ "reqId": "QGjRhKM7q7d7EfmjYfQE", "level": 3, "time": "2021-02-20T23:44:17+01:00", "remoteAddr": "", "user": "--", "app": "PHP", "method": "", "url": "--", "message": { "Exception": "Error", "Message": "Undefined index: news at /var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php#421", "Code": 0, "Trace": [ { "file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/RegistrationContext.php", "line": 421, "function": "onError", "class": "OC\\Log\\ErrorHandler", "type": "::" }, { "file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php", "line": 143, "function": "delegateContainerRegistrations", "class": "OC\\AppFramework\\Bootstrap\\RegistrationContext", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php", "line": 86, "function": "registerApps", "class": "OC\\AppFramework\\Bootstrap\\Coordinator", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/Installer.php", "line": 146, "function": "runLazyRegistration", "class": "OC\\AppFramework\\Bootstrap\\Coordinator", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/legacy/OC_App.php", "line": 431, "function": "installApp", "class": "OC\\Installer", "type": "->" }, { "file": "/var/www/nextcloud/core/Command/App/Install.php", "line": 84, "function": "enable", "class": "OC_App", "type": "->" }, { "file": "/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php", "line": 255, "function": "execute", "class": "OC\\Core\\Command\\App\\Install", "type": "->" }, { "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php", "line": 1009, "function": "run", "class": "Symfony\\Component\\Console\\Command\\Command", "type": "->" }, { "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php", "line": 273, "function": "doRunCommand", "class": "Symfony\\Component\\Console\\Application", "type": "->" }, { "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php", "line": 149, "function": "doRun", "class": "Symfony\\Component\\Console\\Application", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/Console/Application.php", "line": 215, "function": "run", "class": "Symfony\\Component\\Console\\Application", "type": "->" }, { "file": "/var/www/nextcloud/console.php", "line": 100, "function": "run", "class": "OC\\Console\\Application", "type": "->" }, { "file": "/var/www/nextcloud/occ", "line": 11, "args": [ "/var/www/nextcloud/console.php" ], "function": "require_once" } ], "File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php", "Line": 92, "CustomMessage": "--" }, "userAgent": "--", "version": "21.0.0.18", "id": "603394c4e7be7" }klou commentedon Feb 24, 2021
I also have the same 2 (sets of) errors, except
...RegistrationContext.php#404amatteo78 commentedon Feb 24, 2021
on NC21 final I see it, have you found any fix ?
ChristophWurst commentedon Feb 24, 2021
Thanks a lot for the log @szaimen. I think I understand it now. There is only one occurrence in the code where we create and write the application instance to the
$appsvariable. And if there's an error there we silently continue.Could someone apply this patch and try again?
szaimen commentedon Feb 24, 2021
I've applied the fix, disabled the news app, enabled it again but the same error messages appear again.

Also unfortunately no new error message was logged, so I'm not sure if the patch works.
BTW: when I enable the news app, all those messages get logged: (which seem to be related to the enable command)
ChristophWurst commentedon Feb 24, 2021
Hmm did you flush your opcache? Try restarting the web server.
szaimen commentedon Feb 24, 2021
Yes, I've cleared the cache (redis and apcu) and restarted the whole server. Still the same.
ChristophWurst commentedon Feb 24, 2021
So it's always erroring at the exact same line. Try this
ChristophWurst commentedon Feb 24, 2021
Now that I think about it I'm very confident that this is actually the problem. Let me also open a PR …
ChristophWurst commentedon Feb 24, 2021
See #25786
szaimen commentedon Feb 24, 2021
I've applied the patch and can confirm that it works. Thank you!
ChristophWurst commentedon Feb 24, 2021
finally 🎊
nikp123 commentedon Mar 21, 2021
For some reason it works when I put offending apps into the non-writable directory, but not it's in wapps
(and yes the wapps dir has properly set up permissions)
Rafael-Kiewning commentedon Mar 23, 2021
Sorry, but I’m new on github. I have the same problem. I’m trying to execute the patch but I can’t. Access denied. For sure I’m making something wrong. Must I specify any thing for git to recognize the patch? Thanks in advance
hobbsecky commentedon Mar 29, 2021
Same here. Thanks!
hobbsecky commentedon Mar 29, 2021
Thanks! Worked for me too.