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
liquibase update fails for DB2 in version 4.7.0 #2360
Comments
Hi @MarcusZander-SPayment Thanks for posting this issue. What version of DB2 on Linux are you running? And can you add a loglevel=FINE based log for us to use to possibly figure out what is causing this issue? |
@molivasdat We are using DB2 v11.1.4.6 = Version 11.1 Fixpack 6 on Linux. The first error is "Cannot check pg_settings" because the Table PG_SETTINGS doesn't exist. (It was not nessesary until now) Are there migration steps to take from 4.6.2 to 4.7 that we missed? |
I see the problem. If your hostname or database has an "edb" in it, our logic for detecting EnterpriseDB is to broad. This is fixed by #2364 |
I added a work-around to the PR's description |
@nvoxland Thank you for the workaround setting the database dialect, but it does not work for us. Using the liquibase-gradle-plugin this can also be done this way: liquibase { That solves the problem for calling liquibase from the gradle build. |
@MarcusZander-SPayment release v.4.7.1 is out now and the fix to this is included. Thanks! |
Thank you guys for your time and the quick sollution! |
You are most welcome! By the way, @MarcusZander-SPayment if you have ideas you'd like to see implemented, please check out the post here in the forum and we'd love to see you at the next Meetup on Feb 10 to talk more about future planning. |
Environment
Liquibase Version: 4.7.0
Liquibase Integration & Version: gradle
Liquibase Extension(s) & Version:
Database Vendor & Version: IBM DB2 11 (Linux)
Operating System Type & Version: Windows 10
Description
Since the update of liquibase to 4.7.0 in our gradle build these liquibase-gradle tasks throw the same error: update, updateTestingRollback, rollBackCount against DB2. diffChangeLog is working, other where not tested/used.
There was no change to the changeset or build-script. The only thing that changed is the liquibase version (4.6.2 worked fine)
Liquibase is not able to determine the default schema. These messages appear:
The problem is: Liquibase tries to read from a table PG_SETTINGS which does not exist. Googling yields that this table belongs to PosgreSQL databases, but we use IBM DB2, so I suppose our database is wrongly classified as a PosgreSQL.
See "Actual Behavior" for the log.
Steps To Reproduce
gradlew update
or
gradlew updateTestingRollback
or
gradlew rollbackCount -PliquibaseCommandValue=1
or
starting a spring-boot-application with liquibase enabled against DB2
Actual Behavior
The tasks update/updateTestingRollback/rollbackCount fail very early before even one changeset ran. This is reproducable for version 4.7.0 and not for 4.6.2 (working)
Here is the Log:
`
[2022-01-12 12:29:09] INFORMATION [liquibase.database] Cannot check pg_settings
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=REDACTED.PG_SETTINGS, DRIVER=4.25.13
at com.ibm.db2.jcc.am.b6.a(b6.java:810)
at com.ibm.db2.jcc.am.b6.a(b6.java:66)
at com.ibm.db2.jcc.am.b6.a(b6.java:140)
at com.ibm.db2.jcc.am.k3.c(k3.java:2824)
at com.ibm.db2.jcc.am.k3.d(k3.java:2808)
at com.ibm.db2.jcc.am.k3.a(k3.java:2234)
at com.ibm.db2.jcc.t4.ab.i(ab.java:206)
at com.ibm.db2.jcc.t4.ab.b(ab.java:96)
at com.ibm.db2.jcc.t4.p.a(p.java:32)
at com.ibm.db2.jcc.t4.av.i(av.java:150)
at com.ibm.db2.jcc.am.k3.al(k3.java:2203)
at com.ibm.db2.jcc.am.k3.a(k3.java:3330)
at com.ibm.db2.jcc.am.k3.a(k3.java:737)
at com.ibm.db2.jcc.am.k3.executeQuery(k3.java:716)
at liquibase.database.core.PostgresDatabase.setConnection(PostgresDatabase.java:176)
at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:121)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:141)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:92)
at liquibase.integration.commandline.Main.doMigration(Main.java:1517)
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)
at liquibase.integration.commandline.Main$1.run(Main.java:221)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.Main.run(Main.java:221)
at liquibase.integration.commandline.Main.main(Main.java:164)
[2022-01-12 12:29:09] INFORMATION [liquibase.database] Error getting default schema
liquibase.exception.DatabaseException: Error executing SQL select current_schema(): DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=END-OF-STATEMENT;ect current_schema();<table_expr>, DRIVER=4.25.13
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:126)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:161)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:172)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:180)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:195)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:190)
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:365)
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:325)
at liquibase.changelog.ChangeLogParameters.(ChangeLogParameters.java:61)
at liquibase.Liquibase.(Liquibase.java:119)
at liquibase.integration.commandline.Main.doMigration(Main.java:1677)
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)
at liquibase.integration.commandline.Main$1.run(Main.java:221)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.Main.run(Main.java:221)
at liquibase.integration.commandline.Main.main(Main.java:164)
`
Expected/Desired Behavior
Liquibase should determine the schema on DB2 like it could in version 2.6.2 so that the tasks update/updateTestingRollback... can be used again.
Additional Context
We use liquibase integrated with gradle on our delevopment-PCs against a DB2 on Linux. The problem occured while starting a spring-boot-app wich uses the auto-update-feature from liquibase and is reproducible (see above) on the gradle command line. (Liquibase-CLI was not tested)
The text was updated successfully, but these errors were encountered: