Some indices are missing in the database! How to add them manually

After updating to nextcloud 14 I get the following error:

Some indices are missing in the database. Because adding indexes to large tables may take some time, they have not been added automatically. By executing “occ db: add-missing-indices”, missing indexes can be added manually while the instance is running. Once the indexes have been added, queries to these tables are usually faster.
Missing index “share_with_index” in the “oc_share” table.
Missing index “parent_index” in the “oc_share” table.
Missing index “fs_mtime” in the “oc_filecache” table.

Using a shared hosting I can not launch the occ command.

How can I add these values manually? thank you so much

I have the same problem. Did you fix it?

EDIT: I fixed it!
Open super user bash

sudo bash

Go to the NextCloud folder:

cd /var/www/nextcloud

Run the following command:

sudo -u www-data php occ db:add-missing-indices

And finally the prompt should show something like this:

Check indices of the share table.
Adding additional parent index to the share table, this can take some time…
Share table updated successfully.
Adding additional mtime index to the filecache table, this can take some time…
Filecache table updated successfully.

And thats all, the problem should being fixed

11 Likes

Castillo92, thank you for your fix, it helped me to fix a similar issue after I upgraded to nextcloud 15.0.2.0

1 Like

How does using the occ command help the original poster’s question about how to do this without access to the occ command?

Because it seems that I did not read that :blush:

Someone forgot to link one of the answers in the meantime.

THIS is the correct answer!! Thanks for helping out!!:heart_eyes:

1 Like

For the records:

Followed the instructions to address similar message with a NC 16.0.3 / NCP install. Solved the issues highlighted. As an aside my security reating increased from A to A+ with https://scan.nextcloud.com and https://www.ssllabs.com. Thank you. :grinning:

2 Likes

Appreciate it really worked. Apologies out of the topic we are hosting it under shared server. Any way to solve the following ?

  • Your web server is not properly set up to resolve “/.well-known/caldav”. Further information can be found in the documentation.
  • Your web server is not properly set up to resolve “/.well-known/carddav”. Further information can be found in the documentation.

We try look around and applied to so many solution neither of them worked.