Unexpected error running Liquibase: java.lang.RuntimeException: java.lang.NullPointerException

I’ll take a look - what version of liquibase are you using? What database? It appears you are running the generateChangelog command - is that correct?

Steve Donie
Principal Software Engineer
Liquibase Community Engagement
Datical, Inc. http://www.datical.com/

Looking at the stack trace, I see "REFERENCED_NAME like ‘public.%’ " so I am guessing the database is PostgreSQL. 

Steve Donie
Principal Software Engineer
Liquibase Community Engagement
Datical, Inc. http://www.datical.com/

We have done testing of this command on PostgresSQL, so in general it should work. I am guessing that there is something specific about your database schema that is causing this issue. 

The code in question can be seen at https://github.com/liquibase/liquibase/blob/37e895a5696cfccf9da90d819cce62e956f2548f/liquibase-core/src/main/java/liquibase/diff/output/changelog/DiffToChangeLog.java#L634-L642

That code is looking at dependencies in the postgres objects - things like foreign keys that relate two things together. It may be that you have foreign keys in your schema that reference tables in different schemas, and the issue is that when generating the changelog, Liquibase is not gathering all the information needed for the different schemas. 

Without more details about your schema, it will be difficult to diagnose further. 

Steve Donie
Principal Software Engineer
Liquibase Community Engagement
Datical, Inc. http://www.datical.com/

Agreed. Do you have the ability to build and use a locally-built version of Liquibase? If so, I can help you add some debugging statements. Otherwise, I would need to have access to your database. 

Steve Donie
Principal Software Engineer
Liquibase Community Engagement
Datical, Inc. http://www.datical.com/

Hello.

I been unable to use liqubase, it throws this java.lang.NullPointerException error when used, it is a big DB with 836 tables so that maybe has something to do with it.

... 10 common frames omitted
Thanks

Postgres 9.6, liquibase 3.8.5; running this command on local database


/liquibase --driver=org.postgresql.Driver --classpath=./postgresql-9.4.1211.jre6.jar --url=“jdbc:postgresql://localhost:5432/BBLEARN_GIT” --changeLogFile=db.changelog-1.0.xml --username=postgres --password=postgres --logLevel=DEBUG  generateChangeLog

When started in log:DEBUG mode it would be nice if liquibase could give me at least a clue of where things went wrong, the column name, or the table name.