Nextcloud not working after unclean shutdowns

Nextcloud version: 23.0.2snap1
Operating system and version: Fedora 35
Apache or nginx version: Not sure, it’s supplied with the snap
PHP version: Not sure, it’s supplied with the snap

The issue you are facing:

After an unfortunate series of power outages with unclean shutdowns and incomplete startups - I mean some of the shutdowns happened while the system was coming up - nextcloud configuration files seem to have been corrupted, and it started failing with errors including:

...
Apr 11 07:55:53 umbrella nextcloud.apache[1920]: done
Apr 11 07:55:54 umbrella nextcloud.apache[3713]: Nextcloud is not installed - only a limited number of commands are available
Apr 11 07:55:54 umbrella nextcloud.nextcloud-cron[3775]: Nextcloud is not installed - only a limited number of commands are available
Apr 11 07:55:54 umbrella nextcloud.apache[3713]: Cannot write into "apps" directory
Apr 11 07:55:54 umbrella nextcloud.apache[3713]: This can usually be fixed by giving the webserver write access to the apps directory or disabling the App Store in the config file.
...

And about once a second:

...
Apr 13 17:39:36 umbrella nextcloud.nextcloud-fixer[142772]: Nextcloud is not installed - only a limited number of commands are available
Apr 13 17:39:37 umbrella nextcloud.nextcloud-fixer[142843]: Nextcloud is not installed - only a limited number of commands are available
Apr 13 17:39:38 umbrella nextcloud.nextcloud-fixer[142913]: Nextcloud is not installed - only a limited number of commands are available

...

I found that the config.php seemed to be nearly empty - I don’t know if this is expected or not with newer releases. It had only:

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

I copied over a saved version of it that I last had working and restarted the snap.

The apache side now comes up, but I get this once (not every second):

Apr 14 07:21:52 umbrella nextcloud.nextcloud-fixer[3092100]: Waiting for Nextcloud to be installed...

And accessing via the web page gives me an “Internal Server Error”, this (funny how this is getting formatted even though it’s all in backtics):

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

But I can’t find any server logs with anything of note.

Any ideas on what I need to fix?

Where would the nextcloud errors be logged? Nothing new is showing up when I access it via the web site except for messages in /var/snap/nextcloud/29929/logs/apache_access.log that just show the accesses - no errors or warnings.

I can provide other details as needed.

Thanks …