Nextcloud Backup ncp-backup Fails due to Error reading data directory

Hi everyone,

I’m trying to backup my nextcloud using ncp-config, but I keep running into this error.

Running nc-backup
/usr/local/etc/ncp-templates/ncp-metrics.cfg.sh: line 57: return: can only `return’ from a function or sourced script
Error reading data directory. Is NextCloud running and configured?
Done. Press any key…

It looks like a permission error, but the output of ls -lh on my media drive is

drwxrwxrw- 1 www-data www-data 344 Jul 25 11:58 ncdata
drwxrwxr-x 1 www-data www-data 46 Jul 25 11:41 ncp-backups
drwxr-xr-x 1 www-data www-data 1.8K Jan 18 2022 ncp-snapshots
drwx------ 1 www-data www-data 0 Jun 30 00:12 tmp

and within the ncdata folder:

drwxrwxr-x 1 www-data www-data 146 Jun 8 2021 appdata_oclmrve5j8pf
drwxr-xr-x 1 www-data www-data 26 Dec 16 2021 files_external
-rw-r–r-- 1 www-data www-data 0 Dec 16 2021 index.html
drwxr-xr-x 1 www-data www-data 394 Dec 16 2021 ncp-update-backups
-rw-r----- 1 www-data www-data 3.2G Jul 25 12:10 nextcloud.log
drwxr-xr-x 1 www-data www-data 20 Aug 23 2021 USER2
drwxr-xr-x 1 www-data www-data 90 Jun 2 2021 USER1
drwxr-xr-x 1 www-data www-data 8 Jun 30 22:29 tmp
drwxr-xr-x 1 www-data www-data 42 May 18 15:30 updater-oclmrve5j8pf
-rw-r–r-- 1 www-data www-data 9.4K Jul 25 11:20 updater.log

I’m running NextCloudPi version v1.48.2 with Nextcloud 23.0.6

Any help on how to get my backups running would be highly appreciated!

can you please share the output of

sudo ncp-report

This is the output of sudo ncp-report https://pastebin.com/U0Y4Y7g7

Root-cause seems to be
This version of Nextcloud is not compatible with > PHP 8.0.<br/>You are currently running 8.1.7.

So you somehow managed to upgrade PHP to an unsupported version.
Please read Staying up to date. This explains, why you shouldn’t do this :frowning:

I hope, that you’ve created a backup before - have you?

If not (i’m afraid that this is the case?) i don’t know if/how you can rescue your Nextcloud. In theory it should be possible to downgrade PHP again - just a thought…
Sorry to have no better news.

It is possible to rescue it by downgrading PHP, purging the new and restoring the old configs, it is a relative big undertaking though if you don’t know exactly what was installed and where

If you are able to access the device itself either through ssh or mouse, keyboard and monitor it should be possible to extract your data as well then perform a new installation and import the data again (<- again, this is also a fairly big undertaking and can take a couple hours to a couple days or even longer depending on your skills, the size and amount of data etc)