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.