Liquibase validation failed when setting up RA dev environment

Hi everyone,

I have already set up an environment for working on the master branch of the core, but a few days ago I was trying to set up my environment for RA development using this guide. After running the shell script in the distro-referenceapplication directory and then trying to run the webapp with mvn jetty:run, I was given the error that I should not be using Java 1.8 (I think master requires Java 8 but 1.10.x requires Java 6 and 7?). Okay, so I reconfigured my PATH and eclipse JRE to Java 1.7 and now I am getting a very bizarre error message. I am able to start the server, but the following error message is displayed on screen:

The following error occurred at startup:
Error occurred while trying to get the updates needed for the database. Validation Failed: 8 change sets check sum liquibase-update-to-latest.xml::201109301703::suho is now: 3:11456d3e6867f3b521fb35e6f51ebe5a liquibase-update-to-latest.xml::201109301704::suho is now: 3:d64afe121c9355f6bbe46258876ce759 liquibase-update-to-latest.xml::201109301705::suho is now: 3:d3b0c8265ee27456dc0491ff5fe8ca01 liquibase-update-to-latest.xml::201109301706::suho is now: 3:17d3a0900ca751d8ce775a12444c75bf liquibase-update-to-latest.xml::201109301707::suho is now: 3:afbd6428d0007325426f3c4446de2e38 liquibase-update-to-latest.xml::201109301708::suho is now: 3:570c9234597b477e4feffbaac0469495 liquibase-update-to-latest.xml::201109301709::suho is now: 3:20c95ae336f437b4e0c91be5919b7a2b liquibase-update-to-latest.xml::201109301710::suho is now: 3:b06d71b4c220c7feed9c5a6459bea98a 
java.lang.RuntimeException: Error occurred while trying to get the updates needed for the database. Validation Failed:
     8 change sets check sum
          liquibase-update-to-latest.xml::201109301703::suho is now: 3:11456d3e6867f3b521fb35e6f51ebe5a
          liquibase-update-to-latest.xml::201109301704::suho is now: 3:d64afe121c9355f6bbe46258876ce759
          liquibase-update-to-latest.xml::201109301705::suho is now: 3:d3b0c8265ee27456dc0491ff5fe8ca01
          liquibase-update-to-latest.xml::201109301706::suho is now: 3:17d3a0900ca751d8ce775a12444c75bf
          liquibase-update-to-latest.xml::201109301707::suho is now: 3:afbd6428d0007325426f3c4446de2e38
          liquibase-update-to-latest.xml::201109301708::suho is now: 3:570c9234597b477e4feffbaac0469495
          liquibase-update-to-latest.xml::201109301709::suho is now: 3:20c95ae336f437b4e0c91be5919b7a2b
          liquibase-update-to-latest.xml::201109301710::suho is now: 3:b06d71b4c220c7feed9c5a6459bea98a

I have seen this article (the only link I can find when I google this error message): https://wiki.openmrs.org/display/docs/How+to+Modify+a+Bad+Changeset but it doesn’t look like it’s geared to someone in my situation. I have not tried to modify a changeset, nor do I have any idea what liquibase is :fearful:.

I have deleted and reinstalled the core and the distro-referenceapplication a few times trying to figure out what’s happening, but to no avail. Hopefully someone out here has seen this and knows how to fix it or at least a workaround. Thank you!

Since you just want to setup things afresh, just drop the database and delete the runtime properties file. Then run again.

Thanks Daniel Kayiwa, I assume you are talking about the file ~/.OpenMRS/openmrs-runtime.properties, correct? I have tried removing that before running, but it did not work on its own. You are probably right that I have to drop the database as well.

Do you mind walking me through how to drop the DB? When I check my local mysql, I don’t see any openMRS databases, so I have no idea where to access it (unfortunately don’t have too much experience with MySQL). Since this is the first time running mySQL, the only two databases I have a “test” and “information_schema”, and I doubt those two are the OMRS DBs…

I appreciate the help!

Can you come on IRC and ping dkayiwa? https://wiki.openmrs.org/display/IRC/Home

@nicholasfolk, how about you try https://wiki.openmrs.org/display/docs/OpenMRS+SDK ?

@raff Thanks for the suggestion. I know that I could have given up and gone that route, but I’m a stickler for figuring out a bug :smiley: . Fortunately, @dkayiwa helped me out on IRC and I was able to get it working once again. Cheers!

For anyone else that may run into the same problem, here was my solution (and I’m sorry if some of this seems rookie level, but I am still learning!):

I had to drop the database, delete my .OpenMRS runtime properties (though I just removed the entire .OpenMRS directory to start fresh), reinstall the core on master with maven (this may or may not be necessary), checkout 1.10.x branch (might be able to checkout 1.11.x, but the Wiki said to use 1.10.x, so I did, but I will learn the difference between versions when I get a chance), mvn install the core on this branch, cd to the distro ref. app. module, run the shell script from the guide, cd back to the webapp and mvn jetty:run, then complete the webapp GUI initial setup.

Things to note: I had to export the following line so that I didn’t run out of memory: export MAVEN_OPTS="-Xmx1024m -Xms1024m -XX:PermSize=256m -XX:MaxPermSize=512m"

I can reliably (at least twice, as it takes a long time to go through these steps) reproduce the liquibase error that I describe in my original post. The problem was that I had already gone through the initial setup on the webapp (and set up a DB) on master, then tried to do it again. It’s weird that the step by step instructions link to the core module setup and instruct the new developer to complete that setup first, because this will almost certainly result in the same error. I would update the wiki guide but I’m not sure if my solution is hacky, works on other systems/environments, etc.

Hope this helps someone else!

1 Like

Nicholas, i love the spirit of sharing. Please keep it up! :slight_smile:

Actually those wiki instructions were outdated and you should have gone with 1.11.x. I have updated the instructions, though in my attempt to be precise and accurate, I’m afraid what I wrote is hard to understand. @nicholasfolk, could you take a look at this and say whether it’s intelligible or not? Here’s the specific edit.

1 Like

@dkayiwa, Will do!

@darius, Yes, the updates are intelligible and more helpful. I like that instead of explicitly describing a branch, you give instruction on how to find the correct branch to use. The only line that’s a bit confusing is "but rather the lowest possible version given their functionality". I interpret this as: you should always try to design modules/apps/add-ons to rely on the earliest possible version of the core (presumably so that it can be functional on as many instances as possible?)

If that’s correct, then the message is appropriate. But I did have to read it twice.

1 Like

Thanks for the feedback!

That was the correct interpretation. I clarified that statement and I also moved part of it to a later section of the page, because it really wasn’t adding useful information where it was earlier.

1 Like

Happy to give feedback where I can. It’s great to see a responsive and helpful community :grinning:

2 Likes