Hello everyone,
I am new to openMRS. I have cloned openmrs-core into my local (Windows 11) and built it.
…\openmrs-core>mvn clean install -DskipTests=true
The built was a success!!
created database as ‘openmrs’ on MySQL on XAMPP and created a new user as ‘openmrs_user’. The following is how I created and granted permission to the user.
CREATE USER ‘openmrs_user’@‘127.0.0.1’ IDENTIFIED BY ‘’;
GRANT ALL PRIVILEGES ON . TO ‘openmrs_user’@‘127.0.0.1’ WITH GRANT OPTION; FLUSH PRIVILEGES;
SHOW GRANTS FOR ‘openmrs_user’@‘127.0.0.1’;
I ran the application as follows;
…\openmrs-core>cd webapp …\openmrs-core\webapp>mvn jetty:run
When I ran the application, I got the following errors (exceptions) on the browser (Chrome).
Unable to start OpenMRS. Error thrown was: Should not be here because updates were run previously org.openmrs.module.ModuleException: Unable to start OpenMRS. Error thrown was: Should not be here because updates were run previously at org.openmrs.web.WebDaemon.lambda$startOpenmrs$0(WebDaemon.java:44) at org.openmrs.api.context.Daemon.lambda$runInDaemonThreadInternal$5(Daemon.java:452) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: javax.servlet.ServletException: Should not be here because updates were run previously at org.openmrs.web.Listener.startOpenmrs(Listener.java:353) at org.openmrs.web.WebDaemon.lambda$startOpenmrs$0(WebDaemon.java:42) … 6 more Caused by: org.openmrs.util.DatabaseUpdateException: There was an error while updating the database to the latest. file: org\openmrs\liquibase\updates\liquibase-update-to-latest-2.0.x.xml. Error: liquibase.exception.LiquibaseException: Unable to execute change set: liquibase-update-to-latest.xml::20090402-1517::bwolfe at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:193) at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:153) at org.openmrs.api.context.Context.checkForDatabaseUpdates(Context.java:1238) at org.openmrs.api.context.Context.startup(Context.java:941) at org.openmrs.web.Listener.startOpenmrs(Listener.java:350) … 7 more Caused by: liquibase.exception.LiquibaseException: liquibase.exception.LiquibaseException: Unable to execute change set: liquibase-update-to-latest.xml::20090402-1517::bwolfe at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:155) at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:245) at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:189) … 11 more Caused by: liquibase.exception.LiquibaseException: Unable to execute change set: liquibase-update-to-latest.xml::20090402-1517::bwolfe at org.openmrs.util.DatabaseUpdater$OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:882) at liquibase.changelog.ChangeLogIterator.lambda$run$0(ChangeLogIterator.java:133) at liquibase.Scope.lambda$child$0(Scope.java:201) at liquibase.Scope.child(Scope.java:210) at liquibase.Scope.child(Scope.java:200) at liquibase.Scope.child(Scope.java:179) at liquibase.changelog.ChangeLogIterator.lambda$run$1(ChangeLogIterator.java:122) at liquibase.Scope.lambda$child$0(Scope.java:201) at liquibase.Scope.child(Scope.java:210) at liquibase.Scope.child(Scope.java:200) at liquibase.Scope.child(Scope.java:179) at liquibase.Scope.child(Scope.java:267) at liquibase.Scope.child(Scope.java:271) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:91) … 13 more Caused by: liquibase.exception.MigrationFailedException: Migration failed for changeset liquibase-update-to-latest.xml::20090402-1517::bwolfe: Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: java.sql.SQLSyntaxErrorException: Table ‘openmrs.cohort’ doesn’t exist at liquibase.changelog.ChangeSet.execute(ChangeSet.java:840) at liquibase.changelog.visitor.UpdateVisitor.executeAcceptedChange(UpdateVisitor.java:126) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:70) at org.openmrs.util.DatabaseUpdater$OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:879) … 26 more Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: java.sql.SQLSyntaxErrorException: Table ‘openmrs.cohort’ doesn’t exist at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:176) at liquibase.executor.AbstractExecutor.execute(AbstractExecutor.java:133) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1189) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:790) … 29 more Caused by: liquibase.exception.CustomChangeException: java.sql.SQLSyntaxErrorException: Table ‘openmrs.cohort’ doesn’t exist at org.openmrs.util.databasechange.GenerateUuid.execute(GenerateUuid.java:118) at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:170) … 32 more Caused by: java.sql.SQLSyntaxErrorException: Table ‘openmrs.cohort’ doesn’t exist at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:763) at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648) at org.openmrs.util.databasechange.GenerateUuid.execute(GenerateUuid.java:113) … 33 more
For me, it seems like some requires tables are missing during the table creation. Meanwhile, during the startup, I found following log messages on my console
INFO - ChangeLogDetective.getInitialLiquibaseSnapshotVersion(96) |2025-02-21T16:33:55,790| identifying the Liquibase snapshot version that had been used to initialize the OpenMRS database… INFO - ChangeLogDetective.getInitialLiquibaseSnapshotVersion(109) |2025-02-21T16:33:55,842| looking for un-run change sets in snapshot version ‘2.6.x’ INFO - Slf4JLogger.log(43) |2025-02-21T16:33:56,354| Creating database history table with name: openmrs.liquibasechangelog INFO - Slf4JLogger.log(43) |2025-02-21T16:34:00,850| Parsed changelog file ‘org/openmrs/liquibase/snapshots/schema-only/liquibase-schema-only-2.6.x.xml’ INFO - Slf4JLogger.log(43) |2025-02-21T16:34:00,886| Reading from openmrs.liquibasechangelog INFO - ChangeLogDetective.getInitialLiquibaseSnapshotVersion(118) |2025-02-21T16:34:01,118| file ‘org\openmrs\liquibase\snapshots\schema-only\liquibase-schema-only-2.6.x.xml’ contains 1014 un-run change sets INFO - Slf4JLogger.log(43) |2025-02-21T16:34:01,596| Parsed changelog file ‘org/openmrs/liquibase/snapshots/core-data/liquibase-core-data-2.6.x.xml’ . . . . I AM PARTICULARLY INTERESTED IN GETTING CLARIFICATION ON THE FOLLOWING SECTION;
INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,219| Parsed changelog file ‘org/openmrs/liquibase/updates/liquibase-update-to-latest-2.0.x.xml’ INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,221| Reading from openmrs.liquibasechangelog INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,249| Creating snapshot WARN - Slf4JLogger.log(41) |2025-02-21T16:34:37,298| Name ‘PK_LIQUIBASECHANGELOGLOCK’ ignored for PRIMARY key. INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,322| Successfully acquired change log lock INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,331| Reading from openmrs.liquibasechangelog WARN - Slf4JLogger.log(41) |2025-02-21T16:34:37,856| Due to mariadb SQL limitations, setNullable will lose primary key/autoincrement/not null/comment settings explicitly redefined in the change. Use or to re-specify all configuration if this is the case WARN - Slf4JLogger.log(41) |2025-02-21T16:34:37,856| Due to mariadb SQL limitations, modifyDataType will lose primary key/autoincrement/not null/comment settings explicitly redefined in the change. Use or to re-specify all configuration if this is the case Running Changeset: liquibase-update-to-latest.xml::0::bwolfe INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,966| Marking ChangeSet: liquibase-update-to-latest.xml::0::bwolfe ran despite precondition error: liquibase-update-to-latest.xml : liquibase.precondition.core.SqlPrecondition@44404dd2 : Table ‘openmrs.global_property’ doesn’t exist
Running Changeset: liquibase-update-to-latest.xml::20090214-2247::isherman INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,985| Marking ChangeSet: “liquibase-update-to-latest.xml::20090214-2247::isherman” as ran despite precondition failure due to onFail=‘MARK_RAN’: liquibase-update-to-latest.xml : DBMS Precondition failed: expected postgresql, got mariadb liquibase-update-to-latest.xml : DBMS Precondition failed: expected oracle, got mariadb liquibase-update-to-latest.xml : DBMS Precondition failed: expected db2, got mariadb liquibase-update-to-latest.xml : DBMS Precondition failed: expected mssql, got mariadb
Running Changeset: liquibase-update-to-latest.xml::20090402-1516-cohort::bwolfe INFO - Slf4JLogger.log(43) |2025-02-21T16:34:37,990| Marking ChangeSet: “liquibase-update-to-latest.xml::20090402-1516-cohort::bwolfe” as ran despite precondition failure due to onFail=‘MARK_RAN’: liquibase-update-to-latest.xml : DBMS Precondition failed: expected mysql, got mariadb liquibase-update-to-latest.xml : DBMS Precondition failed: expected oracle, got mariadb
Running Changeset: liquibase-update-to-latest.xml::20090402-1516-concept::bwolfe INFO - Slf4JLogger.log(43) |2025-02-21T16:34:38,003| Marking ChangeSet: “liquibase-update-to-latest.xml::20090402-1516-concept::bwolfe” as ran despite precondition failure due to onFail=‘MARK_RAN’: liquibase-update-to-latest.xml : DBMS Precondition failed: expected mysql, got mariadb liquibase-update-to-latest.xml : DBMS Precondition failed: expected oracle, got mariadb
Running Changeset: liquibase-update-to-latest.xml::20090402-1516-concept_answer::bwolfe INFO - Slf4JLogger.log(43) |2025-02-21T16:34:38,011| Marking ChangeSet: “liquibase-update-to-latest.xml::20090402-1516-concept_answer::bwolfe” as ran despite precondition failure due to onFail=‘MARK_RAN’: liquibase-update-to-latest.xml : DBMS Precondition failed: expected mysql, got mariadb liquibase-update-to-latest.xml : DBMS Precondition failed: expected oracle, got mariadb
Running Changeset: liquibase-update-to-latest.xml::20090402-1516-concept_class::bwolfe INFO - Slf4JLogger.log(43) |2025-02-21T16:34:38,022| Marking ChangeSet: “liquibase-update-to-latest.xml::20090402-1516-concept_class::bwolfe” as ran despite precondition failure due to onFail=‘MARK_RAN’: liquibase-update-to-latest.xml : DBMS Precondition failed: expected mysql, got mariadb liquibase-update-to-latest.xml : DBMS Precondition failed: expected oracle, got mariadb
It seems like something to do with MySQL on XAMPP.
Can someone provide me with instructions on how to resolve the above issue? Your further clarifications are welcome.
Thank you.