Changelog Parameters and Checksum Errors

I am getting a checksum error when trying to run a changelog file.  I am using parameters in the changelog file, and these parameters DO change, because they are passed in at runtime.

I have that changeset “runAlways=true”, so it is supposed to always run.

Is this supposed to fail?  Is there anyway I can get parameterized changelogs to run and have the checksum capability run appropriately?

I am using Liquibase 2.0 rc4.

Here is the exception:
liquibase.exception.ValidationFailedException: Validation Failed
1 change sets check sum

at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:137)
at liquibase.Liquibase.update(Liquibase.java:106)

I think I may have answered my own question.  I replaced “runAlways=true” with “runOnChange=true”, and now it runs every time because the parameter changes, which is actually the desired behavior.  Sweet.

Glad you figured it out.  Thanks for the update

Nathan

I’m happy you got your resolved. I have permissions files that I want runAlways so have them set runAlways:true, but they don’t always change and I get the same results:

[2023-04-11 11:34:12] SEVERE [liquibase.integration] Validation Failed:
1 changesets check sum
src/main/resources/liquibase/changelog/tenant/perms/grantPerms_apps.sql::perms-apps::jwalker was: 8:25e863d98cb362ebb38212238a8c0df4 but is now: 8:e1ed8c700694b3d64c1c3e3d634d6939

but it is runAlways:true, so I would expect the checksum would not matter, it should just run?

so sorry, the problem is when it does change it fails validation as above, but I would expect as runAlways:true it should not matter if it changes, just run it either way.

runAlways:true does not allow the changeset to be modified. runOnChange:true allows the changeset to be modified.

1 Like

Thanks Daryl. I just figured that out - runAlways is not a good name for the flag, it should be runNoChange. I got thing to work by having both runAlways:true and runOnChange:true. They should update the documentation to make it clear that it doesn’t always run, and that it can actually create an unexpected error.

runAlways:true is used to run a changeset on every liquibase deployment, but it expects that you are not modifying that changeset.

runOnChange:true is for running a changeset everytime it is modified.

You should not have to have both flags on the same changeset.

because runAlways does not “run always” (it fails if the file changed) I need to have both to ensure this script is run every deploy whether or not it has changed. Thus I need to have both of these in order to do that. If runAlways always run like it is described, then I would only need runAlways:true.

I created RunAlways="true" still fails checksum errors · Issue #4125 · liquibase/liquibase · GitHub to track the feature request to make runAlways run regardless of checksum validation

Nathan

1 Like