Missing index "owner_index" in table "oc_share" Solved

I had the following error after I upgrade to Nextcloud 15.0.2 in Ubuntu 18.04.1 LTS

Missing index “owner_index” in table “oc_share”.
Missing index “initiator_index” in table “oc_share”.

After a few time hours of search I was able to fix the issue thanks to Nextcloud user “Castillo92” from the following link:

What I did was to add the last command line, so here is the solution

Open terminal as root

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 then run the last following command:

sudo -u www-data php ./occ db:convert-filecache-bigint

Just in case restart apache2 or reboot your linux box:

sudo service apache2 restart

Issue should be fixed.

1 Like

Thanks a lot! Fixed the same issues after manual upgrading from 14.0.3 to 15.0.2.

Thanks, Fixed same issues after upgrading from 14.0.4 to 15.0.2

I have followed the instructions also but I get " Failed to connect to the database: An exception occured in driver"
I am running nextcloud in Unraid.
Any ideas please?