Missing Index Error after Installing Nextcloud 26.01 update

bb77, thank you for your help. You were correct. No need to use the chown command before executing the one line command for the purpose of changing the OCC file permission. However, I did get the error shown below after running your command for the first time:

An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

But after some Googling I learned the fix was to add an “apc.enable_cli = 1” line at the bottom end of the PHP.ini file located at /etc/php/8.1/cli folder location. After that I ran the command below:
sudo systemctl restart apache2

Below is the result I got after executing your command line a second time:

slipstream@myserver:/var/www/nextcloud$ sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
Check indices of the share table.
Check indices of the filecache table.
Adding additional parent index to the filecache table, this can take some time...
Filecache table updated successfully.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Check indices of the oc_jobs table.
Check indices of the oc_direct_edit table.
Check indices of the oc_preferences table.
Check indices of the oc_mounts table.

I then opened my Nextcloud v26.0.1 and I was happy to see my database missing indices error no longer appears as a problem. Again thanks for your help.

Lastly, do you have any idea why the change I had to make to my PHP.ini file was necessary in the first place? Why is the “apc.enable_cli = 1” line of code missing in the Php.ini file and has to be manually typed in as opposed to just removing a comment character? I am just curious to know so I could learn what is the logic behind leaving “apc.enable_cli = 1” out of the PHP.ini configuration entirely because without it Nextcloud seems to be handicapped.