Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined array key "previews" at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php#160 #465

Open
srijansaxena11 opened this issue Apr 21, 2024 · 9 comments

Comments

@srijansaxena11
Copy link

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:
image

@st3iny
Copy link
Member

st3iny commented Apr 22, 2024

Which version of Nextcloud are you running?

@srijansaxena11
Copy link
Author

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.

@srijansaxena11
Copy link
Author

Which version of Nextcloud are you running?

What other details can I provide to debug/resolve it?

@joshtrichards
Copy link
Member

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.

@srijansaxena11
Copy link
Author

srijansaxena11 commented May 10, 2024

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": []
    }
]

@srijansaxena11
Copy link
Author

What can I do to fix it?

@srijansaxena11
Copy link
Author

Hello?

@joshtrichards
Copy link
Member

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 options sections 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.

@srijansaxena11
Copy link
Author

[
    {
        "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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants