Wiki Spaces


Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack


Page tree
Skip to end of metadata
Go to start of metadata

Occasionally we may discover a bug introduced by a bad changeset, and want to fix the changeset so that people who upgrade in the future don't run into this. This is possible, but it's important to follow the correct process.

The reason we have to do this is that liquibase keeps checksums of all changesets that have ever been run on your database, so if you modify a changeset after anybody has run it, that user will get an error and be unable to start OpenMRS the first time they try to run an OpenMRS version with the modified changeset. The workaround is to explicitly list all valid checksums, so that things don't break for people who already ran the old version of the changeset. (Note: this will not re-run the new changeset for people who ran the original one. Depending on the bug you're trying to fix, you may also need to add a new changeset to clean up after the original version of the old one.)

What to do:

  1. Find the changeset you'd like to modify in liquibase-update-to-latest.xml. Make your change, and restart OpenMRS.
    1. You will see an error message like this
      Error occurred while trying to get the updates needed for the database. Validation Failed: 1 change sets check sum liquibase-update-to-latest.xml::20101209-1723::wyclif::(MD5Sum: 4d67c48557f5665a8c2be7e87e22913)
    2. Note down the MD5Sum that is reported. This is the checksum for the new version of the changeset. (In this case it is "4d67c48557f5665a8c2be7e87e22913".)
    3. Look in the liquibasechangelog table in your database for the checksum of the old version of the changeset. For example
      select md5sum from liquibasechangelog where id = '20101209-1723'
      --> db17937286d48f680b2be16bee24e62
  2. Go back to the changeset in liquibase-update-to-latest.xml and add a validCheckSum subtag for both the old and new checksums, making sure to comment them. For example:
    <changeSet id="20101209-1723" author="wyclif">
        <validCheckSum>db17937286d48f680b2be16bee24e62</validCheckSum> <!-- old checksum without specifying date_created -->
        <validCheckSum>4d67c48557f5665a8c2be7e87e22913</validCheckSum> <!-- current checksum with date_created property added -->

1 Comment

  1. I got this error with a liquibase-update-to-latest.xml that contained both valid checkSums.  

    It was resolved by updating the old MD5 value for the changeset in the liquibaseChangeLog table to the new MD5 checksum listed in the error message and in liquibase-update-to-latest.xml .