Can't install app [solved]

Nextcloud version (eg, 20.0.5): 28.0.3
Operating system and version (eg, Ubuntu 20.04): Debian 12.5
Apache or nginx version (eg, Apache 2.4.25): nginx 1.22.1
PHP version (eg, 7.4): 8.1/8.3

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Connect to server
  2. sudo -u www-data php occ app:enable contacts

The output of your Nextcloud log in Admin > Logging:

An unhandled exception has been thrown:
TypeError: in_array(): Argument #2 ($haystack) must be of type array, int given in /usr/local/share/nextcloud/lib/private/Installer.php:129
Stack trace:
#0 /usr/local/share/nextcloud/lib/private/Installer.php(129): in_array()
#1 /usr/local/share/nextcloud/core/Command/App/Enable.php(110): OC\Installer->installApp()
#2 /usr/local/share/nextcloud/core/Command/App/Enable.php(80): OC\Core\Command\App\Enable->enableApp()
#3 /usr/local/share/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OC\Core\Command\App\Enable->execute()
#4 /usr/local/share/nextcloud/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#5 /usr/local/share/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#6 /usr/local/share/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#7 /usr/local/share/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#8 /usr/local/share/nextcloud/console.php(100): OC\Console\Application->run()
#9 /usr/local/share/nextcloud/occ(11): require_once('...')
#10 {main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
'instanceid' => '**********',
'passwordsalt' => '*********',
'secret' => '************',
'trusted_domains' =>
array (
0 => 'nextcloud.*******.***',
),
'datadirectory' => '/usr/local/share/nextcloud/data',
'dbtype' => 'sqlite3',
'version' => '28.0.3.2',
'overwrite.cli.url' => 'https://nextcloud.*******.***',
'installed' => true,
'maintenance' => false,
'theme' => '',
'loglevel' => 0,
'default_phone_region' => 33,
'maintenance_window_start' => 1,
'app_install_overwrite' => 1,
'updater.secret' => '****************************',
);
?>

This line doesn’t make any sense. It’s the cause, but I can’t tell you how it got there.

It would normally - if it exists at all - contain a list of apps one has force enabled to bypass compatibility checks (generally not recommended, but that’s another matter).

You should be able to remove that line since it’s currently got a bogus value anyway.

That’s it
Thank you very much
Don’t know how it comes here, but that work

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.