HELP! Nextcloud wants to reinstall, but I don't want to

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5):
Operating system and version (eg, Ubuntu 20.04): Debian 10 (buster) / Raspbian (32bit)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.38-3
PHP version (eg, 7.4): PHP 8.0.16-1

The issue you are facing:

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

Steps to replicate it:

  1. Rename config.php to test1234

  2. Wait until the background cron.php job runs once again or trigger it manually (it will crash):
    root@germanicus:/var/www/nextcloud/config# sudo -u www-data php -f /var/www/nextcloud/cron.php --define apc.enable_cli=1
    Exception: Not installed in /var/www/nextcloud/lib/base.php:276
    Stack trace:
    #0 /var/www/nextcloud/lib/base.php(643): OC::checkInstalled()
    #1 /var/www/nextcloud/lib/base.php(1076): OC::init()
    #2 /var/www/nextcloud/cron.php(43): require_once(’…’)
    #3 {main}

  3. Browse to from nextcloud

  4. Error message appears: It looks like you are trying to reinstall Nextcloud. CAN_INSTALL file is missing to proceed

  5. Rename test1234 to config.php once again

  6. Error message persists

  7. Reboot does not fix the issue :frowning:

The output of your Nextcloud log in Admin > Logging:

Too much output to paste here, can check it later

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

$CONFIG = array (
  'instanceid' => 'oceru6sviz2u',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
    2 => '',
  'datadirectory' => '/opt/nextcloud/DATA',
  'tempdirectory' => '/opt/nextcloud/DATA/TEMP_UPLOAD',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => 'true',
  'maintenance' => false,
  'ldapIgnoreNamingRules' => 'false',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'theme' => '',
  'loglevel' => 3,
  'log_type' => 'file',
  'logfile' => '/opt/nextcloud/DATA/nextcloud.log',
  'default_phone_region' => 'DE',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => '0',
    'timeout' => '0.0',
    'password' => 'xxx',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'data-fingerprint' => 'xxx',
  'defaultapp' => 'spreed,files',
  'default_language' => 'de',

The output of your Apache/nginx/system log in /var/log/____:

No logs related to this issue

How can I rewind this?


I checked the config.php file - the installed = true parameter is still there

there is also no CAN_INSTALL file in my config/config.php

There is also no other config.php on my system available

When you asked me why I did this:
I did it, because I had errors in webui admin overview regarding missing “default_phone_region” and missing memory caching, although the config.php delivers these information.

It did also not accept the settings when I manually tried to configure these “missing” information over command line.

For example, this did not change anything on nextcloud’s behaviour:

root@germanicus:/var/www/nextcloud# sudo -u www-data php occ config:system:set default_phone_region --value=“DE”
System config value default_phone_region set to string DE

I thought this step is helpful for the nextcloud to finally recognize the specific settings.

The manual launch of cron.php is still working without any issue and error and I thought it should fix the status back to “normal”

The permissions for www-data on config.php is also good (640):

root@germanicus:/var/www/nextcloud# ls -lah config/config.php
-rw-r----- 1 www-data www-data 1,6K Feb 24 16:28 config/config.php

What else needs to be done to make the nextcloud understand that it is installed?

Many thanks for any kind of help!

Could the problem be solved to do a reinstallation with the same version (NC following the manual upgrade guide?

In detail:

  1. Stopping the webserver + php

  2. Rename the nextcloud folder

  3. Unzipping nextcloud zip file

  4. Importing the current config.php

  5. doing an occ upgrade

I want to know if the “installed” status is only logged inside the config.php or is it a column inside the mysql database?

Please let me know. I could not find this information in the internet…

By the way, this is my status.php:

root@germanicus:/var/www/nextcloud# sudo -u www-data php8.0 -f status.php
[installed] => 1
[maintenance] =>
[needsDbUpgrade] =>
[version] =>
[versionstring] => 21.0.9
[edition] =>
[productname] => xxx
[extendedSupport] =>

Is it normal behaviour, that the maintenance mode has no entry, although config.php the line has ‘maintenance’ => false, ?

Also occ status claims that maintenance mode is disabled:

root@germanicus:~# cd /var/www/nextcloud
root@germanicus:/var/www/nextcloud# sudo -u www-data php occ status

  • installed: true
  • version:
  • versionstring: 21.0.9
  • edition:

root@germanicus:/var/www/nextcloud# sudo -u www-data php occ maintenance:mode
Maintenance mode is currently disabled

Hello together,

as I was finding no other solution to revert the “install mode”, I did reinstall the Nextcloud

In the installation wizard, I chose the same database name, same database user and password.

When the installation was done, I restored my working database - which of course has been backuped before.

I modified the config.php to use my old “appdata_xxx” and also all the other parameters from my previous config.php

Well that’s not a real solution for the issue I had, but it’s a solution for the situation.

To anyone, who stumbles upon this thread:

NEVER EVER rename your /var/www/nextcloud/config/config.php when the nextcloud is running.

The next “sudo -u www-data php -f /var/www/nextcloud/cron.php” WILL crash your installation and for me there was no way back. Renaming the file back to “config.php” did not solve the problem. I was stuck in the “re-installation mode”. I could not find any information on the internet to come back to a normal mode. The “installed” => ‘true’, config in my config.php simply was ignored.