GreenfieldTech / lambda-route53-updates

Java AWS Lambda package that receives notifications to update Route53 records
http://www.greenfieldtech.net/open-source/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

NPE on ASG notifications #6

Open dpeterka opened 5 years ago

dpeterka commented 5 years ago

Nice tool!

I tried setting this up today and it works fine with lifecycle hooks but whilst trying with the same lambda setup using asg notifications I geta null pointer:

Unexpected error while updating Route53: java.lang.NullPointerException

Here's the payload sent:

Got message: {Progress=50, AccountId=915488707193, Description=Terminating EC2 instance: i-00a1ef1c106815860, RequestId=a7813cd0-737d-4972-bc84-03f3b20a95e9, EndTime=2018-11-14T21:55:29.387Z, AutoScalingGroupARN=arn:aws:autoscaling:us-west-2:915488707193:autoScalingGroup:faf042d1-18c2-4b39-a073-3c34b57da954:autoScalingGroupName/elasticsearch_test0_20185_ami-0a3789f9bcf884e20, ActivityId=a7813cd0-737d-4972-bc84-03f3b20a95e9, StartTime=2018-11-14T21:54:46.639Z, Service=AWS Auto Scaling, Time=2018-11-14T21:55:29.387Z, EC2InstanceId=i-00a1ef1c106815860, StatusCode=InProgress, StatusMessage=, Details={Subnet ID=subnet-4e7d4116, Availability Zone=us-west-2c}, AutoScalingGroupName=elasticsearch_test0_20185_ami-0a3789f9bcf884e20, Cause=At 2018-11-14T21:54:33Z a user request update of AutoScalingGroup constraints to min: 2, max: 2, desired: 2 changing the desired capacity from 3 to 2. At 2018-11-14T21:54:46Z an instance was taken out of service in response to a difference between desired and actual capacity, shrinking the capacity from 3 to 2. At 2018-11-14T21:54:46Z instance i-00a1ef1c106815860 was selected for termination., Event=autoscaling:EC2_INSTANCE_TERMINATE}

Let me know if I can provide you anymore info.

guss77 commented 5 years ago

Hi @dpeterka, thanks for letting me know.

Is it possible to get the entire stack trace from that exception?

dpeterka commented 5 years ago

@guss77 I setup with DEBUG=true but the sum of CloudWatch log output only includes the one line (https://www.screencast.com/t/4uVcTggvKg). I'm not sure how to to collect any more output via lambda.

guss77 commented 5 years ago

Well, obviously there's a bug with the lambda not displaying the stack trace :smile:

I've pushed a new version - 2.2.0, which should help you as it includes better parsing, error handling and logging.

Also, you might want to compare your setup to the sample templates that are now included.

Please let me know if that solved the issue or not.