Description
Search first
- I searched and no similar issues were found
Description
The changes in #4463 cause Liquibase#calculateCheckSum()
to always fail with the error message:
Error encountered while parsing the command line. '--changeset-identifier' cannot be provided alongside other changeset arguments: '--changeset-id', '--changeset-path', '--changeset-author'.
Looks like this check is responsible for the error message:
https://github.com/liquibase/liquibase/blame/v4.25.1/liquibase-standard/src/main/java/liquibase/command/core/CalculateChecksumCommandStep.java#L140-L142
The command is always constructed with
CalculateChecksumCommandStep.CHANGESET_PATH_ARG
, CalculateChecksumCommandStep.CHANGESET_ID_ARG
, CalculateChecksumCommandStep.CHANGESET_AUTHOR_ARG
, and CalculateChecksumCommandStep.CHANGESET_IDENTIFIER_ARG
which triggers the exception:
Steps To Reproduce
With Liquibase 4.25.0:
@Test
void liquibasePullRequest4463() throws LiquibaseException {
Liquibase liquibase = new Liquibase("migrations.xml", new ClassLoaderResourceAccessor(), new H2Database());
liquibase.calculateCheckSum("", "1", "name");
}
Exception:
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: java.lang.IllegalArgumentException: Error encountered while parsing the command line. '--changeset-identifier' cannot be provided alongside other changeset arguments: '--changeset-id', '--changeset-path', '--changeset-author'.
at liquibase.command.CommandScope.execute(CommandScope.java:237)
at liquibase.Liquibase.calculateCheckSum(Liquibase.java:1278)
at com.github.joschi.liquibase.DbCalculateChecksumCommandTest.liquibasePullRequest4463(DbCalculateChecksumCommandTest.java:47)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
Caused by: liquibase.exception.LiquibaseException: java.lang.IllegalArgumentException: Error encountered while parsing the command line. '--changeset-identifier' cannot be provided alongside other changeset arguments: '--changeset-id', '--changeset-path', '--changeset-author'.
at liquibase.command.core.CalculateChecksumCommandStep.validateIdentifierParameters(CalculateChecksumCommandStep.java:148)
at liquibase.command.core.CalculateChecksumCommandStep.run(CalculateChecksumCommandStep.java:95)
at liquibase.command.CommandScope.execute(CommandScope.java:214)
... 5 more
Caused by: java.lang.IllegalArgumentException: Error encountered while parsing the command line. '--changeset-identifier' cannot be provided alongside other changeset arguments: '--changeset-id', '--changeset-path', '--changeset-author'.
... 8 more
Expected/Desired Behavior
The checksum of the changeset should be calculated without an exception.
Liquibase Version
4.25.0
Database Vendor & Version
All
Liquibase Integration
Code (via liquibase.Liquibase)
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
- fix(deps): update dependency org.liquibase:liquibase-core to v4.25.0 (release/2.1.x) dropwizard/dropwizard#7883
- fix(deps): update dependency org.liquibase:liquibase-core to v4.25.0 (release/3.0.x) dropwizard/dropwizard#7891
- fix(deps): update dependency org.liquibase:liquibase-core to v4.25.0 (release/4.0.x) dropwizard/dropwizard#7896
Are you willing to submit a PR?
- I'm willing to submit a PR (Thank you!)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done
Activity
filipelautert commentedon Nov 16, 2023
@joschi you are right, this change really broke the API and we will need to fix it. Meanwhile, would you mind switching to the new command framework that is used by this method? You could replace the method being called by:
We will get it fixed for the next release.
tati-qalified commentedon Nov 21, 2023
Hi @joschi, the fix is completed and will be added to the next release. Thank you for reporting the issue!