Server: occ db:add-missing-indices - Exact steps to resolve?

Created on 11 Sep 2018  路  5Comments  路  Source: nextcloud/server

Hi all,

I've just updated by NC 13 server to NC 14 using the built in updater.

'Security & Set Up Warnings' is reporting: _Missing index "fs_mtime" in table "oc_filecache"_

It is telling me to run 'occ db:add-missing-indices' and according to the the NC 13 documentation the specific command is: sudo -u www-data php occ db:add-missing-indices
https://docs.nextcloud.com/server/13/admin_manual/configuration_server/occ_command.html#database-add-indices-label

When I run this command via CLI as ncadmin I get the following response: _Could not open input file: occ_

Any ideas? Am I running this command from the wrong place? Can someone detail the exact steps / commands required to resolve this _Missing index "fs_mtime" in table "oc_filecache"_ issue?

I am a Linux beginner so apologies if the answer is obvious.

Many thanks.

bug

Most helpful comment

Did you try running this command inside your nextcloud main install folder? (Where there's the files index.php, remote.php, the occ folder, ...) It worked there for me

All 5 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/10926 (Possible DB indexes), https://github.com/nextcloud/server/issues/4625 (Missed sql index), https://github.com/nextcloud/server/issues/10656 (Configuration check - Minor typo: occ db:add-missing-indices), https://github.com/nextcloud/server/pull/10299 (Add filecache index on mtime), and https://github.com/nextcloud/server/issues/10158 (occ: user:list missing "numeric" username).

Did you try running this command inside your nextcloud main install folder? (Where there's the files index.php, remote.php, the occ folder, ...) It worked there for me

@JonasT Oh dear. No I didn't. I was running it from the wrong location. :/

Apologies for that. I have run the command and it has worked perfectly.

Thanks for your help.

Is it also possible to run the command from the web interface or execute a database query? Because if you do not have access to a CLI you can't run the command.

Was this page helpful?
0 / 5 - 0 ratings