{"action":"created","issue":{"url":"https://api.github.com/repos/rochacon/elastic-nginx/issues/6","labels_url":"https://api.github.com/repos/rochacon/elastic-nginx/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/rochacon/elastic-nginx/issues/6/comments","events_url":"https://api.github.com/repos/rochacon/elastic-nginx/issues/6/events","html_url":"https://github.com/rochacon/elastic-nginx/issues/6","id":57079762,"number":6,"title":"issue with getInstance?","user":{"login":"yudelevi","id":4537920,"avatar_url":"https://avatars.githubusercontent.com/u/4537920?v=3","gravatar_id":"","url":"https://api.github.com/users/yudelevi","html_url":"https://github.com/yudelevi","followers_url":"https://api.github.com/users/yudelevi/followers","following_url":"https://api.github.com/users/yudelevi/following{/other_user}","gists_url":"https://api.github.com/users/yudelevi/gists{/gist_id}","starred_url":"https://api.github.com/users/yudelevi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yudelevi/subscriptions","organizations_url":"https://api.github.com/users/yudelevi/orgs","repos_url":"https://api.github.com/users/yudelevi/repos","events_url":"https://api.github.com/users/yudelevi/events{/privacy}","received_events_url":"https://api.github.com/users/yudelevi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-09T19:45:59Z","updated_at":"2015-02-12T04:47:09Z","closed_at":"2015-02-12T04:46:24Z","body":"Looks like some incompatibility with ec2 instance pull (below are both scale up and down)\r\n\r\n2015/02/09 19:34:34 Listening on 0.0.0.0:4444\r\n2015/02/09 19:34:34 Monitoring events on topic: arn:aws:sns:us-east-1:redacted:prod-webapp-scale\r\n2015/02/09 19:34:34 AWS Region: us-east-1\r\n2015/02/09 19:34:34 Upstream 0: prod_webapp_scale\r\n2015/02/09 19:34:34   ContainerFolder: /etc/nginx/upstream.d/scale\r\n2015/02/09 19:34:34   File: /etc/nginx/upstream.d/prod_webapp_scale.upstreams\r\n2015/02/09 19:35:27 Received Payload: {\r\n  \"Type\" : \"Notification\",\r\n  \"MessageId\" : \"a355ffa9-f2f5-57ac-b383-b2fafcb7b183\",\r\n  \"TopicArn\" : \"arn:aws:sns:us-east-1:redacted:aws_scale_prod\",\r\n  \"Subject\" : \"Auto Scaling: launch for group \\\"prod-webapp-scale\\\"\",\r\n  \"Message\" : \"{\\\"StatusCode\\\":\\\"InProgress\\\",\\\"Service\\\":\\\"AWS Auto Scaling\\\",\\\"AutoScalingGroupName\\\":\\\"prod-webapp-scale\\\",\\\"Description\\\":\\\"Launching a new EC2 instance: i-3d9bcecc\\\",\\\"ActivityId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"Event\\\":\\\"autoscaling:EC2_INSTANCE_LAUNCH\\\",\\\"Details\\\":{\\\"Availability Zone\\\":\\\"us-east-1e\\\"},\\\"AutoScalingGroupARN\\\":\\\"scalegroup-redacted\\\",\\\"Progress\\\":50,\\\"Time\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"AccountId\\\":\\\"1234\\\",\\\"RequestId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"StatusMessage\\\":\\\"\\\",\\\"EndTime\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"EC2InstanceId\\\":\\\"i-3d9bcecc\\\",\\\"StartTime\\\":\\\"2015-02-09T19:34:57.170Z\\\",\\\"Cause\\\":\\\"At 2015-02-09T19:34:51Z a user request executed policy Increase Group Size changing the desired capacity from 1 to 2.  At 2015-02-09T19:34:55Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 1 to 2.\\\"}\",\r\n  \"Timestamp\" : \"2015-02-09T19:35:30.188Z\",\r\n  \"SignatureVersion\" : \"1\",\r\n  \"Signature\" : \"redacted\",\r\n  \"SigningCertURL\" : \"https://sns.us-east-1.amazonaws.com/redacted.pem\",\r\n  \"UnsubscribeURL\" : \"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:redacted\"\r\n}\r\n2015/02/09 19:35:27 http: panic serving 54.239.98.166:22456: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 20 [running]:\r\nnet/http.funcÂ·011()\r\n        /usr/lib/go/src/pkg/net/http/server.go:1100 +0xb7\r\nruntime.panic(0x6d95a0, 0x8bbb13)\r\n        /usr/lib/go/src/pkg/runtime/panic.c:248 +0x18d\r\ngopkg.in/amz.v1/ec2.(*EC2).query(0xc2080560c0, 0xc2080255c0, 0x633de0, 0xc2080255f0, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:146 +0x5af\r\ngopkg.in/amz.v1/ec2.(*EC2).Instances(0xc2080560c0, 0x7f01b9d17228, 0x1, 0x1, 0x0, 0xc2080255f0, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:543 +0x10f\r\nmain.getInstance(0xc208038e36, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:126 +0x172\r\nmain.launch(0x7f01b9ed7bb0, 0xc208052460, 0x0, 0xc20804e630, 0x87, 0xc208024de0, 0x25, 0xc208040240, 0x3b, 0xc20800e580, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:235 +0x61\r\nmain.readMessage(0x7f01b9ed7bb0, 0xc208052460, 0xc208000820)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:215 +0xae5\r\nnet/http.HandlerFunc.ServeHTTP(0x7b09a0, 0x7f01b9ed7bb0, 0xc208052460, 0xc208000820)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40\r\nnet/http.(*ServeMux).ServeHTTP(0xc2080246c0, 0x7f01b9ed7bb0, 0xc208052460, 0xc208000820)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1511 +0x1a3\r\nnet/http.serverHandler.ServeHTTP(0xc2080043c0, 0x7f01b9ed7bb0, 0xc208052460, 0xc208000820)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f\r\nnet/http.(*conn).serve(0xc208050400)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e\r\ncreated by net/http.(*Server).Serve\r\n        /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313\r\n2015/02/09 19:35:58 Received Payload: {\r\n  \"Type\" : \"Notification\",\r\n  \"MessageId\" : \"a355ffa9-f2f5-57ac-b383-b2fafcb7b183\",\r\n  \"TopicArn\" : \"arn:aws:sns:us-east-1:redacted:aws_scale_prod\",\r\n  \"Subject\" : \"Auto Scaling: launch for group \\\"prod-webapp-scale\\\"\",\r\n  \"Message\" : \"{\\\"StatusCode\\\":\\\"InProgress\\\",\\\"Service\\\":\\\"AWS Auto Scaling\\\",\\\"AutoScalingGroupName\\\":\\\"prod-webapp-scale\\\",\\\"Description\\\":\\\"Launching a new EC2 instance: i-3d9bcecc\\\",\\\"ActivityId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"Event\\\":\\\"autoscaling:EC2_INSTANCE_LAUNCH\\\",\\\"Details\\\":{\\\"Availability Zone\\\":\\\"us-east-1e\\\"},\\\"AutoScalingGroupARN\\\":\\\"scalegroup-redacted\\\",\\\"Progress\\\":50,\\\"Time\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"AccountId\\\":\\\"1234\\\",\\\"RequestId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"StatusMessage\\\":\\\"\\\",\\\"EndTime\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"EC2InstanceId\\\":\\\"i-3d9bcecc\\\",\\\"StartTime\\\":\\\"2015-02-09T19:34:57.170Z\\\",\\\"Cause\\\":\\\"At 2015-02-09T19:34:51Z a user request executed policy Increase Group Size changing the desired capacity from 1 to 2.  At 2015-02-09T19:34:55Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 1 to 2.\\\"}\",\r\n  \"Timestamp\" : \"2015-02-09T19:35:30.188Z\",\r\n  \"SignatureVersion\" : \"1\",\r\n  \"Signature\" : \"redacted\",\r\n  \"SigningCertURL\" : \"https://sns.us-east-1.amazonaws.com/redacted.pem\",\r\n  \"UnsubscribeURL\" : \"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:redacted\"\r\n}\r\n2015/02/09 19:35:58 http: panic serving 54.239.98.225:1363: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 21 [running]:\r\nnet/http.funcÂ·011()\r\n        /usr/lib/go/src/pkg/net/http/server.go:1100 +0xb7\r\nruntime.panic(0x6d95a0, 0x8bbb13)\r\n        /usr/lib/go/src/pkg/runtime/panic.c:248 +0x18d\r\ngopkg.in/amz.v1/ec2.(*EC2).query(0xc208056000, 0xc208025350, 0x633de0, 0xc208025380, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:146 +0x5af\r\ngopkg.in/amz.v1/ec2.(*EC2).Instances(0xc208056000, 0x7f01b9d17228, 0x1, 0x1, 0x0, 0xc208025380, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:543 +0x10f\r\nmain.getInstance(0xc208038cd6, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:126 +0x172\r\nmain.launch(0x7f01b9ed7bb0, 0xc208052140, 0x0, 0xc20804e630, 0x87, 0xc208024de0, 0x25, 0xc208040240, 0x3b, 0xc20800e580, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:235 +0x61\r\nmain.readMessage(0x7f01b9ed7bb0, 0xc208052140, 0xc208000270)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:215 +0xae5\r\nnet/http.HandlerFunc.ServeHTTP(0x7b09a0, 0x7f01b9ed7bb0, 0xc208052140, 0xc208000270)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40\r\nnet/http.(*ServeMux).ServeHTTP(0xc2080246c0, 0x7f01b9ed7bb0, 0xc208052140, 0xc208000270)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1511 +0x1a3\r\nnet/http.serverHandler.ServeHTTP(0xc2080043c0, 0x7f01b9ed7bb0, 0xc208052140, 0xc208000270)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f\r\nnet/http.(*conn).serve(0xc208050300)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e\r\ncreated by net/http.(*Server).Serve\r\n        /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313\r\n2015/02/09 19:36:31 Received Payload: {\r\n  \"Type\" : \"Notification\",\r\n  \"MessageId\" : \"a355ffa9-f2f5-57ac-b383-b2fafcb7b183\",\r\n  \"TopicArn\" : \"arn:aws:sns:us-east-1:redacted:aws_scale_prod\",\r\n  \"Subject\" : \"Auto Scaling: launch for group \\\"prod-webapp-scale\\\"\",\r\n  \"Message\" : \"{\\\"StatusCode\\\":\\\"InProgress\\\",\\\"Service\\\":\\\"AWS Auto Scaling\\\",\\\"AutoScalingGroupName\\\":\\\"prod-webapp-scale\\\",\\\"Description\\\":\\\"Launching a new EC2 instance: i-3d9bcecc\\\",\\\"ActivityId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"Event\\\":\\\"autoscaling:EC2_INSTANCE_LAUNCH\\\",\\\"Details\\\":{\\\"Availability Zone\\\":\\\"us-east-1e\\\"},\\\"AutoScalingGroupARN\\\":\\\"scalegroup-redacted\\\",\\\"Progress\\\":50,\\\"Time\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"AccountId\\\":\\\"1234\\\",\\\"RequestId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"StatusMessage\\\":\\\"\\\",\\\"EndTime\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"EC2InstanceId\\\":\\\"i-3d9bcecc\\\",\\\"StartTime\\\":\\\"2015-02-09T19:34:57.170Z\\\",\\\"Cause\\\":\\\"At 2015-02-09T19:34:51Z a user request executed policy Increase Group Size changing the desired capacity from 1 to 2.  At 2015-02-09T19:34:55Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 1 to 2.\\\"}\",\r\n  \"Timestamp\" : \"2015-02-09T19:35:30.188Z\",\r\n  \"SignatureVersion\" : \"1\",\r\n  \"Signature\" : \"reda\",\r\n  \"SigningCertURL\" : \"https://sns.us-east-1.amazonaws.com/redacted.pem\",\r\n  \"UnsubscribeURL\" : \"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:redacted\"\r\n}\r\n2015/02/09 19:36:31 http: panic serving 54.239.98.225:24888: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 22 [running]:\r\nnet/http.funcÂ·011()\r\n        /usr/lib/go/src/pkg/net/http/server.go:1100 +0xb7\r\nruntime.panic(0x6d95a0, 0x8bbb13)\r\n        /usr/lib/go/src/pkg/runtime/panic.c:248 +0x18d\r\ngopkg.in/amz.v1/ec2.(*EC2).query(0xc208056180, 0xc208025950, 0x633de0, 0xc208025980, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:146 +0x5af\r\ngopkg.in/amz.v1/ec2.(*EC2).Instances(0xc208056180, 0x7f01b9d17228, 0x1, 0x1, 0x0, 0xc208025980, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:543 +0x10f\r\nmain.getInstance(0xc2080390c6, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:126 +0x172\r\nmain.launch(0x7f01b9ed7bb0, 0xc208052640, 0x0, 0xc20804e630, 0x87, 0xc208024de0, 0x25, 0xc208040240, 0x3b, 0xc20800e580, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:235 +0x61\r\nmain.readMessage(0x7f01b9ed7bb0, 0xc208052640, 0xc208000a90)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:215 +0xae5\r\nnet/http.HandlerFunc.ServeHTTP(0x7b09a0, 0x7f01b9ed7bb0, 0xc208052640, 0xc208000a90)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40\r\nnet/http.(*ServeMux).ServeHTTP(0xc2080246c0, 0x7f01b9ed7bb0, 0xc208052640, 0xc208000a90)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1511 +0x1a3\r\nnet/http.serverHandler.ServeHTTP(0xc2080043c0, 0x7f01b9ed7bb0, 0xc208052640, 0xc208000a90)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f\r\nnet/http.(*conn).serve(0xc208050480)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e\r\ncreated by net/http.(*Server).Serve\r\n        /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313\r\n2015/02/09 19:36:55 Received Payload: {\r\n  \"Type\" : \"Notification\",\r\n  \"MessageId\" : \"a355ffa9-f2f5-57ac-b383-b2fafcb7b183\",\r\n  \"TopicArn\" : \"arn:aws:sns:us-east-1:redacted:aws_scale_prod\",\r\n  \"Subject\" : \"Auto Scaling: launch for group \\\"prod-webapp-scale\\\"\",\r\n  \"Message\" : \"{\\\"StatusCode\\\":\\\"InProgress\\\",\\\"Service\\\":\\\"AWS Auto Scaling\\\",\\\"AutoScalingGroupName\\\":\\\"prod-webapp-scale\\\",\\\"Description\\\":\\\"Launching a new EC2 instance: i-3d9bcecc\\\",\\\"ActivityId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"Event\\\":\\\"autoscaling:EC2_INSTANCE_LAUNCH\\\",\\\"Details\\\":{\\\"Availability Zone\\\":\\\"us-east-1e\\\"},\\\"AutoScalingGroupARN\\\":\\\"scalegroup-redacted\\\",\\\"Progress\\\":50,\\\"Time\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"AccountId\\\":\\\"1234\\\",\\\"RequestId\\\":\\\"585980d3-9899-460f-a3c6-241e56d96efd\\\",\\\"StatusMessage\\\":\\\"\\\",\\\"EndTime\\\":\\\"2015-02-09T19:35:30.044Z\\\",\\\"EC2InstanceId\\\":\\\"i-3d9bcecc\\\",\\\"StartTime\\\":\\\"2015-02-09T19:34:57.170Z\\\",\\\"Cause\\\":\\\"At 2015-02-09T19:34:51Z a user request executed policy Increase Group Size changing the desired capacity from 1 to 2.  At 2015-02-09T19:34:55Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 1 to 2.\\\"}\",\r\n  \"Timestamp\" : \"2015-02-09T19:35:30.188Z\",\r\n  \"SignatureVersion\" : \"1\",\r\n  \"Signature\" : \"redacted\",\r\n  \"SigningCertURL\" : \"https://sns.us-east-1.amazonaws.com/redacted.pem\",\r\n  \"UnsubscribeURL\" : \"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:redacted\"\r\n}\r\n2015/02/09 19:36:55 http: panic serving 54.239.98.33:56379: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 23 [running]:\r\nnet/http.funcÂ·011()\r\n        /usr/lib/go/src/pkg/net/http/server.go:1100 +0xb7\r\nruntime.panic(0x6d95a0, 0x8bbb13)\r\n        /usr/lib/go/src/pkg/runtime/panic.c:248 +0x18d\r\ngopkg.in/amz.v1/ec2.(*EC2).query(0xc208056000, 0xc208025080, 0x633de0, 0xc2080250b0, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:146 +0x5af\r\ngopkg.in/amz.v1/ec2.(*EC2).Instances(0xc208056000, 0x7f01b9d17228, 0x1, 0x1, 0x0, 0xc2080250b0, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:543 +0x10f\r\nmain.getInstance(0xc208038ae0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:126 +0x172\r\nmain.launch(0x7f01b9ed7bb0, 0xc208052820, 0x0, 0xc20804e630, 0x87, 0xc208024de0, 0x25, 0xc208040240, 0x3b, 0xc20800e580, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:235 +0x61\r\nmain.readMessage(0x7f01b9ed7bb0, 0xc208052820, 0xc208001380)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:215 +0xae5\r\nnet/http.HandlerFunc.ServeHTTP(0x7b09a0, 0x7f01b9ed7bb0, 0xc208052820, 0xc208001380)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40\r\nnet/http.(*ServeMux).ServeHTTP(0xc2080246c0, 0x7f01b9ed7bb0, 0xc208052820, 0xc208001380)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1511 +0x1a3\r\nnet/http.serverHandler.ServeHTTP(0xc2080043c0, 0x7f01b9ed7bb0, 0xc208052820, 0xc208001380)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f\r\nnet/http.(*conn).serve(0xc208050580)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e\r\ncreated by net/http.(*Server).Serve\r\n        /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313\r\n2015/02/09 19:37:07 Received Payload: {\r\n  \"Type\" : \"Notification\",\r\n  \"MessageId\" : \"6a95e502-961e-5e1f-a46d-a85198b84a93\",\r\n  \"TopicArn\" : \"arn:aws:sns:us-east-1:redacted:aws_scale_prod\",\r\n  \"Subject\" : \"Auto Scaling: termination for group \\\"prod-webapp-scale\\\"\",\r\n  \"Message\" : \"{\\\"StatusCode\\\":\\\"InProgress\\\",\\\"Service\\\":\\\"AWS Auto Scaling\\\",\\\"AutoScalingGroupName\\\":\\\"prod-webapp-scale\\\",\\\"Description\\\":\\\"Terminating EC2 instance: i-3d9bcecc\\\",\\\"ActivityId\\\":\\\"344f5ce7-8c02-4763-b431-df4cdaa5bb71\\\",\\\"Event\\\":\\\"autoscaling:EC2_INSTANCE_TERMINATE\\\",\\\"Details\\\":{\\\"Availability Zone\\\":\\\"us-east-1e\\\"},\\\"AutoScalingGroupARN\\\":\\\"scalegroup-redacted\\\",\\\"Progress\\\":50,\\\"Time\\\":\\\"2015-02-09T19:37:10.111Z\\\",\\\"AccountId\\\":\\\"1234\\\",\\\"RequestId\\\":\\\"344f5ce7-8c02-4763-b431-df4cdaa5bb71\\\",\\\"StatusMessage\\\":\\\"\\\",\\\"EndTime\\\":\\\"2015-02-09T19:37:10.111Z\\\",\\\"EC2InstanceId\\\":\\\"i-3d9bcecc\\\",\\\"StartTime\\\":\\\"2015-02-09T19:36:26.423Z\\\",\\\"Cause\\\":\\\"At 2015-02-09T19:36:23Z a user request executed policy Decrease Group Size changing the desired capacity from 2 to 1.  At 2015-02-09T19:36:26Z an instance was taken out of service in response to a difference between desired and actual capacity, shrinking the capacity from 2 to 1.  At 2015-02-09T19:36:26Z instance i-3d9bcecc was selected for termination.\\\"}\",\r\n  \"Timestamp\" : \"2015-02-09T19:37:10.607Z\",\r\n  \"SignatureVersion\" : \"1\",\r\n  \"Signature\" : \"sign-redacted=\",\r\n  \"SigningCertURL\" : \"https://sns.us-east-1.amazonaws.com/redacted.pem\",\r\n  \"UnsubscribeURL\" : \"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:redacted\"\r\n}\r\n2015/02/09 19:37:07 http: panic serving 54.239.98.163:54187: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 24 [running]:\r\nnet/http.funcÂ·011()\r\n        /usr/lib/go/src/pkg/net/http/server.go:1100 +0xb7\r\nruntime.panic(0x6d95a0, 0x8bbb13)\r\n        /usr/lib/go/src/pkg/runtime/panic.c:248 +0x18d\r\ngopkg.in/amz.v1/ec2.(*EC2).query(0xc2080560c0, 0xc2080256b0, 0x633de0, 0xc2080256e0, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:146 +0x5af\r\ngopkg.in/amz.v1/ec2.(*EC2).Instances(0xc2080560c0, 0x7f01b9d17228, 0x1, 0x1, 0x0, 0xc2080256e0, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:543 +0x10f\r\nmain.getInstance(0xc208038f66, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:126 +0x172\r\nmain.terminate(0x7f01b9ed7bb0, 0xc208052320, 0x0, 0xc20804e630, 0x87, 0xc208024de0, 0x25, 0xc208040240, 0x3b, 0xc20800e580, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:264 +0x61\r\nmain.readMessage(0x7f01b9ed7bb0, 0xc208052320, 0xc208000340)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:217 +0xb80\r\nnet/http.HandlerFunc.ServeHTTP(0x7b09a0, 0x7f01b9ed7bb0, 0xc208052320, 0xc208000340)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40\r\nnet/http.(*ServeMux).ServeHTTP(0xc2080246c0, 0x7f01b9ed7bb0, 0xc208052320, 0xc208000340)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1511 +0x1a3\r\nnet/http.serverHandler.ServeHTTP(0xc2080043c0, 0x7f01b9ed7bb0, 0xc208052320, 0xc208000340)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f\r\nnet/http.(*conn).serve(0xc208050300)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e\r\ncreated by net/http.(*Server).Serve\r\n        /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313\r\n2015/02/09 19:37:31 Received Payload: {\r\n  \"Type\" : \"Notification\",\r\n  \"MessageId\" : \"6a95e502-961e-5e1f-a46d-a85198b84a93\",\r\n  \"TopicArn\" : \"arn:aws:sns:us-east-1:redacted:aws_scale_prod\",\r\n  \"Subject\" : \"Auto Scaling: termination for group \\\"prod-webapp-scale\\\"\",\r\n  \"Message\" : \"{\\\"StatusCode\\\":\\\"InProgress\\\",\\\"Service\\\":\\\"AWS Auto Scaling\\\",\\\"AutoScalingGroupName\\\":\\\"prod-webapp-scale\\\",\\\"Description\\\":\\\"Terminating EC2 instance: i-3d9bcecc\\\",\\\"ActivityId\\\":\\\"344f5ce7-8c02-4763-b431-df4cdaa5bb71\\\",\\\"Event\\\":\\\"autoscaling:EC2_INSTANCE_TERMINATE\\\",\\\"Details\\\":{\\\"Availability Zone\\\":\\\"us-east-1e\\\"},\\\"AutoScalingGroupARN\\\":\\\"scalegroup-redacted\\\",\\\"Progress\\\":50,\\\"Time\\\":\\\"2015-02-09T19:37:10.111Z\\\",\\\"AccountId\\\":\\\"1234\\\",\\\"RequestId\\\":\\\"344f5ce7-8c02-4763-b431-df4cdaa5bb71\\\",\\\"StatusMessage\\\":\\\"\\\",\\\"EndTime\\\":\\\"2015-02-09T19:37:10.111Z\\\",\\\"EC2InstanceId\\\":\\\"i-3d9bcecc\\\",\\\"StartTime\\\":\\\"2015-02-09T19:36:26.423Z\\\",\\\"Cause\\\":\\\"At 2015-02-09T19:36:23Z a user request executed policy Decrease Group Size changing the desired capacity from 2 to 1.  At 2015-02-09T19:36:26Z an instance was taken out of service in response to a difference between desired and actual capacity, shrinking the capacity from 2 to 1.  At 2015-02-09T19:36:26Z instance i-3d9bcecc was selected for termination.\\\"}\",\r\n  \"Timestamp\" : \"2015-02-09T19:37:10.607Z\",\r\n  \"SignatureVersion\" : \"1\",\r\n  \"Signature\" :redacted\",\r\n  \"SigningCertURL\" : \"https://sns.us-east-1.amazonaws.com/redacted.pem\",\r\n  \"UnsubscribeURL\" : \"https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:redacted\"\r\n}\r\n2015/02/09 19:37:31 http: panic serving 54.239.98.165:65060: runtime error: invalid memory address or nil pointer dereference\r\ngoroutine 25 [running]:\r\nnet/http.funcÂ·011()\r\n        /usr/lib/go/src/pkg/net/http/server.go:1100 +0xb7\r\nruntime.panic(0x6d95a0, 0x8bbb13)\r\n        /usr/lib/go/src/pkg/runtime/panic.c:248 +0x18d\r\ngopkg.in/amz.v1/ec2.(*EC2).query(0xc208056180, 0xc208025e00, 0x633de0, 0xc208025e30, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:146 +0x5af\r\ngopkg.in/amz.v1/ec2.(*EC2).Instances(0xc208056180, 0x7f01b9d17228, 0x1, 0x1, 0x0, 0xc208025e30, 0x0, 0x0)\r\n        /opt/golang/src/gopkg.in/amz.v1/ec2/ec2.go:543 +0x10f\r\nmain.getInstance(0xc2080393b6, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:126 +0x172\r\nmain.terminate(0x7f01b9ed7bb0, 0xc2080525a0, 0x0, 0xc20804e630, 0x87, 0xc208024de0, 0x25, 0xc208040240, 0x3b, 0xc20800e580, ...)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:264 +0x61\r\nmain.readMessage(0x7f01b9ed7bb0, 0xc2080525a0, 0xc208000a90)\r\n        /opt/golang/src/github.com/rochacon/elastic-nginx/elnginx.go:217 +0xb80\r\nnet/http.HandlerFunc.ServeHTTP(0x7b09a0, 0x7f01b9ed7bb0, 0xc2080525a0, 0xc208000a90)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1235 +0x40\r\nnet/http.(*ServeMux).ServeHTTP(0xc2080246c0, 0x7f01b9ed7bb0, 0xc2080525a0, 0xc208000a90)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1511 +0x1a3\r\nnet/http.serverHandler.ServeHTTP(0xc2080043c0, 0x7f01b9ed7bb0, 0xc2080525a0, 0xc208000a90)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1673 +0x19f\r\nnet/http.(*conn).serve(0xc208050400)\r\n        /usr/lib/go/src/pkg/net/http/server.go:1174 +0xa7e\r\ncreated by net/http.(*Server).Serve\r\n        /usr/lib/go/src/pkg/net/http/server.go:1721 +0x313\r\n"},"comment":{"url":"https://api.github.com/repos/rochacon/elastic-nginx/issues/comments/74017132","html_url":"https://github.com/rochacon/elastic-nginx/issues/6#issuecomment-74017132","issue_url":"https://api.github.com/repos/rochacon/elastic-nginx/issues/6","id":74017132,"user":{"login":"rochacon","id":321351,"avatar_url":"https://avatars.githubusercontent.com/u/321351?v=3","gravatar_id":"","url":"https://api.github.com/users/rochacon","html_url":"https://github.com/rochacon","followers_url":"https://api.github.com/users/rochacon/followers","following_url":"https://api.github.com/users/rochacon/following{/other_user}","gists_url":"https://api.github.com/users/rochacon/gists{/gist_id}","starred_url":"https://api.github.com/users/rochacon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rochacon/subscriptions","organizations_url":"https://api.github.com/users/rochacon/orgs","repos_url":"https://api.github.com/users/rochacon/repos","events_url":"https://api.github.com/users/rochacon/events{/privacy}","received_events_url":"https://api.github.com/users/rochacon/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T04:47:08Z","updated_at":"2015-02-12T04:47:08Z","body":"@yudelevi found it. :smile: "}}