Getting stuck at "Initializing NextCloudPi for the first time Please wait" when I change data-root in docker [Solved]

I installed NCP using docker and changed my default storage location to /mnt/usbhdd/docker by adding “data-root” to the /etc/docker/daemon.json and I can confirm that NCP works fine and will activate in the default location but after it’s changed to my external drive it appears like it installs fine but it just sits there when I click activate.

Terminal log

Initializing empty volume…,
Making /usr/local/etc/ncp-config.d persistent …,
Making /etc/services-enabled.d persistent …,
Making /etc/letsencrypt persistent …,
Making /etc/shadow persistent …,
Making /etc/cron.d persistent …,
Making /etc/cron.daily persistent …,
Making /etc/cron.hourly persistent …,
Making /etc/cron.weekly persistent …,
Making /usr/local/bin persistent …,
Making /etc/apache2 persistent …,
Starting PHP-fpm,
Starting Apache,
Starting mariaDB,
2020-03-14 22:47:09 0 [Note] mysqld (mysqld 10.3.18-MariaDB-0+deb10u1) starting as process 224 …,
Starting Redis,
Starting Cron,
Starting Postfix,
Uninitialized instance, running nc-init…,
Running nc-init,
Setting up a clean Nextcloud instance… wait until message ‘NC init done’,
Setting up database…,
Setting up Nextcloud…,
Nextcloud was successfully installed,
Set mode for background jobs to ‘cron’,
System config value tempdirectory set to string /var/www/nextcloud/data/tmp,
System config value mysql.utf8mb4 set to boolean true,
System config value trusted_domains => 11 set to string 69.73.57.172,
System config value trusted_domains => 1 set to string 172.17.0.3,
System config value trusted_domains => 5 set to string nextcloudpi.local,
System config value trusted_domains => 7 set to string nextcloudpi,
System config value trusted_domains => 8 set to string nextcloudpi.lan,
System config value mail_smtpmode set to string sendmail,
System config value mail_smtpauthtype set to string LOGIN,
System config value mail_from_address set to string admin,
System config value mail_domain set to string ownyourbits.com,
nextcloudpi enabled,
calendar installed,
calendar enabled,
contacts installed,
contacts enabled,
notes installed,
notes enabled,
tasks installed,
tasks enabled,
news installed,
news enabled,
calendar enabled,
contacts enabled,
notes enabled,
tasks enabled,
news enabled,
previewgenerator enabled,
Config value squareSizes for app previewgenerator set to 32 256,
Config value widthSizes for app previewgenerator set to 256 384,
Config value heightSizes for app previewgenerator set to 256,
System config value preview_max_x set to string 2048,
System config value preview_max_y set to string 2048,
System config value jpeg_quality set to string 60,
Config value jpeg_quality for app preview set to 60,
System config value overwriteprotocol set to string https,
Following columns will be updated:,
,

  • mounts.storage_id,
  • mounts.root_id,
  • mounts.mount_id,
    ,
    This can take up to hours, depending on the number of files in your instance!,
    NC init done,
    System config value trusted_domains => 1 set to string 172.17.0.3,
    Provisioning,
    Provisioning Redis password,
    Updating NextCloud config with Redis password,
    Provisioning MariaDB password,
    Updating NextCloud config with MariaDB password,
    Running nc-limits,
    Using 1499707392B for PHP,
    Using 4 PHP threads,
    Using 799843942 memory for the database,
    Stopping MariaDB database server: mysqld.,
    Starting MariaDB database server: mysqld …,
    Stopping redis-server: redis-server.,
    Starting redis-server: redis-server.,

As you can see it gets to init done ok and it appears as if it’s working, I’m guessing it’s some sort of permission/ownership issue? I tried chmod 775 and chown www-data:www-data on the docker folder but that didn’t change anything.

UUID=23935535-8bd8-4216-88b3-0d9dcdc3b0a3 /mnt/usbhdd ext4 auto,suid,dev,rw,users,exec,async,nofail,x-systemd.device-timeout=30 0 0

Also, here’s my fstab, it looks good to me but I must be doing something wrong and I can’t figure out what…

Edit: I solved my issue by loading up Linux Mint and reformatting the drive using gparted then making a new docker folder all through the GUI so there’s pretty much no way I could screw it up and now it works as I intended it to.

I don’t know anything about NCP, I would guess the program won’t work unless its install in its default location. I would go ahead and remove NCP and reinstall it in its default location.

Well I don’t know a lot about docker but from what I understand the storage location shouldn’t matter because to the application running in the container sort of has it’s own virtual system like a VM, so the only thing I can think of I which haven’t tried is playing with docker’s permissions/ownership or trying a different way of setting the data directory like symlinks.

Also, I figure it’s worth noting that I successfully ran this setup on an orange pi and have moved over to the x86 based atomic pi, so aside from the arm processor and a few minor OS differences it’s otherwise the same setup.

Well, if your thoughts are true on how Docker works, I would try and set up symlinks, It could be a permissions problem. Are you sure you have set up permissions correctly? Also, I would add the helpdesk tag to your title.

No, I’m not entirely sure that I’ve set the permissions correctly, I’m still a bit of a linux noob and only vaguely know what I’m doing with things like setting permissions, do I need to do chmod -R or something to apply it to everything?

Default location ls -la

vgamesx1@AtomicPi:/var/lib$ ls -la
drwx–x--x 14 root root 4096 Mar 15 12:48 docker
drwxr-xr-x 2 root root 4096 Mar 13 09:11 docker-engine

vgamesx1@AtomicPi:/var/lib/docker$ sudo ls -la
drwx–x--x 14 root root 4096 Mar 15 12:48 .
drwxr-xr-x 40 root root 4096 Mar 13 09:11 …
drwx------ 2 root root 4096 Mar 13 09:11 builder
drwx–x--x 4 root root 4096 Mar 13 09:11 buildkit
drwx------ 4 root root 4096 Mar 15 12:56 containers
drwx------ 3 root root 4096 Mar 13 09:11 image
drwxr-x— 3 root root 4096 Mar 13 09:11 network
drwx------ 42 root root 4096 Mar 15 12:56 overlay2
drwx------ 4 root root 4096 Mar 13 09:11 plugins
drwx------ 2 root root 4096 Mar 15 12:48 runtimes
drwx------ 2 root root 4096 Mar 13 09:11 swarm
drwx------ 2 root root 4096 Mar 15 12:49 tmp
drwx------ 2 root root 4096 Mar 13 09:11 trust
drwx------ 3 root root 4096 Mar 15 12:56 volumes

New location ls -la

vgamesx1@AtomicPi:/mnt/usbhdd$ ls -la
drwxrwxr-x 14 root root 4096 Mar 17 09:18 dockerx86

vgamesx1@AtomicPi:/var/lib/docker$ cd /mnt/usbhdd/dockerx86
vgamesx1@AtomicPi:/mnt/usbhdd/dockerx86$ sudo ls -la
drwxrwxr-x 14 root root 4096 Mar 17 09:18 .
drwxr-xr-x 6 root root 4096 Mar 14 15:44 …
drwx------ 2 root root 4096 Mar 14 15:46 builder
drwx–x--x 4 root root 4096 Mar 14 15:46 buildkit
drwxr-x— 5 root root 4096 Mar 17 09:41 containers
drwx------ 3 root root 4096 Mar 14 15:46 image
drwxr-x— 3 root root 4096 Mar 14 15:46 network
drwx------ 45 root root 4096 Mar 17 09:41 overlay2
drwx------ 4 root root 4096 Mar 14 15:46 plugins
drwx------ 2 root root 4096 Mar 17 09:18 runtimes
drwx------ 2 root root 4096 Mar 14 15:46 swarm
drwx------ 2 root root 4096 Mar 17 09:18 tmp
drwx------ 2 root root 4096 Mar 14 15:46 trust
drwxr-x— 4 root root 4096 Mar 17 09:41 volumes