Error running update

I have an error when trying to update my database… This is not the first update i do… I don’t know how to solve it…

A checksum error indicated that you modified a changeset that had previously been executed successfully.

When Liquibase executes a changeset it stores the MD5SUM in the databasechangelog table. Each execution compares that MD5SUM with the MD5SUM of the current changelog to make sure you didn’t change it.

To resolve this problem you need to determine why the changeset was modified after it had already been deployed.

Can i reset the situation and restart ?

Yes. You have a few options.

  1. You can put the original changset version back in place, then use Liquibase rollback to rollback the changset, then modify the changeset again as needed, then redeploy using Liquibase update.

  2. Use a sql tool to remove the object(s) created by Liquibase, then remove the changeset row from the databasechangelog table, then redeploy using Liquibase update.

I’d highly recommend using option 1, but if you are only in a dev environment then option 2 will work.

Going forward, do not modify an already executed changeset without first rolling-back the changeset.

These are the commands i use when i need to syncronize my db

liquibase --outputFile=dubhe_snapshot.json snapshot --url=jdbc:postgresql://192.168.2.243:5432/dubhe

liquibase diffChangeLog --url=jdbc:postgresql://192.168.2.243:5432/dubhe1 --referenceUrl=offline:postgresql?snapshot=dubhe_snapshot.json

liquibase --url=jdbc:postgresql://192.168.2.243:5432/dubhe1 update

Is there something uncorrect ?

I have main db (dubhe) where i normally work and second (dubhe1) that i need to update e make the same as main…

Thanks

That sequence of commands look fine, but changeset “changelog.dubhe.sql::1627658508029-2::m.bosetti” must have already been executed in dubhe1, and then it was modified and ran again.

Can you look in the dubhe1 databasechangelog table to see when that was originally executed? What changelog is defined in your liquibase.properties file?

I reset all deleting liquibase two tables in my db… now it works…i sent you the commands i normaly use to see if they can be the origin of my problem…

Thanks for your support

1 Like