"TypeError: Argument 2 passed to OC_App::executeRepairSteps() must be of the type array, null given..." when updating apps

In Nextcloud 19 with PHP 7.3.19, updating apps using occ (command line) results in the following “unhandled exception.” It seems to leave the apps in a state that keeps them from appearing in the occ app:listlisting as well as in Your Apps on the admin console. Since it happens with multiple apps, the cause is most likely not in the apps – today it happened with Notes and Appointments.

I work around this by manually removing the app directory in apps/ and installing the app anew using occ app:installwhich succeeds.

What causes this?

An unhandled exception has been thrown:
TypeError: Argument 2 passed to OC_App::executeRepairSteps() must be of the type array, null given, called in /path/to/nextcloud/lib/private/legacy/OC_App.php on line 904 and defined in /path/to/nextcloud/lib/private/legacy/OC_App.php:956
Stack trace:
#0 /path/to/nextcloud/lib/private/legacy/OC_App.php(904): OC_App::executeRepairSteps('tasks', NULL)
#1 /path/to/nextcloud/lib/private/Installer.php(205): OC_App::updateApp('tasks')
#2 /path/to/nextcloud/core/Command/App/Update.php(109): OC\Installer->updateAppstoreApp('tasks')
#3 /path/to/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\App\Update->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /path/to/nextcloud/3rdparty/symfony/console/Application.php(1012): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /path/to/nextcloud/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\App\Update), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /path/to/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /path/to/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /path/to/nextcloud/console.php(100): OC\Console\Application->run()
#9 /path/to/nextcloud/occ(11): require_once('/path/to/nextcloud...')
#10 {main}

Bump…

This is still happening with Netscape 22.0.0 and PHP 7.3.29. The error occurs when updating most apps using occ app:update. Here’s the output from occ app:update contacts today:

contacts new version available: 4.0.1
An unhandled exception has been thrown:
TypeError: Argument 3 passed to OC_App::checkAppDependencies() must be of the type array, null given, called in /path/to/nextcloud/lib/private/legacy/OC_App.php on line 989 and defined in /path/to/nextcloud/lib/private/legacy/OC_App.php:1185
Stack trace:
#0 /path/to/nextcloud/lib/private/legacy/OC_App.php(989): OC_App::checkAppDependencies(Object(OC\AllConfig), Object(OC\L10N\LazyL10N), NULL, false)
#1 /path/to/nextcloud/lib/private/Installer.php(202): OC_App::updateApp('contacts')
#2 /path/to/nextcloud/core/Command/App/Update.php(115): OC\Installer->updateAppstoreApp('contacts', false)
#3 /path/to/nextcloud/apps/bookmarks/vendor/symfony/console/Command/Command.php(255): OC\Core\Command\App\Update->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /path/to/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /path/to/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\App\Update), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /path/to/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /path/to/nextcloud/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /path/to/nextcloud/console.php(99): OC\Console\Application->run()
#9 /path/to/nextcloud/occ(11): require_once('/path/to/nextcloud...')
#10 {main}

:roll_eyes: not sure if that is helping

I found this bug report: Argument 2 passed to OC_App::isAppCompatible() must be of the type array, null given · Issue #8964 · nextcloud/server · GitHub
Is this any app you try to install?

Where do you install Nextcloud, is this a server (which OS) or webhosting?

I found this bug report: Argument 2 passed to OC_App::isAppCompatible() must be of the type array, null given · Issue #8964 · nextcloud/server · GitHub

This looks similar but it’s in a different method of OC_App. The error I’m seeing may have a similar fix. I’ll report it as an issue.*

I’ve seen this happen with most apps. QOwnNotesAPI is an app whose update did not result in this error.

I use a web hosting service and their OS is FreeBSD 12.2-RELEASE-p2.

*See occ app:update error: Argument 3 passed to OC_App::checkAppDependencies() must be of the type array, null given, called in /path/to/nextcloud/lib/private/legacy/OC_App.php on line 989 and defined in /path/to/nextcloud/lib/private/legacy/OC_App.php:1185 · Issue #28293 · nextcloud/server · GitHub.