Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precondition-sql-check raises liquibase.exception.ChangeLogParseException #2918

Closed
Alenichel opened this issue Jun 6, 2022 · 4 comments
Closed

Comments

@Alenichel
Copy link

Environment

Liquibase Version: 4.11.0

Liquibase Integration & Version: CLI

Liquibase Extension(s) & Version:

Database Vendor & Version: Any

Operating System Type & Version: MacOS 12.0.1

Description

Any SQL changeset with a precondition-sql-check fails

Steps To Reproduce

  • Create a SQL changeset with a precondition-sql-check and run any CLI commands (e.g. liquibase update or liquibase status)

Actual Behavior

Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Unexpected formatting at line 846. Formatted SQL changelogs require known formats, such as '--property name=<property name> value=<property value>' and others to be recognized and run. Learn all the options at https://docs.liquibase.com/concepts/changelogs/sql-format.html at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:369) at liquibase.Liquibase.lambda$update$1(Liquibase.java:224) at liquibase.Scope.lambda$child$0(Scope.java:180) at liquibase.Scope.child(Scope.java:189) at liquibase.Scope.child(Scope.java:179) at liquibase.Scope.child(Scope.java:158) at liquibase.Liquibase.runInScope(Liquibase.java:2405) at liquibase.Liquibase.update(Liquibase.java:211) at liquibase.Liquibase.update(Liquibase.java:197) at liquibase.integration.commandline.Main.doMigration(Main.java:1869) at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398) at liquibase.Scope.lambda$child$0(Scope.java:180) at liquibase.Scope.child(Scope.java:189) at liquibase.Scope.child(Scope.java:179) at liquibase.Scope.child(Scope.java:158) at liquibase.integration.commandline.Main$1.run(Main.java:397) ... 24 more

The line referred in the error message is the third line of the following changeset causing the issue:

-- changeset author:name context:XXX
-- preConditions onFail:MARK_RAN onError:MARK_RAN
-- precondition-sql-check expectedResult:0 SELECT COUNT(*) from TABLE where CODE = 'CODE'
INSERT INTO TABLE (ID, CODE, DESCRIPTION) VALUES (SEQ_NAME.nextVal, 'CODE', 'DESCRIPTION');

This changeset, and all other affected, had always run until now (before updating to 4.11.0 fro 4.9.1) and it seems to me that they strictly follow the example available at:
https://docs.liquibase.com/concepts/changelogs/sql-format.html

Expected/Desired Behavior

The error is no more raised

@kataggart kataggart added this to To Do in Conditioning++ via automation Jun 6, 2022
@vcotugno
Copy link

vcotugno commented Jun 7, 2022

Same here on Windows 10/11.
Latest version working with precondition-sql-check is 4.9.1

@NorisM96
Copy link

NorisM96 commented Jun 8, 2022

Same here on Linux on latest liquibase version, had to revert to previous version

@nvoxland
Copy link
Contributor

nvoxland commented Aug 3, 2022

I think this was fixed by #3037 in 4.14.0. I can't replicate the problem with the current build.

@nvoxland nvoxland closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2022
Conditioning++ automation moved this from To Do to Done Aug 3, 2022
@vcotugno
Copy link

vcotugno commented Aug 4, 2022

i can confirm that the issue is fixed as of release 4.14.0, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants