Error in Error message: Database missing indices

NC 32:

Not sure if this goes here, but there’s an error in the error message text for the “Database missing indices”. I can’t tell if it’s a global issue or confined to the danish translation:

Database mangler indekser

Registrerede nogle manglende valgfrie indekser. Lejlighedsvis tilføjes nye indekser (af Nextcloud eller installerede applikationer) for at forbedre databasens ydeevne. Tilføjelse af indeks kan nogle gange tage et stykke tid og midlertidigt degradere ydeevnen, derfor gøres dette ikke automatisk under opgraderinger. Når indekserne er tilføjet, bør forespørgsler til disse tabeller være hurtigere. Brug kommandoen occ db:add-missing-indexes for at tilføje dem. Manglende indekser: “properties_name_path_user” i tabel “properties”, “calobjects_by_uid_index” i tabel “calendarobjects”

Being in a hurry and a bit rusty on the matter, I blindly entered:

sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indexes

Unsurprisingly, this returns:

Command “db:add-missing-indexes” is not defined.

Did you mean one of these?
db:add-missing-columns
db:add-missing-indices
db:add-missing-primary-keys
db:convert-filecache-bigint
db:convert-mysql-charset
db:convert-type
db:schema:expected
db:schema:export

After a bit of confusion I decided to open a support ticket, using the autogenerated system report for details.

However, in the system report, that same error message suddenly calls for a different command:

  • Database missing indices: Detected some missing optional indices. Occasionally new indices are added (by Nextcloud or installed applications) to improve database performance. Adding indices can sometimes take awhile and temporarily hurt performance so this is not done automatically during upgrades. Once the indices are added, queries to those tables should be faster. Use the command occ db:add-missing-indices to add them.
    Missing indices:
    “properties_name_path_user” in table “properties”,
    “calobjects_by_uid_index” in table “calendarobjects”

Which of course solved the issue:

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

Adding additional properties_name_path_user index to the oc_properties table, this can take some time…
oc_properties table updated successfully.
Adding additional calobjects_by_uid_index index to the oc_calendarobjects table, this can take some time…
oc_calendarobjects table updated successfully.

With db:add-missing-indices instead of db:add-missing-indixes you are right. But here’s a tip to make your work easier in the future, at least if your NC is running on a Linux OS and you have root access.

Use the History of the OS. Most likely you will need to use occ-Commands quite often after updateing NC.

root@DebianServerVM2:~# history | egrep occ
 1227  sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
 1811  sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
 1835  sudo -u www-data php /var/www/nextcloud/occ maintenance:repair --include-expensive
 1836  sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
root@DebianServerVM2:~# 

With that knowledge you dont need to retype after every update needed commands

Hi, and thanks for the tip.

I keep a very tight diary of everything I do to my server, including commands and their effects.

I was tracking down a file locking error and didn’t bother to look my own instructions up.

Thanks again

Looks like it’s a typo in the translations. I only see it in the Danish one:

It’ll need to be fixed in Transifex.

Thanks! Do you know how to forward this to the right person?

Fixed it two days ago already.

2 Likes

P.S. Translations are community maintained via Nextcloud localization | Transifex (you’ll need to create an account).

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.