All Categories
  • 1st Steps
  • Authentication
  • Branding
  • Changelogs
  • Collaboration
  • Compliance
  • Customization
  • Desktop Client
  • External Storage
  • Frequently Asked Questions
  • Installation
  • Mobile Clients
  • Nextcloud Flow (Windmill integration)
  • Nextcloud Talk
  • Operations
  • Partner Products
  • Roundcubemail
  • Scalability
  • Security
  • 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