How to fix InnoDB corrupted data structure?

Application Name: Reference Application

Version Number: 2.13.0

OS: Windows 10 Pro Version 22H2, build 19045.3693

WSL: Version 2, kernel version:

Docker Desktop: 4.26.0 (130397)


Hi Community!

I’m trying to install an OpenMRS standalone instance for a small pediatric center (with fewer than 30 patients). However, I’m currently encountering problems when starting the application.

Here the commands I did:

git clone
cd openmrs-distro-referenceapplication
git checkout 2.13.0
docker compose build
docker compose up

Here the error I’m currently receiving:

db-1              | 2023-12-12  9:35:30 0 [ERROR] InnoDB: Invalid flags 0x15 in ./ibdata1
db-1              | 2023-12-12  9:35:30 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption

Here the complete output

Do you have any idea on how to fix this?

So in the log I see this:

Found orphan containers ([openmrs-distro-referenceapplication-gateway-1 openmrs-distro-referenceapplication-frontend-1 openmrs-distro-referenceapplication-backend-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.

Which seems to have been the result of trying to start the containers from the main branch before switching to the 2.13.0 tag, but the containers, volumes, etc. weren’t removed. By default, then, when you run docker compose up it will reuse those same containers and volumes. Both the main branch and the 2.13.0 tag use a volume called db-data to persist the database contents. However, they use different and incompatible versions of MariaDB (specifically, the main branch uses 10.8 and the 2.13.0 tag uses 10.3), which is why you’re getting that error.

The fix is simple: run docker compose down -v --remove-orphans and then try running the docker compose up command again.