Config.php is a stub after update

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, 12.0.2): 17.0.2
Operating system and version (eg, Ubuntu 17.04): arch
Apache or nginx version (eg, Apache 2.4.25): nginx 1.16.1
PHP version (eg, 7.1): 7.3

The issue you are facing:

After an update the nextcloud website invites me to create an admin user etc even though I had been running nextcloud for a while already. It looks like the reason is that my config.php in /etc/webapps/nextcloud/config, which is symlinked from /usr/share/webapps/nextcloud/config is basically empty after now. I can’t tell for sure what caused that, but at least checking the modification times I can tell that the last time config.php was modified is up to 1/2 of a second exactly the time when the update started. Maybe the file has disappeared earlier already and the update just put the stub file there because config.php had already gone, I don’t know. But I don’t know what would have caused the file to disappear if not the update. The ssd where config.php lies has not reported any errors so far.

It looks similar to Nextcloud returns to page "create admin account" after update.

Of course I had been doing backups, but only of /usr/share/webapps/nextcloud, and I hadn’t realized until now that the config folder there is only a symlink, and I configured the update in a way that it preserves symlinks, oh well… I will backup the config files in /etc/ from now on too, had been planning to do that anyways.

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

Steps to replicate it:
I don’t feel like testing that out.

The output of your Nextcloud log in Admin > Logging:
I don’t know where to find this.

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

$CONFIG = array (
  'instanceid' => 'oce7zkjp9x37',

The output of your Apache/nginx/system log in /var/log/____:
Is this interesting?

EDIT: Actually I don’t know too much about how nextcloud works, so it might very well be that my assumption that nextcloud doesn’t work because config.php doesn’t seem to contain much is not correct. In any case, help would be much appreciated.

EDIT: Also when trying to turn on maintenance mode it says that nextcloud is not even installed. And that php says it can’t find imagick.

How did you do the update?

pacman -Syu

It wasn’t even a major update, just from 17.0.1 to 17.0.2.

So probably the package manager did something wrong and replaced files and more. I have never installed nextcloud from packages.

Oh really? I was assuming if this was the case then it would be effecting more people.

But then what should I do now?

  1. tammikuuta 2020 23.40.10 GMT+02:00 Johan Bernhardsson via Nextcloud community kirjoitti:

Check if you have an occ upgrade command in the nextcloud app folder sudo -u www-data /path/to/nextcloud/occ upgrade

and do check for pacman save files. It was some time since i used arch. I dont know the packages system that well only parts of it. In general applications like nextcloud is better installed manually so that it is upgraded separatly from the package system.

Thank you.

There is no pacsave for any nextcloud file.

So what can I do now? I was thinking about trying to write a new config.php manually. Does this make sense? The thing is I dont even know if config.php is the only cause of problems. Or should I run follow the installation instructions of the web interface?

The good thing is all my data seems to be still there and I also have a recent backup of that.

Ah or did you mean that occ upgrade might somehow fix the problem I have right now?

Yes. Normal upgrades when done from within nextcloud runs an upgrade procedure after new files are copied in. You get the option of doing that from the webui or the cli with the occ command

I see thanks. It said ‘nextcloud is not installed’ and ‘command upgrade is not defined’ though.

Hm well actually I knew that. This is actually what I used to have to do when updating. At least for major upgrades. I don’t remember if also for small ones

So should I try to “install” nextcloud, or can that break things?

i rewrote the config.php and so far it is working again.