On http://localhost, I simply get:
Nextcloud Error
Your data directory is invalid
Ensure there is a file called “.ocdata” in the root of the data directory.
This is an import from another Nextcloud instance, where I’ve already restored the MySQL database, and tried to set up /media/hosted/nextcloud/data/ as the data directory; I’ve already ran # snap connect nextcloud:removable-media
My configuration is as follows:
[root@zebArchDesktop ~]# grep datadirectory /var/snap/nextcloud/current/nextcloud/config/config.php
'datadirectory' => '/media/hosted/nextcloud/data',
[root@zebArchDesktop ~]# ls -lah /media/hosted/nextcloud/data/.ocdata
-rwxrwxrwx 1 root root 0 Jun 18 20:12 /media/hosted/nextcloud/data/.ocdata
[root@zebArchDesktop ~]# nextcloud.mysql-client
mysql> USE nextcloud;
mysql> SELECT * FROM oc_storages WHERE id LIKE 'local%';
+--------------------------------------+------------+-----------+--------------+
| id | numeric_id | available | last_checked |
+--------------------------------------+------------+-----------+--------------+
| local::/media/hosted/nextcloud/data/ | 13 | 1 | NULL |
+--------------------------------------+------------+-----------+--------------+
1 row in set (0.00 sec)
The Nextcloud Snap really just can’t see my data, and I found something interesting:
[root@zebArchDesktop ~]# snap run --shell nextcloud.occ
[root@zebArchDesktop root]# ls -lah /media/hosted/nextcloud/data/
total 0
drwxrwx--- 3 root root 80 Jun 21 20:10 .
drwxr-xr-x 3 root root 60 Jun 21 19:26 ..
drwxr-xr-x 4 root root 80 Jun 21 19:26 appdata_ocpuaavroxaa
-rw-r--r-- 1 root root 0 Jun 21 19:26 nextcloud.log
If I touch /media/hosted/nextcloud/data/.ocdata
within the snap shell, the error goes away and my nextcloud goes live with no data files. So, it’s as if the nextcloud snap sees an parallel dimension of my /media/hosted/nextcloud/data/ folder. I have no idea how to fix this from here and get the snap to see my data folder correctly.