Undefined array key "previews" at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php#160
I am getting the above error message in my Nextcloud logs every 10 minutes.
[PHP] Error: Undefined array key "previews" at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php#160
The error is pointing to this line:
Which version of Nextcloud are you running?
Which version of Nextcloud are you running?
It's latest stable 28.0.4. I am happy to provide any other details if required and/or try anything to see if that resolves the issue.
Which version of Nextcloud are you running?
What other details can I provide to debug/resolve it?
It's related to your External Storage configuration. It seems like one of your mounts is lacking the preview field in its config (which is a little weird).
Please send the output of occ files_external:list --output=json_pretty.
It's related to your External Storage configuration. It seems like one of your mounts is lacking the preview field in its config (which is a little weird).
Please send the output of
occ files_external:list --output=json_pretty.
Hi. Please find it below:
[
{
"mount_id": 4,
"mount_point": "\/var\/lib\/media",
"storage": "\\OC\\Files\\Storage\\Local",
"authentication_type": "null::null",
"configuration": {
"datadir": "\/var\/lib\/media"
},
"options": {
"enable_sharing": false
},
"applicable_users": [],
"applicable_groups": []
},
{
"mount_id": 5,
"mount_point": "\/External_Storage",
"storage": "\\OC\\Files\\Storage\\Local",
"authentication_type": "null::null",
"configuration": {
"datadir": "\/var\/lib\/media"
},
"options": {
"enable_sharing": false
},
"applicable_users": [],
"applicable_groups": []
}
]
What can I do to fix it?
Hello?
This isn't an issue in the previewgenerator.
Somehow nearly all your options are missing from your mount. The config would normally look more like this:
{
"mount_id": 5,
"mount_point": "\/extLocalTmp",
"storage": "\\OC\\Files\\Storage\\Local",
"authentication_type": "null::null",
"configuration": {
"datadir": "\/tmp"
},
"options": {
"encrypt": true,
"previews": true,
"enable_sharing": false,
"filesystem_check_changes": 1,
"encoding_compatibility": false,
"readonly": false
},
"applicable_users": [],
"applicable_groups": []
}
]
How did you originally setup/add your External Storage in your Nextcloud Server? And what's the history of this installation? (i.e. has it been around awhile?)
If there is a bug, it's in server/files_external, since that configuration isn't valid per se. Assuming you're using those mounts, you can probably workaround it by:
- exporting the config manually
- editing your
optionssections to mirror my example above - importing the fixed configuration
See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#files-external-label for the occ files_external:export & files_external:import commands.
P.S. You have two entries for the same local storage folder (/var/lib/media). If I was to guess, mount 4 isn't actually being used.
[
{
"mount_id": 7,
"mount_point": "\/External_Storage",
"storage": "\\OC\\Files\\Storage\\Local",
"authentication_type": "null::null",
"configuration": {
"datadir": "\/var\/lib\/media"
},
"options": {
"enable_sharing": false,
"previews": false
},
"applicable_users": [],
"applicable_groups": []
}
]
Is this okay now? I am still getting the same error with this configuration too. Do I need to restart something?