Sudden Error: "It looks like you are trying to reinstall your Nextcloud. However the file CAN_INSTALL is missing from your config directory. Please create the file CAN_INSTALL in your config folder to continue."

Nextcloud version: 17.0.2
Operating system and version: Debian 8.11
Apache or nginx version: Apache/2.4.10
PHP version: 7.2

The issue you are facing:

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

Steps to replicate it: Suddenlty my nextcould installation is not working anymore, I have not changed anything, and I’m not trying to (re)-install nextcould.

The output of your Nextcloud log in Admin > Logging:

It looks like you are trying to reinstall your Nextcloud. However the file CAN_INSTALL is missing from your config directory. Please create the file CAN_INSTALL in your config folder to continue.

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

<?php
$CONFIG = array (
  'instanceid' => 'RANDOMSYMBOLS',
);```

…getting the same error when using http://localhost/index.php …NextCloud is installed in SNAP folder and and additional extraction of installation is on /home …but unable to move or merge or change permissions to the SNAP/NextCloud/config folder

@myzinsky @SingShaw how did you solve this problem? Explaining it may help others (like me)!

In my case the problem was a corrupted config.php due to the server disk being full. I’ve restored a backup and solved the problem.
Thank to @erik09 and his post.

Also this error appeared on my Nextcloud installation, like out of the blue. My …/web/nextcloud/config/config.php somehow got nearly empty. I copied the config.php from the <nextcloud_datadir>updater-oc00qcm0h0mx/backups/nextcloud-21.0.5.1-xxxxxxx/config/config.php to the …/web/nextcloud/config/config.php and Nextcloud worked again. It seemed that the version in the config.php was automatically fixed to the real version (which is currently 22.2.0.2 for me).