22 to 23 and again table issues, missing index that need linux actions

With the update from 22 to 23 there seems again a database issue.
The OCC addon does not work any more. And why should I go to a Linux login to correct this?

Missing index ā€œfs_id_storage_sizeā€ in table ā€œoc_filecacheā€.
Missing index ā€œfs_storage_path_prefixā€ in table ā€œoc_filecacheā€

Please do these actions in the update process ā€¦

If you read the message completely, it wonā€™t be done within the update process because for large installations this could run into timeouts and leave you with broken installations.

1 Like

Yes, Iā€™ve read that.
But one could add this as an option in the process. Or update the good old OCC addon. That worked fine for most maintanance on all NC instals we have. (most < 40GB).

This wonā€™t happenā€¦ See https://git.adphi.net/adphi/occweb#-deprecated-

What is the fix for the reported problem? I have it too.
Thanks.

You have go in Linux with SSH and adequate rights. (I my case ROOT does not work. It should be the owner of the account.

Then you go to the Nextcloud folder and then:

php occ db:add-missing-indices

That should be enough. It can be done on a running NC installation. But if you want, you can use these:
php occ maintenance:mode --on
php occ maintenance:mode --off

image

It took 3 seconds to exectuteā€¦

1 Like

As you say, root doesnā€™t work. Says that the owner of the file is ā€œ33ā€ which I believe is ā€œwww-dataā€.
I got that info by typing ā€˜getent passwd ā€œ33ā€ā€™ - is that right?

If so, how do I log in as www-data. Though I presume that this:
runuser -l www-data -c ā€˜php occ db:add-missing-indicesā€™

Should be enough?

Cheers for any pointers.

If you have sudo installed the following should work also (@Hendrik / @Walsh):
sudo -u www-data php /path/to/nextcloud/occ db:add-missing-indices

2 Likes

Awesome - that worked. Thanks!