NextcloudPi Permissions

Hi, so I’m using an arm device xu4 and docker and I’d like to use the nextcloudpi docker image but when it is booting it gets stuck on permissions relating to writing the database.

The mounted folder has owner root read/write/execute and others to read and execute. And I’ve set the following as the faq state.

What user/permissions should I have to the external USB drive mount point, the ncdata and ncdatabase directory?

Directory User Group Permissions Permission mask
Mount Point root root drwxr-x–x 751
ncdata www-data www-data drwxr-x— 750
ncdatabase mysql mysql drwxr-xr-x 755

The docker command is-
docker run -d --restart=always -p 4443:4443 -p 443:443 -p 80:80 -v /pooled/docker/application_data/nextcloudplus:/data --name nextcloudplus ownyourbits/nextcloudpi-armhf $DOMAIN

And the log errors from my container:
Starting Apache
Starting mariaDB
2018-12-13 10:42:50 3069956096 [Note] mysqld (mysqld 10.1.37-MariaDB-0+deb9u1) starting as process 90 …
2018-12-13 10:42:50 3069956096 [ERROR] mysqld: Can’t create/write to file ‘/data/database/aria_log_control’ (Errcode: 13 “Permission denied”)
2018-12-13 10:42:50 3069956096 [ERROR] mysqld: Got error ‘Can’t create file’ when trying to use aria control file ‘/data/database/aria_log_control’
2018-12-13 10:42:50 3069956096 [ERROR] Plugin ‘Aria’ init function returned error.
2018-12-13 10:42:50 3069956096 [ERROR] Plugin ‘Aria’ registration as a STORAGE ENGINE failed.
2018-12-13 10:42:50 3069956096 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

2018-12-13 10:42:50 3069956096 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-12-13 10:42:50 3069956096 [Note] InnoDB: The InnoDB memory heap is disabled
2018-12-13 10:42:50 3069956096 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-12-13 10:42:50 3069956096 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-12-13 10:42:50 3069956096 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-12-13 10:42:50 3069956096 [Note] InnoDB: Using Linux native AIO
2018-12-13 10:42:50 3069956096 [Note] InnoDB: Using generic crc32 instructions
2018-12-13 10:42:50 3069956096 [ERROR] mysqld: Can’t create/write to file ‘/tmp/ib0MgKXm’ (Errcode: 13 “Permission denied”)
2018-12-13 10:42:50 b6fbd000 InnoDB: Error: unable to create temporary file; errno: 13
2018-12-13 10:42:50 3069956096 [ERROR] Plugin ‘InnoDB’ init function returned error.
2018-12-13 10:42:50 3069956096 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2018-12-13 10:42:50 3069956096 [Note] Plugin ‘FEEDBACK’ is disabled.
2018-12-13 10:42:50 3069956096 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2018-12-13 10:42:50 3069956096 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-12-13 10:42:50 3069956096 [ERROR] Aborting

So where do I set the proper permissions to resolve this?

Update. Inside the container the user mysql is doing this work on this volume.

mysql:x:101:102:MySQL Server,:/nonexistent:/bin/false

but on my host it maps to:
systemd-network:x:101:102:systemd Network Management,:/run/systemd/netif:/usr/sbin/nologin

So the question is what do people normally do with this type of container internal work mapping when attaching volumes? And something I did the change permissions on the folder caused these issues even though I changed the volume permissions to be more laxed.

total 110632
drwxrwxrwx 5 systemd-network systemd-network 4096 Dec 13 12:45 .
drwxr-xr-x 7 root root 4096 Dec 13 12:42 …
-rwxrwxrwx 1 systemd-network systemd-network 16384 Nov 29 18:24 aria_log.00000001
-rwxrwxrwx 1 systemd-network systemd-network 52 Nov 29 18:24 aria_log_control
-rwxrwxrwx 1 root root 0 Nov 29 17:58 debian-10.1.flag
-rwxrwxrwx 1 systemd-network systemd-network 12582912 Nov 29 18:24 ibdata1
-rwxrwxrwx 1 systemd-network systemd-network 50331648 Nov 29 18:24 ib_logfile0
-rwxrwxrwx 1 systemd-network systemd-network 50331648 Nov 29 18:24 ib_logfile1
-rwxrwxrwx 1 systemd-network systemd-network 0 Nov 29 17:59 multi-master.info
drwxrwxrwx 2 systemd-network root 4096 Nov 29 17:58 mysql
drwxrwxrwx 2 systemd-network systemd-network 4096 Nov 29 18:24 nextcloud
drwxrwxrwx 2 systemd-network systemd-network 4096 Nov 29 17:58 performance_schema

Thank you.

Hi, just know you’re warmly invited to join Nextcloudpi’s telegram chat at https://t.me/nextcloudpi

1 Like

Thank you! This was super awesome!

So what I did to resolve this was to update docker’s /etc/daemon.json to a new install location. Then apt install docker —reinstall then chmod —reference with the new install and destination of the problematic folder. This fixed the permissions issue and now I have two docker folders to play with!

@mep can you clarify this process a bit further please.