billow icon indicating copy to clipboard operation
billow copied to clipboard

ElassticSearchCluster NullPointerException when there's no ES clusters available.

Open ghuang0570 opened this issue 4 years ago • 0 comments

Version: 2.20

Pretty sure this bug is caused by not null checking this line: https://github.com/airbnb/billow/blob/master/src/main/java/com/airbnb/billow/ElasticsearchCluster.java#L49

getDedicatedMasterCount() returns Integer object and could be null, so we need to do a null check before assigning to int, otherwise you will see this:

05:37:39.425 [main] ERROR com.airbnb.billow.Main - Failure in main thread, getting out!
java.lang.NullPointerException: null
	at com.airbnb.billow.ElasticsearchCluster.<init>(ElasticsearchCluster.java:49) ~[billow-2.20.jar:na]
	at com.airbnb.billow.AWSDatabase.<init>(AWSDatabase.java:221) ~[billow-2.20.jar:na]
	at com.airbnb.billow.AWSDatabaseHolder.rebuild(AWSDatabaseHolder.java:128) ~[billow-2.20.jar:na]
	at com.airbnb.billow.AWSDatabaseHolder.<init>(AWSDatabaseHolder.java:124) ~[billow-2.20.jar:na]
	at com.airbnb.billow.Main.<init>(Main.java:53) ~[billow-2.20.jar:na]
	at com.airbnb.billow.Main.main(Main.java:130) ~[billow-2.20.jar:na]

Also please audit other similar handling as billow is pretty brittle when some assumptions are not met, eg, there needs to be a user IAM role in an account, there needs to be a RDS/Aurora cluster in the account.

ghuang0570 avatar May 20 '20 17:05 ghuang0570