liquibase: java.lang.NullPointerException during DIFF operation
Liquibase Version
Starting Liquibase at 14:54:49 (version 4.2.2 #36 built at 2020-12-09 20:07+0000)
Liquibase Version: 4.2.2
Liquibase Community 4.2.2 by Datical
Running Java under /usr/lib/jvm/java-11-openjdk-amd64 (Version 11.0.9.1)
Command to generate snapshot
liquibase \
--driver=org.postgresql.Driver \
--classpath=postgresql-42.2.18.jar \
--url="jdbc:postgresql://$SQL_IP/$SQL_DATABASE" \
--username="$SQL_USERNAME" \
--password="$SQL_PASSWORD" \
--changeLogFile="$CHANGELOG_MASTER_FILE" \
--liquibaseSchemaName=$SQL_LIQUIBASE_SCHEMA \
--defaultSchemaName=$SQL_APPLICATION_SCHEMA \
--contexts=$ENVIRONMENT \
--outputFile="$STATUS_LOG_FOLDER/snapshot.after.json" \
snapshot \
--snapshotFormat=json
Command to generate diff
liquibase \
--driver=org.postgresql.Driver \
--classpath=postgresql-42.2.18.jar \
--url="offline:postgresql?snapshot=$STATUS_LOG_FOLDER/snapshot.before.json" \
--referenceUrl="jdbc:postgresql://$SQL_IP/$SQL_DATABASE" \
--referenceusername="$SQL_USERNAME" \
--referencepassword="$SQL_PASSWORD" \
--referenceDefaultSchemaName=$SQL_APPLICATION_SCHEMA \
--liquibaseSchemaName=$SQL_LIQUIBASE_SCHEMA \
--contexts=$ENVIRONMENT \
--outputFile="$STATUS_LOG_FOLDER/diff.txt" \
diff
Thsi is the error I’m getting when launching DIFF command
[2021-01-15 14:53:41] FINE [liquibase.servicelocator] Loaded liquibase.diff.DiffGenerator instance liquibase.diff.core.StandardDiffGenerator
Unexpected error running Liquibase: java.lang.NullPointerException
For more information, please use the --logLevel flag
[2021-01-15 14:53:41] SEVERE [liquibase.integration] Unexpected error running Liquibase: java.lang.NullPointerException
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.NullPointerException
at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:173)
at liquibase.integration.commandline.Main.doMigration(Main.java:1480)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:361)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Scope.child(Scope.java:226)
at liquibase.integration.commandline.Main$1.run(Main.java:360)
at liquibase.integration.commandline.Main$1.run(Main.java:193)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:193)
at liquibase.integration.commandline.Main.main(Main.java:156)
Caused by: liquibase.command.CommandExecutionException: java.lang.NullPointerException
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)
at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:171)
... 14 more
Caused by: java.lang.NullPointerException
at liquibase.diff.compare.core.IndexComparator$1.areEqual(IndexComparator.java:123)
at liquibase.diff.ObjectDifferences.compare(ObjectDifferences.java:70)
at liquibase.diff.ObjectDifferences.compare(ObjectDifferences.java:50)
at liquibase.diff.compare.core.IndexComparator.findDifferences(IndexComparator.java:113)
at liquibase.diff.compare.DatabaseObjectComparatorChain.findDifferences(DatabaseObjectComparatorChain.java:99)
at liquibase.diff.compare.DatabaseObjectComparatorFactory.findDifferences(DatabaseObjectComparatorFactory.java:166)
at liquibase.diff.core.StandardDiffGenerator.compareObjectType(StandardDiffGenerator.java:90)
at liquibase.diff.core.StandardDiffGenerator.compare(StandardDiffGenerator.java:52)
at liquibase.diff.DiffGeneratorFactory.compare(DiffGeneratorFactory.java:107)
at liquibase.command.core.DiffCommand.createDiffResult(DiffCommand.java:152)
at liquibase.command.core.DiffCommand.run(DiffCommand.java:136)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:19)
... 15 more
Testing Criteria
This needs to be tested against AWS Aurora PostgreSQL 10.11 compatible.
Source Line: IndexComparator.java:123
I added the logLevel=DEBUG as suggested, but besided having the stacktrace I’m not getting additional information.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (5 by maintainers)
Hi, my does not have computed column indexes. Right now I’m simply waiting a reply in this issue for the resolution, for the moment I disabled the snapshot part in my script