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
Null Pointer Exception During Diff Change Log Generation #2152
Comments
Hi @coylecullen Thanks for writing up this issue. The only thing I can think of based on the stack trace provided is that there may be some invalid characters in a column comment. |
I was doing some investigation and one of my colleagues pointed this out: liquibase/liquibase-core/src/main/java/liquibase/sqlgenerator/core/SetColumnRemarksGenerator.java Line 50 in 108e689
We noticed within the SetColumnRemarksStatement constructor, the ColumnDataType gets set to null. liquibase/liquibase-core/src/main/java/liquibase/statement/core/SetColumnRemarksStatement.java Line 15 in f10ba74
So when the order of calls goes down the line, its calling: Do you know why this gets set to null upon object creation? Not ruling out an invalid character in comments but I think this may be the source of the NPE (I've been digging around those trying to see if theres anything obvious but working with thousands of columns, it's a little hard to pin point which table could be causing invalid characters). If there is anything I'm missing please let me know! Thanks for your help |
I get this NPE too ! |
…ge Log Generation
Created a PR for my potential fix: #2188 this did get rid of the NPE and I was able to complete my diff change log generation. There might be a bigger issue because I can't see why this alter statement is getting hit from the beginning (Both tables look exactly the same to me) but I guess thats for a separate discussion. |
This idea was incorrect but the issue of the database type being null was the cause of the NPE. From what I saw, there was no reference to that constructor in the liquibase repo. |
Thanks for chasing this down. We will look into what is setting this to null and most likely changing it. |
I'm going to close this issue because the actual null pointer was fixed in #942 or other changes in later releases. I'm not able to replicate the null pointer exception with the current code. BUT: I was able to see a problem that while the null pointer you were seeing has been addressed by a check to ensure the needed columnDataType attribute is set, it will just move you onto a getting a validation error from the generated changeset vs. a null pointer exception. " Pull request #2188 handles generating the changelog correctly and we'll get that merged in, but since this is a different problem I'll still close this as "already fixed". If anyone is still seeing this null pointer exception in 4.6.2+, give me more details on how you could reproduce it so we can look more at that problem. |
Liquibase Version:
Database Vendor & Version:
mysql Ver 8.0.21 for macos10.15 on x86_64 (MySQL Community Server - GPL)
Operating System Type & Version:
MacOS Big Sur Version 11.4
Description
I'm experiencing a NPE when trying to generate a mysql.sql diffChangeLog file. I'm testing against multiple profiles and I can confirm that against a different profile, this exception doesn't get thrown. However, this other profile throws the exception.
Steps To Reproduce
I ran
mvn resources:resources liquibase:diff -Pqa
The Configuration for the Diff changelog generation that threw the NPE:
liquibase.properties:
Profile:
I'm comparing two databases directly so I'm not using any snapshots for the diff change log generation.
Actual Behavior
The text was updated successfully, but these errors were encountered: