Configuration was not read or initialized correctly, not overwriting /var/snap/nextcloud/45728/nextcloud/config/config.php

Hello,

while i was trying to enable the Preview Generator app in nextcloud, after a lot of ls commands, i typed the command: sudo nextcloud.occ preview:generate-all

in that moment the GUI of my nextcloud turned off and showed me the next error:“Error: configuration was not read or initialized correctly, not overwriting /var/snap/nextcloud/45728/nextcloud/config/config.php”

I did not modified anything in config.php

After 5 min i restarted my UBUNTU server where snap NextCloud was installed. After the Ubuntu Server was restarted my nextcloud - https://alincloud.go.ro/index.php/ → did respond it anymore showing: “This site can’t be reached”

How can i fix it?

I can’t think of anything in the previewgenerator app that would cause a config write on its own.

One possibility that comes to mind which is that your instance just happened to try to update at the same time: Nextcloud Snap: Updates. (In which case there is a revert procedure that could help, but I’d personally want to check my logs a bit more to confirm that that an update even took place before running that - just to confirm).

If it’s not update related:

  • I’d also suggest checking (and maybe posting) the last couple entries from your nextcloud.log from during that time period.

  • Might be worth checking the logs of your host system itself too (i.e. via journalctl) in case it was triggered by something disk I/O related (I only mention that because preview:generate-all is a really heavy consumer of system resources so it is also a bit of a stress test if there are any hardware problems).

See FAQ’s

  • Disable previewgenerator:
sudo nextcloud.occ app:disable previewgenerator

Preview generator app and rescan and cleanup