Liquibase 4.21.x introduces changeset validation error

Hi there,

I have done a test upgrade of our software from Liquibase 4.20.0 to 4.21.x (0 and 1). My build goes through with 4.20.0, but runs into a checksum error on 4.21.x.

The build is using org.testcontainers:postgresql to have a fresh test database for each build, so it’s a bit odd that the freshly created database for the build immediately fails; in particular if the same thing goes through with 4.20.0.

Does anyone have a pointer on what could be a reason or an idea for troubleshooting? I have checked the release notes and I didn’t find anything mentioning check sums.

Cheers and thanks,
André

Same issue here.

I just upgraded the “liquibase-maven-plugin” from 4.18.0 to 4.20.0 and no problem.
But when I upgrade from v4.20.0 to v4.21.x I get the following errors:

Failed to execute goal org.liquibase:liquibase-maven-plugin:4.21.1:update (default) on project myproject-common: 
Error setting up or running Liquibase:
liquibase.exception.ValidationFailedException: Validation Failed:
     3 changesets check sum
          changelogs/2023-01-11_202_foo.xml::foo::JR was: 8:e350d4815158265f13ef42a2b920c97a but is now: 8:bcb966fbe934329da77f2c259a3f8adf
          changelogs/2023-02-03_227_bar.xml::bar::NL was: 8:a3425cadf69ee4be00863edda2ddc65a but is now: 8:80cacbfb7672ee1e73e11ba890b749f0
          changelogs/2023-03-02_248_baz.xml::baz::NL was: 8:f259a5df7b4dd551f7b1e925221076c1 but is now: 8:d4e0e8065bf4e43cc59cfc50e820a8e0

Nothing has changed in these files of course. I noticed it happens only for the changeSet where I’m using <createProcedure> or <sql> inside. The others seem good.

One of the the example :

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">

    <!-- ... -->

    <changeSet id="foo" author="JR">
        <createProcedure>
            CREATE OR REPLACE FUNCTION update_timestamp()
            RETURNS TRIGGER AS $$
            BEGIN
            NEW.updated_at := (NOW() AT TIME ZONE 'utc');
            RETURN NEW;
            END;
            $$ LANGUAGE plpgsql;
        </createProcedure>
    </changeSet>

    <!-- ... -->
</databaseChangeLog>

Any ideas ?

That’s a helpful observation. I can confirm that in my case, the changesets producing the error include a “create procedure”. I searched the issues in Liquibase and found the following issue: CreateProcedureChange checksum backwards compatibility is broken · Issue #4156 · liquibase/liquibase · GitHub

So it’s been recognized and a fix has been proposed.

Cheers,
André

@eickler This was fixed and released in v4.22.0.

Thanks for the notice!

Cheers,
André

Ok, so Liquibase 4.22 was pulled back with a recommendation to roll back to Liquibase 4.21.1, which doesn’t work. :grimacing:

Hi @eickler,

First, my sincere apologies for the confusion and frustration we introduced with the 4.22.0 release. We do our best to prevent pain for our Community but failed with this release. We are working to correct the situation.

As for the checksums issue, I suggest the following:

-PJ

There was not a lot of frustration since your downgrade procedure works fine and the upgrade didn’t pass our alpha. Only three instances to fix :tada:

Cheers,
André