Liquibase diffChangeLog fails with NullPointerException

Hello! I am not sure where should I report my problem:
I am trying to use liquibase in our project in Oracle 11.2 database.
We have relatively big schema with more then 3000 objects.
So, I installed liquibase 4.6.2
then,

  1. I run liquibase generateChangeLog
  2. I then I issued changeLogSync
  3. then I created snapshot:
    liquibase --outputFile=mySnapshot.json snapshot --snapshotFormat=json
  4. then I added few changes directly in my schema (added new test table)
  5. then I run diffChangeLog to check, that it will detect these changes in schema.
    liquibase --referenceUrl=jdbc:oracle:thin:@my-server:1521/MY_SID --referenceUsername=MY_SCHEMA --referencePassword=MY_PASSWORD --url=offline:oracle?snapshot=mySnapshot.json --changeLogFile=mydiffchangelog.xml diffChangeLog
    But it fails with following exception
    ====
    Picked up JAVA_TOOL_OPTIONS: -Dfile.enconding=UTF-8
    ####################################################

_ _ _ _

| | () () |

| | _ __ _ _ _ | |_ __ _ ___ ___

| | | |/ _ | | | | | '_ \ / _ / __|/ _ \

| || | (| | || | | |) | (| _ \ __/

_/|_, |_,||./ _,|/__|

| |

|_|

Get documentation at docs.liquibase.com

Get certified courses at learn.liquibase.com

Free schema change activity reports at

####################################################
Starting Liquibase at 02:11:21 (version 4.6.2 #886 built at 2021-11-30 16:20+0000)
Liquibase Version: 4.6.2
Liquibase Community 4.6.2 by Liquibase
BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed.
[2022-01-09 02:11:38] SEVERE [liquibase.integration] java.lang.NullPointerException
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.command.CommandScope.execute(CommandScope.java:156)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:45)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:15)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:325)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:162)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:291)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:80)
Caused by: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.integration.commandline.Main$1.run(Main.java:443)
at liquibase.integration.commandline.Main$1.run(Main.java:221)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:162)
at liquibase.integration.commandline.Main.run(Main.java:221)
at liquibase.command.AbstractCliWrapperCommandStep.run(AbstractCliWrapperCommandStep.java:32)
at liquibase.command.CommandScope.execute(CommandScope.java:150)
… 14 more
Caused by: liquibase.exception.LiquibaseException: liquibase.exception.CommandExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:220)
at liquibase.integration.commandline.Main.doMigration(Main.java:1601)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398)
at liquibase.Scope.lambda$child$0(Scope.java:177)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:176)
at liquibase.Scope.child(Scope.java:155)
at liquibase.integration.commandline.Main$1.run(Main.java:397)
… 20 more
Caused by: liquibase.exception.CommandExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.command.CommandScope.execute(CommandScope.java:156)
at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:218)
… 27 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:199)
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:85)
at liquibase.command.core.InternalDiffChangelogCommandStep.run(InternalDiffChangelogCommandStep.java:61)
at liquibase.command.CommandScope.execute(CommandScope.java:150)
… 28 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.diff.output.changelog.DiffToChangeLog$1.run(DiffToChangeLog.java:182)
at liquibase.Scope.lambda$child$0(Scope.java:177)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:176)
at liquibase.Scope.child(Scope.java:155)
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:127)
… 31 more
Caused by: java.lang.NullPointerException
at liquibase.diff.output.changelog.core.ChangedIndexChangeGenerator$1.toString(ChangedIndexChangeGenerator.java:117)
at liquibase.diff.output.changelog.core.ChangedIndexChangeGenerator$1.toString(ChangedIndexChangeGenerator.java:114)
at liquibase.util.StringUtil.join(StringUtil.java:319)
at liquibase.diff.output.changelog.core.ChangedIndexChangeGenerator.fixChanged(ChangedIndexChangeGenerator.java:122)
at liquibase.diff.output.changelog.ChangeGeneratorChain.fixChanged(ChangeGeneratorChain.java:137)
at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixChanged(ChangeGeneratorFactory.java:118)
at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:274)
at liquibase.diff.output.changelog.DiffToChangeLog.printNew(DiffToChangeLog.java:222)
at liquibase.diff.output.changelog.DiffToChangeLog$1.run(DiffToChangeLog.java:133)
… 36 more

Unexpected error running Liquibase: java.lang.NullPointerException

liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.command.CommandScope.execute(CommandScope.java:156)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:45)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:15)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:325)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:162)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:291)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:80)
Caused by: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.integration.commandline.Main$1.run(Main.java:443)
at liquibase.integration.commandline.Main$1.run(Main.java:221)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:162)
at liquibase.integration.commandline.Main.run(Main.java:221)
at liquibase.command.AbstractCliWrapperCommandStep.run(AbstractCliWrapperCommandStep.java:32)
at liquibase.command.CommandScope.execute(CommandScope.java:150)
… 14 more
Caused by: liquibase.exception.LiquibaseException: liquibase.exception.CommandExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:220)
at liquibase.integration.commandline.Main.doMigration(Main.java:1601)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398)
at liquibase.Scope.lambda$child$0(Scope.java:177)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:176)
at liquibase.Scope.child(Scope.java:155)
at liquibase.integration.commandline.Main$1.run(Main.java:397)
… 20 more
Caused by: liquibase.exception.CommandExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.command.CommandScope.execute(CommandScope.java:156)
at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:218)
… 27 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:199)
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:85)
at liquibase.command.core.InternalDiffChangelogCommandStep.run(InternalDiffChangelogCommandStep.java:61)
at liquibase.command.CommandScope.execute(CommandScope.java:150)
… 28 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at liquibase.diff.output.changelog.DiffToChangeLog$1.run(DiffToChangeLog.java:182)
at liquibase.Scope.lambda$child$0(Scope.java:177)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:176)
at liquibase.Scope.child(Scope.java:155)
at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:127)
… 31 more
Caused by: java.lang.NullPointerException
at liquibase.diff.output.changelog.core.ChangedIndexChangeGenerator$1.toString(ChangedIndexChangeGenerator.java:117)
at liquibase.diff.output.changelog.core.ChangedIndexChangeGenerator$1.toString(ChangedIndexChangeGenerator.java:114)
at liquibase.util.StringUtil.join(StringUtil.java:319)
at liquibase.diff.output.changelog.core.ChangedIndexChangeGenerator.fixChanged(ChangedIndexChangeGenerator.java:122)
at liquibase.diff.output.changelog.ChangeGeneratorChain.fixChanged(ChangeGeneratorChain.java:137)
at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixChanged(ChangeGeneratorFactory.java:118)
at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:274)
at liquibase.diff.output.changelog.DiffToChangeLog.printNew(DiffToChangeLog.java:222)
at liquibase.diff.output.changelog.DiffToChangeLog$1.run(DiffToChangeLog.java:133)
… 36 more

I tried set different log-levels, but didn’t get any useful info.
I can upload log file
Best regards
Boris

Hi @bglazyrin!

We’d like to hear more about this problem to see if we can reproduce and help. Could you open a New Issue in GitHub and upload any supporting logs? This will help us have all of the information so we can troubleshoot.

Thanks!

-Kevin

Hi @kevin
Thanks for link on GitHub. I’ve created the issue #2373
Unfortunately I don’t know what to add to my initial post. Even debug output doesn’t have info what index caused problem.
I hope somebody can inspect source code, that caused NPE and find a bug.
Thanks,
Boris