How to fix InnoDB corrupted data structure?

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.

3 Likes