Rescue of database with corrupt calendar table

Hi everyone.

I got a NC27 running, and today I faced the fact that my calendars were not working anymore.
I narrowed to problem down to a corrupted nextcloud.oc_calendarobjects table in the mariadb.

As the corresponding .ibd und .frm files looked not too corrupted to me I tried using the innodb recovery method described hereInnoDB Recovery Modes - MariaDB Knowledge Base.
But no luck.

However, the rest of the NC looks healthy and so I was wondering if I could do anything to just get the calendar app running again.

I tried the maintenance:repair command but this just told me again that the table nextcloud.oc_calendarobjects does not exist.

So basically I want to reset/recreate all the databases related to calendars, as I see rebuilding the instance and migrating all my files to a new installation as the last resort.

Would it be safe, to look up all the creation SQLs for all calendar tables and just drop all the databases and recreate them?

Data loss is no problem as I got the calendars backed up as ics files, give or take a few weeks, and still can parse the missing bits from the database files.

Any help would be highly appreciated. I did not include any configuration files or something like this as the problem is fully related to the corrupted table. If someone thinks a specific file or output could be of help, I’m more than happy to provide it.

If this is a duplicate, I’m sorry, I spent the last few hours here and on stackoverflow and did not find anything that seemed to be helpful.

First, please to a backup of your current database, so it can’t get worse than it already is.

Yes, in theory this should work. Disable the app, then delete the related tables. When you enable the app again, it should recreate the table. It should work with normal apps, not sure if the calendar might be fiddled deeper that it might cause issues (probably not).

Nope, the calendar data lies in the server and is handled by the dav core app. The Calendar app is just a CalDAV client, the only tables it manages are the appointment ones (calendar_appt_configs and calendar_appt_bookings).

2 Likes