Sql Duplicate entry 'concepts.locked'

Hello I am running openmrs core locally for this first time, when I go to the url http://localhost:8080/openmrs/initialsetup and follow the steps I get the below error. I tried removing the database and starting over but get the same error. This is when selecting the simple installation and choosing to add demo data to the database

There was an error while updating the database to the latest. file: liquibase-demo-data.xml. Error: Migration failed for change set liquibase-schema-only.xml::1226412230538-11::ben (generated): Reason: liquibase.exception.DatabaseException: Duplicate entry 'concepts.locked' for key 'global_property.PRIMARY' [Failed SQL: (1062) INSERT INTO openmrs.global_property (property, property_value, `description`, uuid) VALUES ('concepts.locked', 'false', 'true/false whether or not concepts can be edited in this database.', 'c97cc1a7-7e03-43b1-892c-385d1b621017')] See the error log for more details

Here is the stacktrace:

WARN - InitializationFilter$InitializationCompletion$1.run(1667) |2021-06-19T10:50:01,604| Error while trying to add demo data
org.openmrs.util.DatabaseUpdateException: There was an error while updating the database to the latest. file: liquibase-demo-data.xml. Error: Migration failed for change set liquibase-schema-only.xml::1226412230538-11::ben (generated):
     Reason: liquibase.exception.DatabaseException: Duplicate entry 'concepts.locked' for key 'global_property.PRIMARY' [Failed SQL: (1062) INSERT INTO openmrs.global_property (property, property_value, `description`, uuid) VALUES ('concepts.locked', 'false', 'true/false whether or not concepts can be edited in this database.', 'c97cc1a7-7e03-43b1-892c-385d1b621017')]
        at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:189) ~[classes/:?]
        at org.openmrs.web.filter.initialization.InitializationFilter$InitializationCompletion$1.run(InitializationFilter.java:1658) [classes/:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_291]
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase-schema-only.xml::1226412230538-11::ben (generated):
     Reason: liquibase.exception.DatabaseException: Duplicate entry 'concepts.locked' for key 'global_property.PRIMARY' [Failed SQL: (1062) INSERT INTO openmrs.global_property (property, property_value, `description`, uuid) VALUES ('concepts.locked', 'false', 'true/false whether or not concepts can be edited in this database.', 'c97cc1a7-7e03-43b1-892c-385d1b621017')]
        at liquibase.changelog.ChangeSet.execute(ChangeSet.java:659) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[liquibase-core-3.10.3.jar:?]
        at org.openmrs.util.DatabaseUpdater$OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:850) ~[classes/:?]
        at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:97) ~[liquibase-core-3.10.3.jar:?]
        at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:232) ~[classes/:?]
        at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:185) ~[classes/:?]
        ... 2 more
Caused by: liquibase.exception.DatabaseException: Duplicate entry 'concepts.locked' for key 'global_property.PRIMARY' [Failed SQL: (1062) INSERT INTO openmrs.global_property (property, property_value, `description`, uuid) VALUES ('concepts.locked', 'false', 'true/false whether or not concepts can be edited in this database.', 'c97cc1a7-7e03-43b1-892c-385d1b621017')]
        at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:430) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:87) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:159) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1276) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1258) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.changelog.ChangeSet.execute(ChangeSet.java:622) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[liquibase-core-3.10.3.jar:?]
        at org.openmrs.util.DatabaseUpdater$OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:850) ~[classes/:?]
        at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:97) ~[liquibase-core-3.10.3.jar:?]
        at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:232) ~[classes/:?]
        at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:185) ~[classes/:?]
        ... 2 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'concepts.locked' for key 'global_property.PRIMARY'
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) ~[mysql-connector-java-8.0.22.jar:8.0.22]
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.22.jar:8.0.22]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.22.jar:8.0.22]
        at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:764) ~[mysql-connector-java-8.0.22.jar:8.0.22]
        at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648) ~[mysql-connector-java-8.0.22.jar:8.0.22]
        at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:426) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:87) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:159) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1276) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1258) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.changelog.ChangeSet.execute(ChangeSet.java:622) ~[liquibase-core-3.10.3.jar:?]
        at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[liquibase-core-3.10.3.jar:?]
        at org.openmrs.util.DatabaseUpdater$OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:850) ~[classes/:?]
        at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:97) ~[liquibase-core-3.10.3.jar:?]
        at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:232) ~[classes/:?]
        at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:185) ~[classes/:?]
        ... 2 more

Do the installation again but do not choose to add demo data.

1 Like