Create database failed with dependency errors

OpenMRS 2.5.0 on Oracle Linux 7 with MariaDB 10.8.3

During installation I got stuck on database creation as given on Step 6 - Configure OpenMRS - Documentation - OpenMRS Wiki. I got multiple errors that rows could not be added as foreign key constraints were not met.

I dropped openmrs database and now the installation is really stuck. It kept giving errors on connection and create db steps. I recreated the user openmrs_user and the db by hand. After restarting Tomcat, I get to a login page which says: “The OpenMRS 2.5.0 server is currently in maintenance mode.” It asks for a user id & password, which naturally doesn’t work as the user tables aren’t there.

How do I rerun the table creation + demo data scripts?

EDIT Cleaning out /usr/share/tomcat.OpenMRS and restarting Tomcat allowed me to rerun the initial setup.

This time I selected not to add demo data which allowed the step to complete.

Now, how to get the demo data…

https://wiki.openmrs.org/display/RES/Demo+Data

Thank you. I’ll try that.

Also, after logging in as “admin”, I see just a simple screen for add-on manager with no other options.

Did something else break?

You would need to put modules/addons in the modules folder: OpenMRS - Browse /releases/OpenMRS_Reference_Application_2.12.0 at SourceForge.net

/usr/share/tomcat.OpenMRS/modules

I did. Now the application UI etc is there, but a number of modules don’t start:

The dependencies list the reporting module as the one due to which they are failing. The reporting gives this error: Unable to update data model using liquibase.xml. Module: Reporting

As per the log, this is the cause:

WARN - ModuleFactory.startModuleInternal(783) |2022-08-12T15:15:13,462| Error while trying to start module: reporting org.openmrs.module.ModuleException: Unable to update data model using liquibase.xml. Module: Reporting at org.openmrs.module.ModuleFactory.runLiquibase(ModuleFactory.java:992) ~[openmrs-api-2.5.0.jar:?] at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:723) [openmrs-api-2.5.0.jar:?] at org.openmrs.api.context.Daemon$1.run(Daemon.java:86) [openmrs-api-2.5.0.jar:?] Caused by: liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase.xml::reporting_report_design_5::mseaton: Reason: liquibase.exception.DatabaseException: Key column ‘report_definition_uuid’ doesn’t exist in table [Failed SQL: (1072) CREATE INDEX report_definition_uuid_for_reporting_report_design ON openmrs.reporting_report_design(report_definition_uuid)] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:124) ~[liquibase-core-4.4.1.jar:?] at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:232) ~[openmrs-api-2.5.0.jar:?] at org.openmrs.module.ModuleFactory.runLiquibase(ModuleFactory.java:984) ~[openmrs-api-2.5.0.jar:?] … 2 more Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase.xml::reporting_report_design_5::mseaton: Reason: liquibase.exception.DatabaseException: Key column ‘report_definition_uuid’ doesn’t exist in table [Failed SQL: (1072) CREATE INDEX report_definition_uuid_for_reporting_report_design ON openmrs.reporting_report_design(report_definition_uuid)] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:672) ~[liquibase-core-4.4.1.jar:?] at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:49) ~[liquibase-core-4.4.1.jar:?] at org.openmrs.util.DatabaseUpdater$OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:850) ~[openmrs-api-2.5.0.jar:?] at liquibase.changelog.ChangeLogIterator$2.lambda$null$0(ChangeLogIterator.java:111) ~[liquibase-core-4.4.1.jar:?]