Server: Argument 2 passed to OC_App::isAppCompatible() must be of the type array, null given

Created on 23 Mar 2018  Â·  6Comments  Â·  Source: nextcloud/server

On a recent update to master, I ran into this Internal Server Error and can not recover from it:

Technical details

    Remote Address: 127.0.0.1
    Request ID: 2Rn8ViN3uHj0d64lFOhz
    Type: TypeError
    Code: 0
    Message: Argument 2 passed to OC_App::isAppCompatible() must be of the type array, null given, called in /home/jan/nextcloud/lib/private/App/AppManager.php on line 414
    File: /home/jan/nextcloud/lib/private/legacy/app.php
    Line: 826


Trace

#0 /home/jan/nextcloud/lib/private/App/AppManager.php(414): OC_App::isAppCompatible('14.0.0.1', NULL)
#1 /home/jan/nextcloud/lib/base.php(377): OC\App\AppManager->getIncompatibleApps('14.0.0.1')
#2 /home/jan/nextcloud/lib/base.php(936): OC::printUpgradePage(Object(OC\SystemConfig))
#3 /home/jan/nextcloud/index.php(37): OC::handleRequest()
#4 {main}

Stable13 works without any problem. By now I already went and disabled every single app via the app management, but that does not solve the problem either.

Any ideas?

1. to develop bug

Most helpful comment

This is caused by the type hinting added by 9dc3b0480228a3c35b3b7a7cb1a904006f7e0762

@jancborchardt My guess would be that there is an app that doesn't return proper app info, can you check by adding the following snippet after https://github.com/nextcloud/server/blob/514de5dfa18d92d2f7bb15c9840d685b25300f4c/lib/private/App/AppManager.php#L413 and check the log output.

if ($info === null) {
  \OC::$server->getLogger()->error('$info null for ' . $appId);
}

I'll prepare a patch to not fail hard in that case, but we should also investigate the root cause.

All 6 comments

This is caused by the type hinting added by 9dc3b0480228a3c35b3b7a7cb1a904006f7e0762

@jancborchardt My guess would be that there is an app that doesn't return proper app info, can you check by adding the following snippet after https://github.com/nextcloud/server/blob/514de5dfa18d92d2f7bb15c9840d685b25300f4c/lib/private/App/AppManager.php#L413 and check the log output.

if ($info === null) {
  \OC::$server->getLogger()->error('$info null for ' . $appId);
}

I'll prepare a patch to not fail hard in that case, but we should also investigate the root cause.

@juliushaertl thanks! It seems to have been nextcloud_announcements:

{"reqId":"GoEHI24hlsLXdoIZZfEr","level":3,"time":"2018-03-27T12:03:47+00:00","remoteAddr":"127.0.0.1","user":"--","app":"no app in context","method":"GET","url":"\/nextcloud\/","message":"$info null for nextcloud_announcements","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko\/20100101 Firefox\/59.0","version":"13.0.1.1"}
{"reqId":"GoEHI24hlsLXdoIZZfEr","level":3,"time":"2018-03-27T12:03:47+00:00","remoteAddr":"127.0.0.1","user":"--","app":"index","method":"GET","url":"\/nextcloud\/","message":"Exception: {\"Exception\":\"TypeError\",\"Message\":\"Argument 2 passed to OC_App::isAppCompatible() must be of the type array, null given, called in \\\/home\\\/jan\\\/nextcloud\\\/lib\\\/private\\\/App\\\/AppManager.php on line 417\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/jan\\\/nextcloud\\\/lib\\\/private\\\/App\\\/AppManager.php(417): OC_App::isAppCompatible('14.0.0.1', NULL)\\n#1 \\\/home\\\/jan\\\/nextcloud\\\/lib\\\/base.php(377): OC\\\\App\\\\AppManager->getIncompatibleApps('14.0.0.1')\\n#2 \\\/home\\\/jan\\\/nextcloud\\\/lib\\\/base.php(936): OC::printUpgradePage(Object(OC\\\\SystemConfig))\\n#3 \\\/home\\\/jan\\\/nextcloud\\\/index.php(37): OC::handleRequest()\\n#4 {main}\",\"File\":\"\\\/home\\\/jan\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/app.php\",\"Line\":826}","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko\/20100101 Firefox\/59.0","version":"13.0.1.1"}

I think it was because I removed some apps before update (among them nextcloud_announcements) because of this warning about updating apps to the proper version etc. And now that I checked, nextcloud_announcements was just an empty folder.
Removing the empty folder did not help, only recloning from https://github.com/nextcloud/nextcloud_announcements/

– Aaand now it’s password_policy:

{"reqId":"KHQ1FEJP8O0akgw1Z233","level":3,"time":"2018-03-27T12:07:52+00:00","remoteAddr":"127.0.0.1","user":"--","app":"no app in context","method":"GET","url":"\/nextcloud\/","message":"$info null for password_policy","userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko\/20100101 Firefox\/59.0","version":"13.0.1.1"}

I assume it was wrong to remove those apps? Are they shipped by default or so? Will update as I fix apps step by step, but this feels like it shouldn’t fail hard even if the apps are removed?

Those two were actually it! Thanks a lot @juliushaertl, now the update went through. :tada:

@kyrofa experienced the same issue:

Mar 27 13:36:18 Pandora nextcloud.apache[14971]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: You may use your browser or the occ upgrade command to do the upgrade
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: System config value redis => host set to string /tmp/sockets/redis.sock
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: You may use your browser or the occ upgrade command to do the upgrade
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: System config value redis => port set to integer 0
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: You may use your browser or the occ upgrade command to do the upgrade
Mar 27 13:36:18 Pandora nextcloud.apache[14971]: System config value memcache.locking set to string \OC\Memcache\Redis
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: You may use your browser or the occ upgrade command to do the upgrade
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: System config value memcache.local set to string \OC\Memcache\Redis
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: Making sure nextcloud is fully upgraded...
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: You may use your browser or the occ upgrade command to do the upgrade
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: Set log level to debug
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: Updating database schema
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: Updated database
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: An unhandled exception has been thrown:
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: TypeError: Argument 2 passed to OC_App::isAppCompatible() must be of the type array, null given, called in /snap/nextcloud/x2/htdocs/lib/private/Updater.php o
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: Stack trace:
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #0 /snap/nextcloud/x2/htdocs/lib/private/Updater.php(394): OC_App::isAppCompatible('14.0.0.1', NULL)
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #1 /snap/nextcloud/x2/htdocs/lib/private/Updater.php(243): OC\Updater->checkAppsRequirements()
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #2 /snap/nextcloud/x2/htdocs/lib/private/Updater.php(120): OC\Updater->doUpgrade('14.0.0.1', '13.0.1.1')
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #3 /snap/nextcloud/x2/htdocs/core/Command/Upgrade.php(258): OC\Updater->upgrade()
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #4 /snap/nextcloud/x2/htdocs/3rdparty/symfony/console/Command/Command.php(264): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvIn
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #5 /snap/nextcloud/x2/htdocs/3rdparty/symfony/console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\In
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #6 /snap/nextcloud/x2/htdocs/3rdparty/symfony/console/Application.php(228): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #7 /snap/nextcloud/x2/htdocs/3rdparty/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Inpu
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #8 /snap/nextcloud/x2/htdocs/lib/private/Console/Application.php(173): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvI
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #9 /snap/nextcloud/x2/htdocs/console.php(90): OC\Console\Application->run()
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #10 /snap/nextcloud/x2/htdocs/occ(11): require_once('/snap/nextcloud...')
Mar 27 13:36:19 Pandora nextcloud.apache[14971]: #11 {main}Nextcloud is not yet installed-- no upgrade necessary

Fixed with #9008

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChristophWurst picture ChristophWurst  Â·  3Comments

blackcrack picture blackcrack  Â·  3Comments

georgehrke picture georgehrke  Â·  3Comments

brylie picture brylie  Â·  3Comments

mama21mama picture mama21mama  Â·  3Comments