Validation Failed error occurs when I rollback a change set file from the command prompt

Greetings,

I’m still working on the same project I reported about here
But to keep the forum organized, I open a new thread for this problem.

I’m imitating the “Tutorial using Oracle” on Liquibase web site. I have a top level update.xml file that include other files in a hierarchy until reaching to the change sets xml files.

When I roll back the top update.xml file it works well. And it rolls back every thing, so the database is cleared.
When I open a command prompt window and navigate to the project folder and type the following:
>liquibase --changeLogFile=v000/tables/group.xml rollbackCount 1
I get this error:

  1. INFO 27/01/12 10:17 ╒:liquibase: Successfully acquired change log lock
    INFO 27/01/12 10:17 ╒:liquibase: Reading from [dbo].[DATABASECHANGELOG]
    INFO 27/01/12 10:17 ╒:liquibase: Successfully released change log lock
    Liquibase Update Failed: Validation Failed:
         1 change sets check sum
              v000/tables/group.xml::5::ashraf is now: 3:6bf294520310e145119b039adfd
    4c27b

    SEVERE 27/01/12 10:17 ╒:liquibase: Validation Failed:
         1 change sets check sum
              v000/tables/group.xml::5::ashraf is now: 3:6bf294520310e145119b039adfd
    4c27b

    liquibase.exception.ValidationFailedException: Validation Failed:
         1 change sets check sum
              v000/tables/group.xml::5::ashraf is now: 3:6bf294520310e145119b039adfd
    4c27b

            at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java
    :141)
            at liquibase.Liquibase.rollback(Liquibase.java:242)
            at liquibase.integration.commandline.Main.doMigration(Main.java:805)
            at liquibase.integration.commandline.Main.main(Main.java:133)


    For more information, use the --logLevel flag)

The check sum in the error is really different than that in the database.

How comes? Or the question is, why the two sums are different? Is the path from which Liquibase executes is fed as an argument to the check sum computation?

Did you get this resolved along with the other issue referenced?

Nathan

Ashraf,

Iam getting the same error when I am trying to add columns to the database.Did u solved the error?How did u figure it put.

please help me …

I didn’t manage to solve the particular situation, but I managed to do what I wanted anyway.

It seems that Liquibase doesn’t allow rolling back a change set that was executed as a part of a larger set, so to rollback certain change set, you need to rollback the root set with rollbackCount of 1 until you reach the target sub set.

When I want to rollback v000/tables/group.xml I type this:
liquibase --changeLogFile=update.xml rollbackCount 1
(update.xml is the file of the root change set) I type this one time after another until I reach the changes at group.xml

If you already know that the target subset ordinal is, for example, 4 from the bottom to top, you may type
liquibase --changeLogFile=update.xml rollbackCount 4
This will rollback the last 4 changes

I hope this helps you