FWIW, all reference application modules start up properly on platform 2.4 as you can see here: https://qa-refapp.openmrs.org/
The necessary fixes were done months ago. For modules that have not yet been released, you need their snapshot versions, like was the case of the adminui module, before i released it today.
After the Liquibase overhaul was merged to master in May 2020, I fixed a few OpenMRS repositories where data was loaded from sql files and records were missing from the liquibasechangelog table.
More recently @gcliff uncovered further issues when building an openmrs-standalone release based on openmrs-core 2.4.x. Most of them were fixed and one more fix is pending for starting openmrs-standalone in expert mode.
Regarding the PIH EMR on 2.4.0 core, could you please
Share log files with me?
Let me know how to reproduce the error locally?
That would allow me to look into the matter and provide a fix.
Good timing @wolf@ibacher I was just looking into it.
So, it looks like the “getInitialLiquibaseSnapshotVersion” runs through all the liquibase files for each version of OpenMRS in search of the version that was used to initialize OpenMRS, making the assumption that whatever file has all of the changesets run is the version.
In this case, for some reason on my local dev environment (and I also checked on one of our staging servers) all the 1.9.x changesets have been run, except for these two:
@ibacher@mogoodrich i have tried running the reff app distribution 2.11.0-snapshot on the recently released core 2.4.0-alpha via tomcat and it works fine
Probably the detective can just be updated to consider these “vintage” or “ignorable”?
That sounds like the best approach to me.
When the ChangelogDetective tries to find the baseline snapshots, it looks into all versions, starting at the most recent and finishing with 1.9.x. Instead it should stop at 2.1.x (which is the Liquibase snapshot that comes after 1.9.x) and if there is no match just return 1.9.x as the baseline snapshot.
This should work for all versions that were initialised prior to 1.9.x as all liquibase-update-to-latest-x.y.z.xml change log files would be considered when updating the OpenMRS database.
Just had a look at the logs, the error shown in the screenshot of the initialisation wizard reads
WARN - InitializationFilter$InitializationCompletion$1.run(1724) |2020-10-21T16:24:13,562| Error while
trying to update to the latest database version 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: org\openmrs\liquibase\updates\liquibase-update-to-latest-2.0.x.xml does not exist
This is not related to the ChangeloDetective but an actual changelog file seems to be missing.
Not sure how that could happen, could you please unpack the jar and let me know the content of the org/openmrs/liquibase/updates folder inside the jar? It should contain the missing file.
The “jar” file in this case is the “war” file "openmrs-2.4.0-alpha.
I’m wondering if this has to do with the use of File.separator in the ChangeLogVersionFinder, since I see @gcliff is getting Windows file separators (\) instead of (/). That would work for reading from the file system, but not from the classpath.
@gcliff To actually “see” what’s in the WAR, copy the file and change the extension to .zip (WARs and JARs are just zip files with a defined folder structure).
I submitted two PRs (for openmrs-core master and 2.4.x) that introduce 1.9.x as default value when looking for the Liquibase snapshot that was used to initialise the OpenMRS database.
This change accomplishes two things:
It allows to update OpenMRS instances that were initialised with OpenMRS version prior to 1.9.x.
Un-run change sets in the 1.9.x snapshot files are now ignored by the ChangeLogDetective.