I have setup a running nextcloud using Docker / Compose, following the basic instructions on Docker Hub. Internal storage is working fine.
However, I have also configured an external storage of type Local (under admin settings as a global storage - users are not allowed to add their own external storage).
{
"mount_id": 1,
"mount_point": "\/my-data",
"storage": "\\OC\\Files\\Storage\\Local",
"authentication_type": "null::null",
"configuration": {
"datadir": "\/mnt\/my-data"
},
"options": {
"enable_sharing": true,
"encoding_compatibility": false,
"encrypt": true,
"filesystem_check_changes": 1,
"previews": true,
"readonly": false
},
"applicable_users": [],
"applicable_groups": []
}
More details
Server-side encryption is disabled, so encrypt: true
has no effect.
The external storage is pre-populated with data from outside of nextcloud.
Obviously, I have also modified the docker-compose.yml
file to mount my real folder into the container.
version: '3'
services:
…
app:
…
volumes:
- nextcloud:/var/www/html
- /pools/data/my-data:/mnt/my-data
Every user can see and access the folder my-data
in their Files in the Web UI. This works.
However, I have four issues:
- When I open
my-data
or any sub-folder in the Web UI, often the folder is shown as empty. When I reload the page, or simply click again on the folder name in the bread crumb, the content appears. This is pretty consistent: on first access the folder is empty, and from there the content appears. - After 5 minutes (specifially, after the next cron run), the folders are first showing as empty as well.
- When the folder contents loads, file previews are generated. When I open the folder again, the previews load much faster (i.e. the cached previews are used). However, after the next cron run, the file previews are re-generated.
- I have created an external share link for some sub-folder inside the local storage. This share link is also gone after the next cron run. This makes sharing on external storage useless.
Except for the first point, all issues are related to the cron job.
I have tried to run php occ files:scan --all
to see if it makes any difference (should it?), but it does not scan my-data
. Only the files in the user’s homes internal storage. I have checked with files:scan -v --all
, it only lists the internal files.
/var/www/html $ php occ files:scan -v --all | grep my-data | wc -l
0
The number of files in the files:scan
output certainly does not include the files from my external storage.
I have also tried files:scan --path /mnt/my-data
or files:scan --path /admin/files/my-data
, but it just errors out.
output
/var/www/html $ php occ files:scan --path /mnt/my-data
Unknown user 1 mnt
+---------+-------+--------+--------------+
| Folders | Files | Errors | Elapsed time |
+---------+-------+--------+--------------+
| 0 | 0 | 0 | 00:00:00 |
+---------+-------+--------+--------------+
/var/www/html $ php occ files:scan --path /admin/files/my-data
Starting scan for user 1 out of 1 (admin)
Path not found: /admin/files/my-data
+---------+-------+--------+--------------+
| Folders | Files | Errors | Elapsed time |
+---------+-------+--------+--------------+
| 0 | 0 | 1 | 00:00:00 |
+---------+-------+--------+--------------+
Do you have any advice?
Since so much is going wrong, I have the feeling that I am missing some fundamental understanding.
Versions
Nextcloud version: 27.0.2
Operating system and version: Alpine Linux v3.18
Apache or nginx version: 1.25.1
PHP version: 8.2.8