Docker image: "This version of Nextcloud is not compatible with PHP 7.1"

I have an Owncloud 8 installation that I am migrating to Nextcloud, using the excellent nextcloud docker images (thank you!).

The migration is almost entirely scripted (with only the exception of a change in LDAP server details, which I do manually via the GUI) and was working fine every time I ran it including last night.

However, this morning the very same script is broken. At the very start of this whole process, I get this:

# docker exec -it nextcloud-9.0 bash -c "sudo -u www-data php occ upgrade"
This version of Nextcloud is not compatible with PHP 7.1.<br/>You are currently running 7.1.2.

Same if I try nextcloud-10.0 as well.

What has changed? :frowning:

I don’t think it’s relevant for this post, but my migration steps go something like:

  • import SQL database from v8
  • copy files from v8
  • Create docker v9 instance; upgrade to v9
  • Create docker v10 instance; upgrade to v10
  • Create docker v11 instance; upgrade to v11

After attempting to put my new v11 instance live yesterday, I found I was hitting an error (I think this one) so I commented out the “upgrade to v11” part of my script, thinking I would re-run it and just stay at v10 until I’d figured out a solution. But now, nothing works :frowning:

FWIW, my docker build script is as follows - sorry, I couldn’t upload as an attachment so am pasting it in below. (From memory, the only reason I am grabbing the Dockerfile directly is because I was testing the apache variant when it was first being released) :

#!/bin/sh

if [ "$1" == "" ]; then
        echo Usage: $0 version
        echo e.g. $0 10.0
        exit
fi
NEXTCLOUDVER=$1

if [ -f docker-entrypoint.sh ]; then rm docker-entrypoint.sh; fi
if [ -f Dockerfile ]; then rm Dockerfile; fi

wget https://github.com/nextcloud/docker/raw/master/${NEXTCLOUDVER}/apache/docker-entrypoint.sh https://github.com/nextcloud/docker/raw/master/${NEXTCLOUDVER}/apache/Dockerfile
chmod +x docker-entrypoint.sh

# Stop any running nextcloud instances (if any)
docker ps | grep nextcloud | tr -s ' ' | cut -f 2 -d ' ' | xargs -n 1 docker stop

# Remove the old instance before we rebuild it
docker rm nextcloud-${NEXTCLOUDVER}

docker build -t nextcloud-${NEXTCLOUDVER} . && \
docker run --name nextcloud-${NEXTCLOUDVER} \
        --restart=always \
        -d \
        -p 1.2.3.4:8001:80 \
       -v /data/nextcloud/data:/var/www/data \
       -v /data/nextcloud/apps:/var/www/html/apps \
       -v /data/nextcloud/config:/var/www/html/config \
        nextcloud-${NEXTCLOUDVER}

# needed for LDAPS to work
cat myca.crt | docker exec -i nextcloud-${NEXTCLOUDVER} bash -c 'cat > /usr/local/share/ca-certificates/myca.crt; update-ca-certificates

# Might as well script this in - I use it often enough when debugging!
docker exec -it nextcloud-${NEXTCLOUDVER} bash -c "apt-get update && apt-get install -y sudo vim"

Replying to my own question…

I think that perhaps something has been updated on the docker image I can see via github, but not on the one linked to from docker hub.

I had been pulling down https://raw.githubusercontent.com/nextcloud/docker/master/9.0/apache/Dockerfile and building my own docker image from that - which had worked perfectly up till this morning.

Now that the official docker image has the ‘apache’ and ‘fpm’ variant tags available (it didn’t, when I built my migration script) I have just tried switching to using the official docker image i.e. simply ‘docker run nextcloud:9.0-apache’ and this seems to be working.

I note that the official docker image uses this Dockerfile for 9.0-apache - which uses PHP 5.6 and not PHP 7.1…
https://github.com/nextcloud/docker/blob/e0c8ce80b26d4755a9a2bfeb3c42c40c89d8c4f8/9.0/apache/Dockerfile

So - I’m not sure what changed this morning or why (since the files on github I was originally using don’t appear to have been modified in at least 16 days!) but certainly my migration is now running again. I’m going to stick with PHP 5.6 via these docker images for the moment; I will try and reproduce the problem I had earlier, and flag it as an issue on github.

Will be tracked here, for anyone interested:

2 Likes