{"action":"closed","number":31,"pull_request":{"url":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/31","id":157319520,"html_url":"https://github.com/GorillaStack/auto-tag/pull/31","diff_url":"https://github.com/GorillaStack/auto-tag/pull/31.diff","patch_url":"https://github.com/GorillaStack/auto-tag/pull/31.patch","issue_url":"https://api.github.com/repos/GorillaStack/auto-tag/issues/31","number":31,"state":"closed","locked":false,"title":"Stopped processing CloudTrail events that contain errorCode and errorMessage","user":{"login":"rayj-pgi","id":18078751,"avatar_url":"https://avatars3.githubusercontent.com/u/18078751?v=4","gravatar_id":"","url":"https://api.github.com/users/rayj-pgi","html_url":"https://github.com/rayj-pgi","followers_url":"https://api.github.com/users/rayj-pgi/followers","following_url":"https://api.github.com/users/rayj-pgi/following{/other_user}","gists_url":"https://api.github.com/users/rayj-pgi/gists{/gist_id}","starred_url":"https://api.github.com/users/rayj-pgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayj-pgi/subscriptions","organizations_url":"https://api.github.com/users/rayj-pgi/orgs","repos_url":"https://api.github.com/users/rayj-pgi/repos","events_url":"https://api.github.com/users/rayj-pgi/events{/privacy}","received_events_url":"https://api.github.com/users/rayj-pgi/received_events","type":"User","site_admin":false},"body":"I found that some error message payloads were being sent to the workers but were failing. This was also observed by issue https://github.com/GorillaStack/auto-tag/issues/4.\r\n\r\nError:\r\n```\r\n{\r\n    \"errorMessage\": \"Cannot read property 'instancesSet' of null\",\r\n    \"errorType\": \"TypeError\",\r\n    \"stackTrace\": [\r\n        \"AutotagEC2Worker.getInstanceId (/var/task/workers/autotag_ec2_worker.js:105:41)\",\r\n        \"_callee$ (/var/task/workers/autotag_ec2_worker.js:71:53)\",\r\n        \"tryCatch (/var/task/node_modules/regenerator-runtime/runtime.js:65:40)\",\r\n        \"GeneratorFunctionPrototype.invoke [as _invoke] (/var/task/node_modules/regenerator-runtime/runtime.js:303:22)\",\r\n        \"GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/var/task/node_modules/regenerator-runtime/runtime.js:117:21)\",\r\n        \"onFulfilled (/var/task/node_modules/co/index.js:65:19)\",\r\n        \"run (/var/task/node_modules/core-js/modules/es6.promise.js:66:22)\",\r\n        \"/var/task/node_modules/core-js/modules/es6.promise.js:79:30\",\r\n        \"flush (/var/task/node_modules/core-js/modules/_microtask.js:18:9)\",\r\n        \"nextTickCallbackWith0Args (node.js:415:9)\"\r\n    ]\r\n}\r\n```\r\n\r\nThis error was a result of a CloudTrail error message like this one where `responseElements` is null:\r\n```\r\n{\r\n    \"eventVersion\": \"1.05\",\r\n    \"userIdentity\": {\r\n        \"type\": \"Root\",\r\n        \"principalId\": \"111111111\",\r\n        \"arn\": \"arn:aws:iam::1111111:root\",\r\n        \"accountId\": \"1111111111\",\r\n        \"userName\": \"xxxx\",\r\n        \"invokedBy\": \"autoscaling.amazonaws.com\"\r\n    },\r\n    \"eventTime\": \"2017-12-06T22:15:46Z\",\r\n    \"eventSource\": \"ec2.amazonaws.com\",\r\n    \"eventName\": \"RunInstances\",\r\n    \"awsRegion\": \"us-west-2\",\r\n    \"sourceIPAddress\": \"autoscaling.amazonaws.com\",\r\n    \"userAgent\": \"autoscaling.amazonaws.com\",\r\n    \"errorCode\": \"Client.AuthFailure\",\r\n    \"errorMessage\": \"Not authorized for images: [ami-xxxxxxx]\",\r\n    \"requestParameters\": {\r\n        \"instancesSet\": {\r\n            \"items\": [\r\n                {\r\n                    \"imageId\": \"ami-xxxxxx\",\r\n                    \"minCount\": 1,\r\n                    \"maxCount\": 1,\r\n                    \"keyName\": \"Server1\"\r\n                }\r\n            ]\r\n        },\r\n        \"groupSet\": {\r\n            \"items\": [\r\n                {\r\n                    \"groupName\": \"AAAA-SBAASecurityGroup-AAAAA\"\r\n                }\r\n            ]\r\n        },\r\n        \"userData\": \"<sensitiveDataRemoved>\",\r\n        \"instanceType\": \"t1.micro\",\r\n        \"blockDeviceMapping\": {},\r\n        \"availabilityZone\": \"us-west-2b\",\r\n        \"monitoring\": {\r\n            \"enabled\": true\r\n        },\r\n        \"disableApiTermination\": false,\r\n        \"clientToken\": \"\"\r\n    },\r\n    \"responseElements\": null,\r\n    \"requestID\": \"ffe5a93b-cfc5-43a3-bbaf-AAAAAAA\",\r\n    \"eventID\": \"b657f731-606a-4a0c-b21e-AAAAAAA\",\r\n    \"eventType\": \"AwsApiCall\",\r\n    \"recipientAccountId\": \"11111111\"\r\n}\r\n```\r\n\r\n","created_at":"2017-12-08T19:45:26Z","updated_at":"2018-02-27T00:14:46Z","closed_at":"2018-02-27T00:14:45Z","merged_at":"2018-02-27T00:14:45Z","merge_commit_sha":"da4ae278b6a5578b5951a0931a2a1031f8323a95","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/31/commits","review_comments_url":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/31/comments","review_comment_url":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GorillaStack/auto-tag/issues/31/comments","statuses_url":"https://api.github.com/repos/GorillaStack/auto-tag/statuses/a6f64d9a1d005e71ba65cc56aa92854f5af63ca6","head":{"label":"rayj-pgi:mute_errors","ref":"mute_errors","sha":"a6f64d9a1d005e71ba65cc56aa92854f5af63ca6","user":{"login":"rayj-pgi","id":18078751,"avatar_url":"https://avatars3.githubusercontent.com/u/18078751?v=4","gravatar_id":"","url":"https://api.github.com/users/rayj-pgi","html_url":"https://github.com/rayj-pgi","followers_url":"https://api.github.com/users/rayj-pgi/followers","following_url":"https://api.github.com/users/rayj-pgi/following{/other_user}","gists_url":"https://api.github.com/users/rayj-pgi/gists{/gist_id}","starred_url":"https://api.github.com/users/rayj-pgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayj-pgi/subscriptions","organizations_url":"https://api.github.com/users/rayj-pgi/orgs","repos_url":"https://api.github.com/users/rayj-pgi/repos","events_url":"https://api.github.com/users/rayj-pgi/events{/privacy}","received_events_url":"https://api.github.com/users/rayj-pgi/received_events","type":"User","site_admin":false},"repo":{"id":113349494,"name":"auto-tag","full_name":"rayj-pgi/auto-tag","owner":{"login":"rayj-pgi","id":18078751,"avatar_url":"https://avatars3.githubusercontent.com/u/18078751?v=4","gravatar_id":"","url":"https://api.github.com/users/rayj-pgi","html_url":"https://github.com/rayj-pgi","followers_url":"https://api.github.com/users/rayj-pgi/followers","following_url":"https://api.github.com/users/rayj-pgi/following{/other_user}","gists_url":"https://api.github.com/users/rayj-pgi/gists{/gist_id}","starred_url":"https://api.github.com/users/rayj-pgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rayj-pgi/subscriptions","organizations_url":"https://api.github.com/users/rayj-pgi/orgs","repos_url":"https://api.github.com/users/rayj-pgi/repos","events_url":"https://api.github.com/users/rayj-pgi/events{/privacy}","received_events_url":"https://api.github.com/users/rayj-pgi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rayj-pgi/auto-tag","description":"Automatically tag AWS resources on creation, for cost assignment and governance","fork":true,"url":"https://api.github.com/repos/rayj-pgi/auto-tag","forks_url":"https://api.github.com/repos/rayj-pgi/auto-tag/forks","keys_url":"https://api.github.com/repos/rayj-pgi/auto-tag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rayj-pgi/auto-tag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rayj-pgi/auto-tag/teams","hooks_url":"https://api.github.com/repos/rayj-pgi/auto-tag/hooks","issue_events_url":"https://api.github.com/repos/rayj-pgi/auto-tag/issues/events{/number}","events_url":"https://api.github.com/repos/rayj-pgi/auto-tag/events","assignees_url":"https://api.github.com/repos/rayj-pgi/auto-tag/assignees{/user}","branches_url":"https://api.github.com/repos/rayj-pgi/auto-tag/branches{/branch}","tags_url":"https://api.github.com/repos/rayj-pgi/auto-tag/tags","blobs_url":"https://api.github.com/repos/rayj-pgi/auto-tag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rayj-pgi/auto-tag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rayj-pgi/auto-tag/git/refs{/sha}","trees_url":"https://api.github.com/repos/rayj-pgi/auto-tag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rayj-pgi/auto-tag/statuses/{sha}","languages_url":"https://api.github.com/repos/rayj-pgi/auto-tag/languages","stargazers_url":"https://api.github.com/repos/rayj-pgi/auto-tag/stargazers","contributors_url":"https://api.github.com/repos/rayj-pgi/auto-tag/contributors","subscribers_url":"https://api.github.com/repos/rayj-pgi/auto-tag/subscribers","subscription_url":"https://api.github.com/repos/rayj-pgi/auto-tag/subscription","commits_url":"https://api.github.com/repos/rayj-pgi/auto-tag/commits{/sha}","git_commits_url":"https://api.github.com/repos/rayj-pgi/auto-tag/git/commits{/sha}","comments_url":"https://api.github.com/repos/rayj-pgi/auto-tag/comments{/number}","issue_comment_url":"https://api.github.com/repos/rayj-pgi/auto-tag/issues/comments{/number}","contents_url":"https://api.github.com/repos/rayj-pgi/auto-tag/contents/{+path}","compare_url":"https://api.github.com/repos/rayj-pgi/auto-tag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rayj-pgi/auto-tag/merges","archive_url":"https://api.github.com/repos/rayj-pgi/auto-tag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rayj-pgi/auto-tag/downloads","issues_url":"https://api.github.com/repos/rayj-pgi/auto-tag/issues{/number}","pulls_url":"https://api.github.com/repos/rayj-pgi/auto-tag/pulls{/number}","milestones_url":"https://api.github.com/repos/rayj-pgi/auto-tag/milestones{/number}","notifications_url":"https://api.github.com/repos/rayj-pgi/auto-tag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rayj-pgi/auto-tag/labels{/name}","releases_url":"https://api.github.com/repos/rayj-pgi/auto-tag/releases{/id}","deployments_url":"https://api.github.com/repos/rayj-pgi/auto-tag/deployments","created_at":"2017-12-06T17:53:35Z","updated_at":"2018-02-18T16:40:03Z","pushed_at":"2018-02-24T05:20:48Z","git_url":"git://github.com/rayj-pgi/auto-tag.git","ssh_url":"git@github.com:rayj-pgi/auto-tag.git","clone_url":"https://github.com/rayj-pgi/auto-tag.git","svn_url":"https://github.com/rayj-pgi/auto-tag","homepage":"","size":195,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"events_and_more"}},"base":{"label":"GorillaStack:master","ref":"master","sha":"c55f2a450b6b04fd55b68bdda23c114f92243da9","user":{"login":"GorillaStack","id":13860282,"avatar_url":"https://avatars0.githubusercontent.com/u/13860282?v=4","gravatar_id":"","url":"https://api.github.com/users/GorillaStack","html_url":"https://github.com/GorillaStack","followers_url":"https://api.github.com/users/GorillaStack/followers","following_url":"https://api.github.com/users/GorillaStack/following{/other_user}","gists_url":"https://api.github.com/users/GorillaStack/gists{/gist_id}","starred_url":"https://api.github.com/users/GorillaStack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GorillaStack/subscriptions","organizations_url":"https://api.github.com/users/GorillaStack/orgs","repos_url":"https://api.github.com/users/GorillaStack/repos","events_url":"https://api.github.com/users/GorillaStack/events{/privacy}","received_events_url":"https://api.github.com/users/GorillaStack/received_events","type":"Organization","site_admin":false},"repo":{"id":42701648,"name":"auto-tag","full_name":"GorillaStack/auto-tag","owner":{"login":"GorillaStack","id":13860282,"avatar_url":"https://avatars0.githubusercontent.com/u/13860282?v=4","gravatar_id":"","url":"https://api.github.com/users/GorillaStack","html_url":"https://github.com/GorillaStack","followers_url":"https://api.github.com/users/GorillaStack/followers","following_url":"https://api.github.com/users/GorillaStack/following{/other_user}","gists_url":"https://api.github.com/users/GorillaStack/gists{/gist_id}","starred_url":"https://api.github.com/users/GorillaStack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GorillaStack/subscriptions","organizations_url":"https://api.github.com/users/GorillaStack/orgs","repos_url":"https://api.github.com/users/GorillaStack/repos","events_url":"https://api.github.com/users/GorillaStack/events{/privacy}","received_events_url":"https://api.github.com/users/GorillaStack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GorillaStack/auto-tag","description":"Automatically tag AWS resources on creation, for cost assignment","fork":false,"url":"https://api.github.com/repos/GorillaStack/auto-tag","forks_url":"https://api.github.com/repos/GorillaStack/auto-tag/forks","keys_url":"https://api.github.com/repos/GorillaStack/auto-tag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GorillaStack/auto-tag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GorillaStack/auto-tag/teams","hooks_url":"https://api.github.com/repos/GorillaStack/auto-tag/hooks","issue_events_url":"https://api.github.com/repos/GorillaStack/auto-tag/issues/events{/number}","events_url":"https://api.github.com/repos/GorillaStack/auto-tag/events","assignees_url":"https://api.github.com/repos/GorillaStack/auto-tag/assignees{/user}","branches_url":"https://api.github.com/repos/GorillaStack/auto-tag/branches{/branch}","tags_url":"https://api.github.com/repos/GorillaStack/auto-tag/tags","blobs_url":"https://api.github.com/repos/GorillaStack/auto-tag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GorillaStack/auto-tag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GorillaStack/auto-tag/git/refs{/sha}","trees_url":"https://api.github.com/repos/GorillaStack/auto-tag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GorillaStack/auto-tag/statuses/{sha}","languages_url":"https://api.github.com/repos/GorillaStack/auto-tag/languages","stargazers_url":"https://api.github.com/repos/GorillaStack/auto-tag/stargazers","contributors_url":"https://api.github.com/repos/GorillaStack/auto-tag/contributors","subscribers_url":"https://api.github.com/repos/GorillaStack/auto-tag/subscribers","subscription_url":"https://api.github.com/repos/GorillaStack/auto-tag/subscription","commits_url":"https://api.github.com/repos/GorillaStack/auto-tag/commits{/sha}","git_commits_url":"https://api.github.com/repos/GorillaStack/auto-tag/git/commits{/sha}","comments_url":"https://api.github.com/repos/GorillaStack/auto-tag/comments{/number}","issue_comment_url":"https://api.github.com/repos/GorillaStack/auto-tag/issues/comments{/number}","contents_url":"https://api.github.com/repos/GorillaStack/auto-tag/contents/{+path}","compare_url":"https://api.github.com/repos/GorillaStack/auto-tag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GorillaStack/auto-tag/merges","archive_url":"https://api.github.com/repos/GorillaStack/auto-tag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GorillaStack/auto-tag/downloads","issues_url":"https://api.github.com/repos/GorillaStack/auto-tag/issues{/number}","pulls_url":"https://api.github.com/repos/GorillaStack/auto-tag/pulls{/number}","milestones_url":"https://api.github.com/repos/GorillaStack/auto-tag/milestones{/number}","notifications_url":"https://api.github.com/repos/GorillaStack/auto-tag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GorillaStack/auto-tag/labels{/name}","releases_url":"https://api.github.com/repos/GorillaStack/auto-tag/releases{/id}","deployments_url":"https://api.github.com/repos/GorillaStack/auto-tag/deployments","created_at":"2015-09-18T05:31:00Z","updated_at":"2018-02-18T11:05:44Z","pushed_at":"2018-02-27T00:14:45Z","git_url":"git://github.com/GorillaStack/auto-tag.git","ssh_url":"git@github.com:GorillaStack/auto-tag.git","clone_url":"https://github.com/GorillaStack/auto-tag.git","svn_url":"https://github.com/GorillaStack/auto-tag","homepage":null,"size":84,"stargazers_count":124,"watchers_count":124,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":55,"open_issues":13,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/31"},"html":{"href":"https://github.com/GorillaStack/auto-tag/pull/31"},"issue":{"href":"https://api.github.com/repos/GorillaStack/auto-tag/issues/31"},"comments":{"href":"https://api.github.com/repos/GorillaStack/auto-tag/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GorillaStack/auto-tag/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/GorillaStack/auto-tag/statuses/a6f64d9a1d005e71ba65cc56aa92854f5af63ca6"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"em0ney","id":5679658,"avatar_url":"https://avatars0.githubusercontent.com/u/5679658?v=4","gravatar_id":"","url":"https://api.github.com/users/em0ney","html_url":"https://github.com/em0ney","followers_url":"https://api.github.com/users/em0ney/followers","following_url":"https://api.github.com/users/em0ney/following{/other_user}","gists_url":"https://api.github.com/users/em0ney/gists{/gist_id}","starred_url":"https://api.github.com/users/em0ney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/em0ney/subscriptions","organizations_url":"https://api.github.com/users/em0ney/orgs","repos_url":"https://api.github.com/users/em0ney/repos","events_url":"https://api.github.com/users/em0ney/events{/privacy}","received_events_url":"https://api.github.com/users/em0ney/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":6,"deletions":4,"changed_files":1}}
{"actor":{"display_login":"em0ney"}}