Changes to Liquibase files breaks OpenMRS startup
Description
Attachments
- 27 Jan 2025, 10:50 PM
- 27 Jan 2025, 10:50 PM
Activity
Mark Goodrich last month
So PR for fix to 2.6.x here: https://github.com/openmrs/openmrs-core/pull/4899
Strangely, I could not reproduce when updating from a base platform 2.7.0 install to 2.7.2-SNAPSNOT or 2.8.0-SNAPSHOT. I even trying further modifying the liquibase-core-data-2.6.x.xml and it seems to process that file without error (and determining that there were no unrun changesets). I may have been doing something wrong, or are we somehow taking a more lenient touch towards to changing changesets going forward (doing about 10 minutes of research the ChangeLogDetective changes from 2.6.x to 2.7.x, but I didn’t find anything obvious that said ignore changelog changes).
@Mike Seaton @Daniel Kayiwa @Ian Bacher
Mark Goodrich last month
The more I think about it @Daniel Kayiwa @Ian Bacher (fyi @Mike Seaton ) we need to apply the validCheckSum flag because this commit has gone out in a release (2.6.14)
I’ve got a commit to fix the 2.6.x branch, testing now to see if I can repro the same problem in the 2.6.x changelog file (and therefore get what the proper checksums should be)
Mark Goodrich last month
Work for me. Thoughts @Ian Bacher ?
I guess net takeaway again is that we can’t modify liquibase changesets.
Daniel Kayiwa last month
@Mark Goodrich thanks for the detailed steps. I was able to reproduce it.
Though we could add a validCheckSum
tag for the new and old checksums, i would vote to just revert this commit because: 1) It did not fix what it was intended to. 2) The original xml seems to be valid.
Mark Goodrich last month
So @Ian Bacher @Daniel Kayiwa @Mike Seaton I was easily able to reproduce it doing the following:
Use the SDK to set up a Platform 2.6.1 instance
Start it up and then stop it once setup finishes
Then check out the latest of the 2.6.x core branch and use mvn openmrs-sdk:deploy to deploy the 2.6.15-SNAPSHOT version of Core
Restart, and you should get the following error:
ERROR - Listener.contextInitialized(266) |2025-01-27T18:00:15,731| Failed to obtain JDBC connection
liquibase.exception.ValidationFailedException: Validation Failed:
1 change sets check sum
org/openmrs/liquibase/snapshots/core-data/liquibase-core-data-2.5.x.xml::1644357753728-10::danielkayiwa (generated) was: 8:faafdcb2c1b2772a9e4b7d43b0eecbc6 but is now: 8:1a9b9c14f944b91e6c4364d73570ddcb
at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:299) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Liquibase$16.run(Liquibase.java:1987) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Scope.lambda$child$0(Scope.java:166) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Scope.child(Scope.java:175) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Scope.child(Scope.java:165) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Scope.child(Scope.java:144) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Liquibase.runInScope(Liquibase.java:2404) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:1977) ~[liquibase-core-4.4.3.jar:?]
at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:1968) ~[liquibase-core-4.4.3.jar:?]
at org.openmrs.liquibase.ChangeLogDetective.getInitialLiquibaseSnapshotVersion(ChangeLogDetective.java:89) ~[openmrs-api-2.6.15-SNAPSHOT.jar:?]
at org.openmrs.util.DatabaseUpdater.getUnrunDatabaseChanges(DatabaseUpdater.java:642) ~[openmrs-api-2.6.15-SNAPSHOT.jar:?]
at org.openmrs.util.DatabaseUpdater.updatesRequired(DatabaseUpdater.java:271) ~[openmrs-api-2.6.15-SNAPSHOT.jar:?]
at org.openmrs.web.Listener.setupNeeded(Listener.java:334) ~[openmrs-web-2.6.15-SNAPSHOT.jar:?]
at org.openmrs.web.Listener.contextInitialized(Listener.java:245) ~[openmrs-web-2.6.15-SNAPSHOT.jar:?]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_432]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ~[?:1.8.0_432]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_432]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) ~[?:1.8.0_432]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) ~[tomcat-embed-core-9.0.52.jar:9.0.52]
at org.openmrs.maven.plugins.RunTomcat.execute(RunTomcat.java:199) ~[openmrs-sdk-tomcat9-maven-plugin-6.1.0.jar:?]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:370) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:351) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:215) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:171) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:163) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:298) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) ~[maven-core-3.x.jar:3.8.7]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:960) ~[maven-embedder-3.x.jar:3.8.7]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293) ~[maven-embedder-3.x.jar:3.8.7]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:196) ~[maven-embedder-3.x.jar:3.8.7]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_432]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_432]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_432]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_432]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283) ~[plexus-classworlds.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226) ~[plexus-classworlds.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407) ~[plexus-classworlds.jar:?]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348) ~[plexus-classworlds.jar:?]
I suspect this will happen any time someone tries to update an SDK that was initially installed with 2 6.x version to the latest 2.6.x version?
@Ian Bacher this recent commit to the 2.6.x, 2.7.x, and master branch is a blocker and stopping OpenMRS startup for some of us because it changes the checksum of a liquibase changelog file
Fix the AddressTemplate in the core data schema · openmrs/openmrs-core@d8466ab
Fix the AddressTemplate in the core data schema · openmrs/openmrs-core@ecd7626
Fix the AddressTemplate in the core data schema · openmrs/openmrs-core@86627db
What was the intent here?