Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jancborchardt opened this issue Mar 23, 2018 · 6 comments
Labels
1. to develop Accepted and waiting to be taken care of bug
Milestone

Comments

@jancborchardt
Copy link
Member

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?

@juliusknorr
Copy link
Member

juliusknorr commented Mar 26, 2018

This is caused by the type hinting added by 9dc3b04

@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

$info = $this->getAppInfo($appId);
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.

@jancborchardt
Copy link
Member Author

@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?

@jancborchardt
Copy link
Member Author

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

@skjnldsv
Copy link
Member

@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

@skjnldsv skjnldsv added the 1. to develop Accepted and waiting to be taken care of label Mar 28, 2018
@juliusknorr
Copy link
Member

Fix is in #9008

@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Apr 3, 2018
@MorrisJobke
Copy link
Member

Fixed with #9008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug
Projects
None yet
Development

No branches or pull requests

4 participants