Solve Database Integrity Errors Without Sudo

The system integrity report shows these errors:

  • Some indexes are missing in the database. Due to the fact that adding indexes in large tables can take some time, they were not created automatically. By running “occ db:add-missing-indices” the missing indices can be added manually while the instance continues to run. After the indexes are added, queries to the tables are usually faster.
    • Missing index “cards_abiduri” in the “oc_cards” table.
  • Some primary keys are missing in the database. Due to the fact that adding primary keys to large tables could take some time, they were not added automatically. By running “occ db:add-missing-primary-keys” these missing primary keys can be added manually while the instance continues to run.
    • Missing primary key on table “oc_federated_reshares”.
    • Missing primary key on “oc_systemtag_object_mapping” table.
    • Missing primary key on “oc_comments_read_markers” table.
    • Missing primary key on table “oc_collres_resources”.
    • Missing primary key on “oc_collres_accesscache” table.
    • Missing primary key on table “oc_filecache_extended”.
  • Some columns in the database can be converted to big int. Changing column types can take some time on large tables. Therefore the conversion must be started manually by the command “occ db:convert-filecache-bigint”. For conversion the instance must be offline. See the related documentation page for details.
    • federated_reshares.share_id
    • share_external.id
    • share_external.parent

Is it crucial to solve these or can I just leave it as is? Also, while I’m able to run SH commands, I don’t have sudo access (it’s shared hosting). How do I solve these without the sudo access level?

If you have shell access just without sudo access: have you tried to run the occ command without sudo?

If you don’t have shell access you could try this.

I do have shell access but I get a message that I do not have the required rights.

Hi @cloud_user, I read that you don’t have sudo access , have you access to the user who is used by nextcloud ? ( like www-data or httpd or something else )

Have you try this line when you are inside your nextcloud folder ?
php occ db:add-missing-indices
or
occ db:add-missing-indices

1 Like