[NextCloudPi] Troubles to update Nextcloud

I had a perfectly working Nextcloudpi installation on my Pi 3, but I realized a few weeks ago that Nextcloud wasn’t working anymore. As I didn’t notice immediately, I could’nt say what was the cause of the issue.

When I try to get to the Nextcloud web panel I get:

This version of Nextcloud is not compatible with PHP 7.2.
You are currently running 7.2.12-1+0~20181112102304.11+stretch~1.gbp55f215.

I ran ncp-update without problem. I then tried to update Nextcloud from ncp-config and nc-update-nextcloud but I only get:

Launching nc-update-nextcloud
Malformed version

Does anyone have an idea of a possible fix?

You need to enable nc-autoupdate and nc-autoupdate-nc, if you do not run manual updates weekly.

First try running nc-update again from ncp-config, then run nc-update-nextcloud again.

nc-autoupdate and nc-autoupdate-nc are already enabled.
Running nc-update-nextcloud gives me the malformed version error message.

what NC version are you trying to update to? you can set to 0 to go to the latest

I tried both 0 and 14.0.3 and got the same result.

What is output of nc-info?

Here is the result of nc-info:

Launching nc-info
Gathering information...
NextCloudPi version  v0.66.4
NextCloudPi image    NextCloudPi_12-04-17
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          sda
datadir              /media/gus/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      733G/932G
rootfs usage         3.4G/30G
swapfile             /var/swap
dbdir                /media/gus/ncdatabase
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      down
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   192.168.1.49
gateway              192.168.1.254
interface            eth0
certificates         none
NAT loopback         no
uptime               1day


You should enable dnsmasq to use your domain inside home

You should run Lets Encrypt for trusted encrypted access

Databaseserver isn’t running. Try:

sudo systemctl start mysql.service

and

sudo systemctl status mysql.service

Is your ncdata also on /media/gus?

Please share output of

df -h

To check if drive is mounted.

Here is the output of sudo systemctl status mysql.service:

â—Ź mariadb.service - MariaDB 10.1.37 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-11-23 07:12:53 UTC; 2min 8s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 26172 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 26169 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
  Process: 25979 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 25974 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 25971 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 26140 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─26140 /usr/sbin/mysqld

Nov 23 07:12:39 nextcloudpi systemd[1]: Starting MariaDB 10.1.37 database server...
Nov 23 07:12:41 nextcloudpi mysqld[26140]: 2018-11-23  7:12:41 1989238176 [Note] /usr/sbin/mysqld (mysqld 10.1.37-MariaDB-0+deb9u1) starting as process 26140 ...
Nov 23 07:12:53 nextcloudpi systemd[1]: Started MariaDB 10.1.37 database server.

And the output of df -h:

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  3.4G   25G  12% /
devtmpfs        370M     0  370M   0% /dev
tmpfs           375M     0  375M   0% /dev/shm
tmpfs           375M   15M  360M   4% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           375M     0  375M   0% /sys/fs/cgroup
/dev/mmcblk0p1   41M   23M   19M  54% /boot
/dev/sda1       932G  733G  198G  79% /media/gus
tmpfs            75M     0   75M   0% /run/user/1000

The drive is properly mounted as I use Kodi to watch movies that are on it.

I tried nc-update-nextcloud after restarting the DB server and I got the same error message.

Here’s the output of nc-info:

Launching nc-info
Gathering information...
NextCloudPi version  v0.66.4
NextCloudPi image    NextCloudPi_12-04-17
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          sda
datadir              /media/gus/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      733G/932G
rootfs usage         3.4G/30G
swapfile             /var/swap
dbdir                /media/gus/ncdatabase
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   192.168.1.49
gateway              192.168.1.254
interface            eth0
certificates         none
NAT loopback         no
uptime               1day


You should enable dnsmasq to use your domain inside home

You should run Lets Encrypt for trusted encrypted access

nc-data is on /media/gus and nc files are in it.

That’s strange, the line with Nextcloud version is missing from nc-info.
Maybe someone can tell us how that is possible?

It’s probably got to do with your version being too old and left without updating for too long.
Use the backup facilities to backup your db, config and data files. Then use a fresh install using the latest image and use the restore tools from ncp-config.

I also thought about doing fresh install but I would rather avoid this option if possible as I have other things installed on my Rpi that I would prefer not to have to reinstall.

Unfortunately, this might be the only option…

what is the output of ncc status?

This version of Nextcloud is not compatible with PHP 7.2.<br/>You are currently running 7.2.12-1+0~20181112102304.11+stretch~1.gbp55f215