Koozali.org: home of the SME Server

I broke my nextcloud :(

Offline Randall

  • *
  • 40
  • +0/-0
I broke my nextcloud :(
« on: April 04, 2024, 06:51:55 PM »
While testing my backup recovery (on a separate test server), I inadvertently initiated a restore to my working server, which I killed immediately by rebooting (seemed no other way to abort) and then running a reconfigure to recover. It generally seems otherwise OK, but NextCloud is now broken, and the the server ran another backup which restarted the sequence overwrote my previous full backup and incrementals, so I no longer have the pre-error backup :(

Accessing NextCloud now shows the following:
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.


The access generates the following in /var/log/php/nextcloud/error.log

[03-Apr-2024 08:52:55 America/Vancouver] PHP Warning:  file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/usr/share/nextcloud:/var/lib/nextcloud:/var/log/nextcloud.log:/var/lib/php/nextcloud:/home/e-smith/files/nextcloud:/dev/urandom:/proc/meminfo:/usr/share/GeoIP/GeoLite2-Country.mmdb:/proc/cpuinfo:) in /usr/share/nextcloud/lib/private/Template/Base.php on line 68

This appears to be due to some file in the backup; on my test server I ran a fresh install, installed nextcloud, and found that nextcloud was accessible. After restoring from backup, I get same results as above. A restore from an archived backup works, though.

Not sure where to start looking ...

Thanks

Offline Jean-Philippe Pialasse

  • *
  • 2,772
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: I broke my nextcloud :(
« Reply #1 on: April 04, 2024, 07:30:15 PM »
with command line what says
Code: [Select]
occ status

Offline Randall

  • *
  • 40
  • +0/-0
Re: I broke my nextcloud :(
« Reply #2 on: April 04, 2024, 07:42:31 PM »
Thanks for fast reply!

Looks like database got messed up:

An unhandled exception has been thrown:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_appconfig' doesn't exist in /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:78

Offline Jean-Philippe Pialasse

  • *
  • 2,772
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: I broke my nextcloud :(
« Reply #3 on: April 04, 2024, 08:50:13 PM »
check the content of the db via phpmyadmin
corrupted data because of the reboot is a high probability.

have you any backup of the db?
you can try a repair via phpmyadmin if a table is marked as defective

usually  the restore process does not erase existing db.

Offline Randall

  • *
  • 40
  • +0/-0
Re: I broke my nextcloud :(
« Reply #4 on: April 05, 2024, 03:41:12 AM »
Yes, my thinking exactly. The entire nextcloud database was empty (no tables). Fortunately, I had an archived backup from a couple months ago, and little has changed in NextCloud in the interim. Extracted nextcloud.dump and loaded it into mysql, and NextCloud magically sprang to life, and all seems OK. Whew ! I do notice that there doesn't seem to be a password on mysql, though - can get in via simple "mysql -u root nextcloud".

Anyway, issue seems to be resolved (as well as it can be). Thanks for the help.

Offline Jean-Philippe Pialasse

  • *
  • 2,772
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: I broke my nextcloud :(
« Reply #5 on: April 05, 2024, 04:04:12 AM »
there is a password. just your server is configured to provide it in place of you. 

you weee lucky the old db backup was same version as files.  nextcloud does not handle well async db/files.

that is also telling me that you should probably update your NC using the web interface. Nc 26 just dropped support few days ago. should be on 27 or 28. 

Offline Randall

  • *
  • 40
  • +0/-0
Re: I broke my nextcloud :(
« Reply #6 on: April 05, 2024, 05:46:39 PM »
Yes, I saw the update sitting there - glad I didn't apply it before all this. The point of the (botched) exercise was to test my backups on a test server before applying update. Too bad I ended up damaging both my server and my backup :( Very lucky indeed to have the old backup around.

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: I broke my nextcloud :(
« Reply #7 on: April 06, 2024, 02:22:55 AM »
However, one of those times to pat yourself on the back for having a backup to use, to many of us pull the trigger on things without a way back :-)
--
qui scribit bis legit

Offline Randall

  • *
  • 40
  • +0/-0
Re: I broke my nextcloud :(
« Reply #8 on: April 06, 2024, 02:47:14 AM »
Let's just say that this wisdom didn't just magically appear ;)