"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.

I had this same issue.

Mine appeared to be the mail app. Followed issue #28293 from the Github link you posted and I started disabling apps. Disabled mail and was able to fix this with the following commands

sudo -u www-data php occ app:disable mail
sudo -u www-data php occ maintenance:repair
sudo -u www-data php occ update
sudo -u www-data php occ maintenance:mode --off

Hope this helps

Hi, i have a similar problem running NC update from 24.0.7 to 25.0.1 on a raspberry pie P400 with apache2 and php7.4.33:

While updating the fllowing error occurs:

An unhandled exception has been thrown:
TypeError: in_array() expects parameter 2 to be array, string given in /var/www/html/nextcloud/lib/private/legacy/OC_App.php:992
Stack trace:
#0 /var/www/html/nextcloud/lib/private/legacy/OC_App.php(992): in_array()
#1 /var/www/html/nextcloud/lib/private/Updater.php(361): OC_App::updateApp()
#2 /var/www/html/nextcloud/lib/private/Updater.php(273): OC\Updater->doAppUpgrade()
#3 /var/www/html/nextcloud/lib/private/Updater.php(141): OC\Updater->doUpgrade()
#4 /var/www/html/nextcloud/core/Command/Upgrade.php(225): OC\Updater->upgrade()
#5 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute()
#6 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#7 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#8 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#9 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#10 /var/www/html/nextcloud/console.php(100): OC\Console\Application->run()
#11 /var/www/html/nextcloud/occ(11): require_once(‘/var/www/html/n…’)

The line 992 in OC_App.php looks like this:
$ignoreMax = in_array($appId, $ignoreMaxApps, true);

I just disabled several apps, but without success.

Can you guys help me please.
Best regards Maxi

Note that your error is not related to the thread you are posting in.

What do you have in app_install_overwrite in your config? It needs to be an array.

Thank you for your answer and sorry for posting in the wrong thread…

in my NC config this position looks like this:

‘app_install_overwrite’ => ‘’,

What should i write in this position?

Best regards!

Just remove the line I suppose? It does not seem to be part of default config anyway. Or replace '' by [] so that it’s an array.

OMG it worked perfectly. I updated NC to 25.0.1 without any problems after deleting
‘app_install_overwrite’ => ‘’,
from my config.php file in /var/www/html/nextcloud/config.

Thank you good Sir!
But i am interested where you have seen where my problem was, because i don’t…

Big Thanks!!!

Well the error complains about the second parameter in the line you showed, which is $ignoreMaxApps. If you look above in the line before you can see this variable is directly taken from configuration.

Do you know how this line ended up in your configuration? Was it from an older Nextcloud version? Maybe we need to fix the code to better react to this.

Thank you for your detailed description!
As i can remember i installed NC directly via apt-get manually circa 6 month ago.
I changed just a little in the config file, therefore it was in it since installation.

Thank you again MCMic, Great Job!