NextCloudPi Docker on Pi4: Unable to Activate

Background: I have had NCP running from Docker before – I thought it was super easy, but one of the image updates around a year ago bricked it, so I’m getting back around to it with a new Pi, all the old files moved out of the way…

Target system is a Pi4b 2GB, running Raspberry Pi OS (Buster 10.6) using Docker-CE 19.03.13 (installed using Docker’s install script from their site). Persistent storage is via a USB hard drive mounted on /mnt/usbdrive .

I do:

sudo mkdir /mnt/usbdrive/database
sudo chown www-data:www-data /mnt/usbdrive/database/
docker create -p 4443:4443 -p 443:443 -p 80:80 -v /mnt/usbdrive:/data --name nextcloudpi --restart unless-stopped ownyourbits/nextcloudpi-armhf:v1.24.0  ${IP}
docker start nextcloudpi

Then go to the webpage, copy the passwords, hit activate, and it just spins there. I notice that the container never starts listening on 4443. If I login to the container:

# tail /var/log/ncp.log


[ nc-admin ]
Nextcloud is not installed - only a limited number of commands are available


  There are no commands defined in the "user" namespace.

Now if I look at that external drive (inside the container here):

# ls -al /data
total 20
drwxr-xr-x 1 www-data www-data   62 Oct  8 21:41 .
drwxr-xr-x 1 root     root     4096 Oct  8 21:40 ..
drwxr-xr-x 1 root     root      534 Apr  6  2020 bin
drwxr-xr-x 1 www-data www-data    0 Oct  8 21:41 database
drwxr-xr-x 1 root     root      160 Oct  8 21:40 etc
drwxr-xr-x 1 www-data www-data   34 Oct  8 21:38 failed
drwxr-xr-x 1 root     www-data 1292 Apr  6  2020 ncp
drwxr-xr-x 1 www-data www-data  110 Oct  8 21:39 old
drwxr-xr-x 1 www-data www-data   52 Aug 24 03:11 sdimg

Note that failed, old, and sdimg are other directories I already had on the drive. It looks like the container created and populated bin, etc, and ncp as expected (but not database for some reason, which I had to do manually, above).

I have previously tried setting all the directories in /data to www-data:www-data ownership, and most recently (as you can see here) have tried the 1.24.0 version of the image due to some known issues with 1.29 that looked similar (but not exact) to what I am seeing in the ncp.log.

  1. Am I missing something that I need to do to get this working?
  2. Should bugs for this go to the docker repo, nextcloudpi repo, or somewhere else?

Thank you!
Terry

I suspect ncdata folder can not be created there.

Try:

sudo mkdir /mnt/usbdrive/ncdata
sudo chown www-data:www-data /mnt/usbdrive/ncdata
sudo docker rm nextcloudpi

docker run -p 4443:4443 -p 443:443 -p 80:80 -v /mnt/usbdrive/ncdata:/data --name nextcloudpi --restart unless-stopped ownyourbits/nextcloudpi-armhf:v1.24.0  ${IP}

and run,

docker logs -f nextcloudpi
wait for init done, (ctrl+c to exit log)

Also there is a detailed post on getting started with ncp docker

Can also check NCP’s documentation https://docs.nextcloudpi.com/en/how-to-get-started-with-ncp-docker/

Once your container is up and running you can copy old data, import database or run nc-scan, after copying files from previous ncdata.

Hu-zah! Looks like that worked – thank you!! At the very least, it got me further (I seem stuck doing initial NC login now, but I expect that’s a separate issue – all the NCP admin stuff worked fine).

The key issue does look like I was using the root of the partition as the data directory. That’s what I was doing before, and I suspect that was the issue when it stopped working for me roughly a year ago. It is not clear from the guides, and seems like it should be a distinct error condition that this is not an acceptable configuration.

One issue I ran into from your instructions is: when I ran the docker run command, it looks like it automatically went into log follow mode and it would not let me ctrl-c – instead I had to kill the ssh connection and reconnect. Not sure if that’s indicative of any other issues (like maybe what I’m facing now).

Thanks again!
Terry