[FIXED] My config.php is broken after setting the log level

Hello,

I’ve just updated my NC instance to 20.0.4.

I saw there were tons of logs like that:

{“reqId”:“wPemyYcTnUA0CTIQV57S”,“level”:0,“time”:“2020-12-21T12:41:15+00:00”,“remoteAddr”:“90.116.237.15”,“user”:“turman”,“app”:“files_sharing”,“method”:“GET”,“url”:“/cloud/index.php/apps/logreader/poll?lastReqId=b1kU7U7HHbgu41AkKjPS”,“message”:“/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0”,“version”:“20.0.4.0”}

Many messages by second…

In my config.php log level was set to 0 so I set manually to 1 with vi.

But after that my NC instance is broken: the web page says it looks I’m trying to install NC and now the config.php is like that:

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

What I did wrong ? Is it forbidden to edit directly the config.php and only occ commands are allowed in order to modify the config ?

To restore my NC instance, should I recopy the content from data/updater-ocmcbuokwldq/backups/nextcloud-19.0.6.2-1608411150/config/config.php ? I should update the version from 19.0.6 to 20.0.4… but I note the instanceid is also different, I’m very confused…

Thanks for your help, Vincent.

You can definitely edit the config.php by hand, you just need to be careful about the syntax, spacing and use of semicolons. They offer the occ commands since its less difficult to screw things up. Do you have a copy of the original config.php file?

Unfortunately I don’t have a backup of the original config.php.

I just have a backup in data/updater-ocmcbuokwldq/backups/nextcloud-19.0.6.2-1608411150/config/config.php because of my upgrade from 19.0.6 to 20.0.4 but:

  • the version is off course 19.0.6.2 (instead of 20.0.4.??)
  • the instanceid is ocmcbuokwldq as it is ock70ayafa04 in my broken config.php (which looks suspect for me)

Finally I found the content of my original config.php in the console history ! :slight_smile:

I restored it and now my NC instance is working fine…

Than I’ve tried to modify the log level by editing config.php by the hand and with the occ command. Both succeeded so I suppose I have done an error during my first vi edit, sorry for the noise…

1 Like

@turman

Not exactly related to your problem. I’d recommend using vim rather than vi. I’d also possibly looking at the list setting which you can invoke by typing :set list or adding to .vimrc. This will show you tabs, spaces, and return characters within the terminal which is helpful.