Index for table is corrupt
If the nextcloud.log file contains errors like
while executing a query: SQLSTATE[HY000]: General error: 1034 Index for table 'oc_activity' is corrupt; try to repair it"
then the database table must be fixed.
You should check the health of the oc_activity table inside the nextcloud database:
mysql -h localhost -uroot -p'<MySQLpassword>' nextcloud -e "check table oc_activity";
The output may look like
Warning | InnoDB: The B-tree of index PRIMARY is corrupted.
Warning | InnoDB: Index 'activity_user_time' contains 247430 entries, should be 18446744073709551615.
...
error | Corrupt
This means the table’s InnoDB index structures are damaged. That’s why the table couldn’t be read or written to properly.
Below are the steps what needs to be done to repair this.
Repair steps
Subscriber exclusive content
A Nextcloud Enterprise Subscription provides unlimited access to our knowledge base articles and direct access to Nextcloud engineers.