OpenMRS Reference Application 2.12.2 - error when installing - liquibase updates samuel34 and miirochristopher fail

@dkayiwa @burke perhaps related to:

I have written an installation document for RefApp 2.12.2 Installing on Windows 10 and Windows 11 OS using Java 8
I initially used Java 16: “This release requires Java 1.8 and supports up to Java 16” statement from: Release Notes 2.12.1 - Resources - OpenMRS Wiki

line number log references below are from invoking installation from cmd console using -commandline switch.

during “initialsetup” stage of installation process installation halts with: “Line 4558: ERROR - Slf4jLogger.severe(22) … Change Set liquibase-update-to-latest.xml::TRUNK-5728-2020-04-15::samuel34 failed. Error: Can’t create table ‘openmrs.#sql-5bb4_6b’ (errno: 121) [Failed SQL: (1005) ALTER TABLE openmrs.conditions ADD CONSTRAINT conditions_encounter_id_fk FOREIGN KEY (encounter_id) REFERENCES openmrs.encounter (encounter_id)]”

Reloading browser displays 3 database updates remaining to be processed in browser window, starting with samuel34 item, followed by 2 miirochristopher items.

Processing proceeds by ignoring failure at samuel34: Line 4563: 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.3.x.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::TRUNK-5728-2020-04-15::samuel34: … Line 5092: INFO - Slf4jLogger.info(42) … Marking ChangeSet: liquibase-update-to-latest.xml::TRUNK-5728-2020-04-15::samuel34 ran despite precondition failure due to onFail=‘MARK_RAN’: … Line 5100: INFO - Slf4jLogger.info(42) … INSERT INTO openmrs.liquibasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES (‘TRUNK-5728-2020-04-15’, ‘samuel34’, ‘liquibase-update-to-latest.xml’, NOW(), 10872, ‘8:2a90bedc8b02e4c89e1a37dc1110014b’, ‘addColumn tableName=conditions; addForeignKeyConstraint baseTableName=conditions, constraintName=conditions_encounter_id_fk, referencedTableName=encounter’, ‘Adding ‘‘encounter_id’’ column to ‘‘conditions’’ table’, ‘MARK_RAN’, NULL, NULL, ‘3.10.2’, NULL) … Line 5124: INFO - Slf4jLogger.info(42) … Marking ChangeSet: liquibase-update-to-latest.xml::2020-08-29-2200-TRUNK-5821::miirochristopher ran despite precondition failure due to onFail=‘MARK_RAN’:

Because of mark_ran, installation completes and the RefApp appears functional.

Using Java 16 install fails at same initial samuel34 liquibase update,

Line 4564: ERROR - Slf4jLogger.severe(22) … Change Set liquibase-update-to-latest.xml::TRUNK-5728-2020-04-15::samuel34 failed. Error: Can’t create table ‘openmrs.#sql-65a0_6b’ (errno: 121) [Failed SQL: (1005) ALTER TABLE openmrs.conditions ADD CONSTRAINT conditions_encounter_id_fk FOREIGN KEY (encounter_id) REFERENCES openmrs.encounter (encounter_id)]

but - unlike Java 8 - does not recover when browser is reloaded and installation cannot complete (onFail=‘MARK_RAN’ apparently has no effect). Line 4619: 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.3.x.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::TRUNK-5728-2020-04-15::samuel34:

miirochristopher references do not get processed at all because processing is blocked by samuel34 failure .

Question: samuel34 appears to involve encounter and condition data, and miirochristopher is somehow dependent upon samuel34 updates. What demonstration RefApp functions are impacted by these dataload failures?

Do you have any antivirus software running on this machine? If yes, try to temporarily disable it and restart tomcat.

Thank you Daniel.

Yes, I had Windows Defender antivirus running. (However, I had granted the OpenMRS services access when asked during the installation process.)

I repeated installation with the antivirus disabled

I assumed that the installation process would not pull additional files down from the internet during installation so I had also turned my connection to the internet off for security reasons.

I had the same results.

As part of reviewing the logs for this repeat of the installation I discovered that there are many files that get skipped during the initialsetup process. During my previous installations I was looking only at the samuel34 and miirochristopher items, because those were the only items listed on the browser page when it was reloaded after the “ERROR - Slf4jLogger.severe(22)” block was encountered.

Is the following list of bypassed failures the expected behavior for the installation?

list of “despite precondition failure due to onFail=‘MARK_RAN’” from the Java 8 install (Java 16 cannot complete the install).

INFO - Slf4jLogger. Marking ChangeSet: liquibase

-update-to-latest.xml::201609171146-2.1::vshankar
-update-to-latest.xml::201610242135-3::vshankar
-update-to-latest.xml::201609171146-5.1::vshankar
-update-to-latest.xml::201610042145-1.1::vshankar
-update-to-latest.xml::TRUNK-4755::Rahul,Swathi
-update-to-latest.xml::20151218-1729::Rahul,Swathi
-update-to-latest.xml::20181402-TRUNK-5339::esirkings
-update-to-latest.xml::TRUNK-5728-2020-04-15::samuel34
-update-to-latest.xml::2020-08-29-2200-TRUNK-5821::miirochristopher
-update-to-latest.xml::2020-08-30-100-TRUNK-5821::miirochristopher
.xml::openconceptlab-v1-5::rkorytkowski
.xml::openconceptlab-v1-7::rkorytkowski
.xml::openconceptlab-v1-03.11.2016-16.10::adamgrzybkowski
.xml::openconceptlab-v1-03.11.2016-16.11::adamgrzybkowski
.xml::10000000-2019-appointment-status::yony258
.xml::43889130-55c2-49e9-b72b-a9eae9a31da7::Partners In Health
.xml::a7a39c84-cb48-427e-9141-ee851c283132::Partners In Health
.xml::a92f91c0-162b-42d9-a33b-c1412dc2948d::Partners In Health
.xml::b50c8351-3c6c-40eb-be40-bbdaed78c5a0::Partners In Health
.xml::9b1eb03d-bd27-428b-8359-5877797b0fb8::Partners In Health
.xml::82b51fe1-e6ad-423c-80a0-d2a48a3efe6c::Partners In Health
.xml::4b4ee08c-262f-48f0-a37e-2372614e1a58::Partners In Health
.xml::17a1d838-bf40-45d0-9e2b-6d177ff7ad62::Partners In Health
.xml::e931b3c1-94b6-4169-90f4-1c6bf49d4883::Partners In Health
.xml::3e32c214-9f9a-4424-8590-43ca68396aa6::Partners In Health
.xml::1df31052-65ce-4b81-8a9c-86c58c87c042::Partners In Health
.xml::aea80abc-8e1b-44f2-9574-c64741750cec::Jeremy Keiper
.xml::f3244825-c3d1-4789-99bd-03a014ae56a4::Jeremy Keiper
.xml::d5bc38a3-35e3-4a16-b1b2-df6f4c32ec7a::Partners In Health
.xml::02fb6cc1-d45c-4985-8117-0d313975fd81::Partners In Health
.xml::e8258234-2133-4270-9370-301c908f1e2b::Partners In Health

all: ran despite precondition failure due to onFail=‘MARK_RAN’:

With the antivirus disabled, can you run the setup afresh? (That is after deleting the database and runtime properties file if it exists)

Hi Daniel.

Yes, that is what I did.
Specifically:

  1. I deleted the entire folder structure that was created by extracting the zip file. c:\openmrs\referenceapplication-standalone-2.12.2\referenceapplication-standalone-2.12.2>

  2. I extracted the zip file again.

  3. I turned off my internet access.

  4. I turned off the antivirus service (all networks: domain, local, and internet).

  5. I opened a cmd window and navigated to the reference application folder.

  6. I ran: java -jar openmrs-standalone.jar -commandline

  7. I entered “demo” in response to “Do you want the demo, empty, …”

  8. I entered “browser” in response to “Type: exit - to quit … browser - to launch a …”

  9. I logged in with admin and proceeded clicked through the two green arrows.

  10. I clicked the browser reload icon after the console log displayed:

"ERROR - Slf4jLogger.severe(22) |2022-03-17T11:15:11,856| Change Set liquibase-update-to-latest.xml::TRUNK-5728-2020-04-15::samuel34 failed. Error: Can’t create table ‘openmrs.#sql-7da0_6b’ (errno: 121) [Failed SQL: (1005) ALTER TABLE openmrs.conditions ADD CONSTRAINT conditions_encounter_id_fk FOREIGN KEY (encounter_id) REFERENCES openmrs.encounter (encounter_id)]

INFO - Slf4jLogger.info(42) |2022-03-17T11:15:11,903| Successfully released change log lock"

Installation proceeded…

  1. I clicked the browser reload icon again when processing blocked again with message:

ERROR - CommonsLoggingOutput.error(75) |2022-03-17T11:17:31,617| Parameter mismatch parsing signatures section in dwr.xml on line: DWRHtmlFormEntryService.checkIfLoggedIn()"

  1. The command console log displays: Mar 17, 2022 11:19:04 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring DispatcherServlet ‘openmrs’ WARN - OpenmrsJspServlet.rescanTldsIfNeeded(56) |2022-03-17T11:19:05,132| Rescanning TLDs Mar 17, 2022 11:19:06 AM org.apache.jasper.compiler.TldLocationsCache tldScanJar INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. WARN - OpenmrsUtil.getDirectoryInApplicationDataDirectory(1217) |2022-03-17T11:19:08,627| ‘c:\openmrs\referenceapplication-standalone-2.12.2\referenceapplication-standalone-2.12.2\appdata\configuration’ doesn’t exist. Creating directories now.

  2. OpenMRS login screen displays on the browser, and the application can be started with any of the pre-defined accounts.

Just for troubleshooting purposes, does it work if you instead choose Starter Implementation?

Hello Daniel, I think the command line version of “Starter Implementation” is “empty”.

I ran a new installation …

  1. I entered “empty” in response to “Do you want the demo, empty, …”

  2. I entered “browser” in response to “Type: exit - to quit … browser - to launch a …”

  3. OpenMRS login screen displays on the browser, and the application can be started with the admin account (I didn’t try any other accounts) there is only one location available to select from: “Unknown location”.

Because the installation doesn’t attempt to load the demo data, it doesn’t proceed to the steps that previously caused the installation to fail.

When I search for “ran despite” in the installation log trace it returns the following 32 entries (note that installation using ‘demo’ option has only 31 entries):

ran despite precondition failure due to onFail=‘MARK_RAN’:

INFO - Slf4jLogger. Marking ChangeSet: liquibase

.xml::openconceptlab-v1-5::rkorytkowski
.xml::openconceptlab-v1-7::rkorytkowski
.xml::openconceptlab-v1-03.11.2016-16.10::adamgrzybkowski
.xml::openconceptlab-v1-03.11.2016-16.11::adamgrzybkowski
.xml::metadatamapping-2016-02-07-1310-b-non-mysql::kosmik
.xml::reporting_report_processor_2::mseaton
.xml::reporting_id_set_cleanup::mseaton
.xml::drop_report_definition_uuid_constraint::mgoodrich
.xml::drop_report_definition_uuid_index::mgoodrich
.xml::drop_creator_for_reporting_report_design::mgoodrich
.xml::drop_changed_by_for_reporting_report_design::mgoodrich
.xml::drop_retired_by_for_reporting_report_design::mgoodrich
.xml::drop_report_design_id_for_reporting_report_design_resource::mgoodrich
.xml::drop_creator_for_reporting_report_design_resource::mgoodrich
.xml::drop_changed_by_for_reporting_report_design_resource::mgoodrich
.xml::drop_retired_by_for_reporting_report_design_resource::mgoodrich
.xml::drop_requested_by_for_reporting_report_request::mgoodrich
.xml::drop_creator_for_reporting_report_processor::mgoodrich
.xml::drop_changed_by_for_reporting_report_processor::mgoodrich
.xml::drop_retired_by_reporting_report_processor::mgoodrich
.xml::add_report_definition_uuid_index::mgoodrich
.xml::add_creator_for_reporting_report_design::mgoodrich
.xml::add_changed_by_for_reporting_report_design::mgoodrich
.xml::add_retired_by_for_reporting_report_design::mgoodrich
.xml::add_report_design_id_for_reporting_report_design_resource::mgoodrich
.xml::add_creator_for_reporting_report_design_resource::mgoodrich
.xml::add_changed_by_for_reporting_report_design_resource::mgoodrich
.xml::add_retired_by_for_reporting_report_design_resource::mgoodrich
.xml::add_requested_by_for_reporting_report_request::mgoodrich
.xml::add_creator_for_reporting_report_processor::mgoodrich
.xml::add_changed_by_for_reporting_report_processor::mgoodrich
.xml::add_retired_by_for_reporting_report_processor::mgoodrich

all: ran despite precondition failure due to onFail=‘MARK_RAN’:

How about the non commandline version?

Hi Daniel, using the java control panel interface with the “Starter Implementation” option seems to behave exactly like the commandline interface using “empty”. The tomcat log seems to have the same 32 "ran despite … " entries

Search "ran despite " (32 hits in 1 file of 1 searched) new 1 (32 hits) Line 1496: INFO - Slf4jLogger.info(42) |2022-03-21T13:29:28,660| Marking ChangeSet: liquibase.xml::

openconceptlab-v1-5::rkorytkowski 
openconceptlab-v1-7::rkorytkowski 
openconceptlab-v1-03.11.2016-16.10::adamgrzybkowski 
openconceptlab-v1-03.11.2016-16.11::adamgrzybkowski 
metadatamapping-2016-02-07-1310-b-non-mysql::kosmik 
reporting_report_processor_2::mseaton 
reporting_id_set_cleanup::mseaton 
drop_report_definition_uuid_constraint::mgoodrich 
drop_report_definition_uuid_index::mgoodrich 
drop_creator_for_reporting_report_design::mgoodrich 
drop_changed_by_for_reporting_report_design::mgoodrich 
drop_retired_by_for_reporting_report_design::mgoodrich 
drop_report_design_id_for_reporting_report_design_resource::mgoodrich 
drop_creator_for_reporting_report_design_resource::mgoodrich 
drop_changed_by_for_reporting_report_design_resource::mgoodrich 
drop_retired_by_for_reporting_report_design_resource::mgoodrich 
drop_requested_by_for_reporting_report_request::mgoodrich 
drop_creator_for_reporting_report_processor::mgoodrich 
drop_changed_by_for_reporting_report_processor::mgoodrich 
drop_retired_by_reporting_report_processor::mgoodrich 
add_report_definition_uuid_index::mgoodrich 
add_creator_for_reporting_report_design::mgoodrich 
add_changed_by_for_reporting_report_design::mgoodrich 
add_retired_by_for_reporting_report_design::mgoodrich 
add_report_design_id_for_reporting_report_design_resource::mgoodrich 
add_creator_for_reporting_report_design_resource::mgoodrich 
add_changed_by_for_reporting_report_design_resource::mgoodrich 
add_retired_by_for_reporting_report_design_resource::mgoodrich 
add_requested_by_for_reporting_report_request::mgoodrich 
add_creator_for_reporting_report_processor::mgoodrich 
add_changed_by_for_reporting_report_processor::mgoodrich 
add_retired_by_for_reporting_report_processor::mgoodrich 

ran despite precondition failure due to onFail=‘MARK_RAN’:

I was able to reproduce this and hence confirmed that it is a bug. Do you mind creating a ticket for it? Tickets - Documentation - OpenMRS Wiki

Hello Daniel, I don’t seem to be able to create a ticket. I can look at existing tickets at this URL: https://issues.openmrs.org/projects/RA/issues/RA-1714?filter=allopenissues

But when I click on the link to create a new issue on the “Tickets - Documentation - OpenMRS Wiki” page you referenced it presents me with a login page that will not accept my login credentials.

My account and password are valid for other OpenMRS functions, so I may not have the necessary permissions.

On the tickets documentation link that i gave above, did you get a chance to look at the text which says? If your OpenMRS ID does not have access to JIRA, contact helpdesk, explaining why you want access and wait for a response via your email address.

Hi Daniel, I have created issue [RA-1987] incomplete deployment of RefApp 2.12.2 due to database precondition failures - OpenMRS Issues