AWS Lambda function initiated twice from cloudwatch, runs successfully only once, why are errors not logged
I'm using cloudwatch event to trigger a labmda when a new ecs instance starts up.
I'm a bit mystified by the logs, it looks like the function is called then fails silently and then called again and runs successfully with the same event input.
I understand that lambda functions can be called multiple times from cloudwatch for the same event because the delivery contract is at least once and I plan on making changes to the function so it's idempotent.
My question is, what is happening when it's called the first time and just stops running?
More info based on Jarmod's question
The first time the function is called only the following tags are available:
'Tags': [{'Key': 'aws:ec2launchtemplate:id', 'ResourceId': 'i-0a0500abc17bc7e9e', 'ResourceType': 'instance', 'Value': 'lt-01e5585a011e48b97'}]
This means my code was failing on the following line:
if 'torres' in ec2_response['Tags'][0]['Value']
Since when I set the filter to only get the Name tag, the tags were coming back empty the first time. I'm assuming that the lambda was being re-run based on Lambda re-run documentation and the second time it's called the Name tag is there and everything is great.
So my question becomes, why am I not getting an error in my lambda logs?
Here's the log output:
2019-01-01 11:34:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f40525f8>
Making ec2 name request
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 366.46 ms Billed Duration: 400 ms Memory Size: 128 MB Max Memory Used: 39 MB
2019-01-01 11:35:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-
id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f724ca58>
Making ec2 name request
torres instance, starting ecs task
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 1022.97 ms Billed Duration: 1100 ms Memory Size: 128 MB Max Memory Used: 40 MB
Here's the function:
def lambda_handler(event, context):
print('Event: {}n, Context: {}'.format(event, context))
if event['detail-type'] != 'EC2 Instance State-change Notification':
print('Wrong event detail-type')
ret = {
'status': 'Wrong event detail-type'
}
print(event)
else:
print('Making ec2 name request')
ec2_client = boto3.client('ec2', region_name='us-west-2')
try:
ec2_response = ec2_client.describe_tags(
Filters=[
{
'Name': 'resource-id',
'Values': [
event['detail']['instance-id']
]
},
{
'Name': 'key',
'Values': [
'Name'
]
}
]
)
except Exception as e:
print('Failed ec2 call')
print(e)
raise e
if 'torres' in ec2_response['Tags'][0]['Value']:
print('torres instance, starting ecs task')
ecs_client = boto3.client('ecs', region_name='us-west-2')
try:
ecs_response = ecs_client.run_task(
cluster='torres',
taskDefinition='torres:16'
)
except Exception as e:
print('Failed ecs call')
print(e)
raise e
task_definition_arns = [t['taskDefinitionArn'] for t in ecs_response['tasks']]
ecs_status = ecs_response['ResponseMetadata']['HTTPStatusCode']
ret = {
'task_definition_arns': task_definition_arns,
'ecs_status': ecs_status
}
else:
print('Wrong instance')
ret = {
'status': 'Wrong instance',
'event': event
}
return ret
python amazon-web-services aws-lambda amazon-cloudwatch
|
show 2 more comments
I'm using cloudwatch event to trigger a labmda when a new ecs instance starts up.
I'm a bit mystified by the logs, it looks like the function is called then fails silently and then called again and runs successfully with the same event input.
I understand that lambda functions can be called multiple times from cloudwatch for the same event because the delivery contract is at least once and I plan on making changes to the function so it's idempotent.
My question is, what is happening when it's called the first time and just stops running?
More info based on Jarmod's question
The first time the function is called only the following tags are available:
'Tags': [{'Key': 'aws:ec2launchtemplate:id', 'ResourceId': 'i-0a0500abc17bc7e9e', 'ResourceType': 'instance', 'Value': 'lt-01e5585a011e48b97'}]
This means my code was failing on the following line:
if 'torres' in ec2_response['Tags'][0]['Value']
Since when I set the filter to only get the Name tag, the tags were coming back empty the first time. I'm assuming that the lambda was being re-run based on Lambda re-run documentation and the second time it's called the Name tag is there and everything is great.
So my question becomes, why am I not getting an error in my lambda logs?
Here's the log output:
2019-01-01 11:34:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f40525f8>
Making ec2 name request
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 366.46 ms Billed Duration: 400 ms Memory Size: 128 MB Max Memory Used: 39 MB
2019-01-01 11:35:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-
id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f724ca58>
Making ec2 name request
torres instance, starting ecs task
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 1022.97 ms Billed Duration: 1100 ms Memory Size: 128 MB Max Memory Used: 40 MB
Here's the function:
def lambda_handler(event, context):
print('Event: {}n, Context: {}'.format(event, context))
if event['detail-type'] != 'EC2 Instance State-change Notification':
print('Wrong event detail-type')
ret = {
'status': 'Wrong event detail-type'
}
print(event)
else:
print('Making ec2 name request')
ec2_client = boto3.client('ec2', region_name='us-west-2')
try:
ec2_response = ec2_client.describe_tags(
Filters=[
{
'Name': 'resource-id',
'Values': [
event['detail']['instance-id']
]
},
{
'Name': 'key',
'Values': [
'Name'
]
}
]
)
except Exception as e:
print('Failed ec2 call')
print(e)
raise e
if 'torres' in ec2_response['Tags'][0]['Value']:
print('torres instance, starting ecs task')
ecs_client = boto3.client('ecs', region_name='us-west-2')
try:
ecs_response = ecs_client.run_task(
cluster='torres',
taskDefinition='torres:16'
)
except Exception as e:
print('Failed ecs call')
print(e)
raise e
task_definition_arns = [t['taskDefinitionArn'] for t in ecs_response['tasks']]
ecs_status = ecs_response['ResponseMetadata']['HTTPStatusCode']
ret = {
'task_definition_arns': task_definition_arns,
'ecs_status': ecs_status
}
else:
print('Wrong instance')
ret = {
'status': 'Wrong instance',
'event': event
}
return ret
python amazon-web-services aws-lambda amazon-cloudwatch
Is that the complete lambda function? I cant find themaking asg lifecycle hook call
output... - And can you make sure, that a Lambda timeout is not the issue? This is usually my first impulse when something in a possible cold-start-situation fails ;-)
– Maurice
Jan 1 at 23:28
What does ec2_response contain in the first case? Does it actually have any valid content with tags?
– jarmod
Jan 1 at 23:53
@Maurice - that was from an earlier version of it, I removed that from the logs it doesn't affect the problem.
– sshevlyagin
Jan 3 at 0:06
@jarmod - you nailed it, the tag isn't there. I'm not sure why the exception didn't make it to the log though. I guess that's the better question now :)
– sshevlyagin
Jan 3 at 0:07
1
@sshevlyagin This is apparently an Issue with the Python 3.7 Runtime - switch back to 3.6 and you should see the exception.
– Maurice
Jan 3 at 10:06
|
show 2 more comments
I'm using cloudwatch event to trigger a labmda when a new ecs instance starts up.
I'm a bit mystified by the logs, it looks like the function is called then fails silently and then called again and runs successfully with the same event input.
I understand that lambda functions can be called multiple times from cloudwatch for the same event because the delivery contract is at least once and I plan on making changes to the function so it's idempotent.
My question is, what is happening when it's called the first time and just stops running?
More info based on Jarmod's question
The first time the function is called only the following tags are available:
'Tags': [{'Key': 'aws:ec2launchtemplate:id', 'ResourceId': 'i-0a0500abc17bc7e9e', 'ResourceType': 'instance', 'Value': 'lt-01e5585a011e48b97'}]
This means my code was failing on the following line:
if 'torres' in ec2_response['Tags'][0]['Value']
Since when I set the filter to only get the Name tag, the tags were coming back empty the first time. I'm assuming that the lambda was being re-run based on Lambda re-run documentation and the second time it's called the Name tag is there and everything is great.
So my question becomes, why am I not getting an error in my lambda logs?
Here's the log output:
2019-01-01 11:34:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f40525f8>
Making ec2 name request
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 366.46 ms Billed Duration: 400 ms Memory Size: 128 MB Max Memory Used: 39 MB
2019-01-01 11:35:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-
id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f724ca58>
Making ec2 name request
torres instance, starting ecs task
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 1022.97 ms Billed Duration: 1100 ms Memory Size: 128 MB Max Memory Used: 40 MB
Here's the function:
def lambda_handler(event, context):
print('Event: {}n, Context: {}'.format(event, context))
if event['detail-type'] != 'EC2 Instance State-change Notification':
print('Wrong event detail-type')
ret = {
'status': 'Wrong event detail-type'
}
print(event)
else:
print('Making ec2 name request')
ec2_client = boto3.client('ec2', region_name='us-west-2')
try:
ec2_response = ec2_client.describe_tags(
Filters=[
{
'Name': 'resource-id',
'Values': [
event['detail']['instance-id']
]
},
{
'Name': 'key',
'Values': [
'Name'
]
}
]
)
except Exception as e:
print('Failed ec2 call')
print(e)
raise e
if 'torres' in ec2_response['Tags'][0]['Value']:
print('torres instance, starting ecs task')
ecs_client = boto3.client('ecs', region_name='us-west-2')
try:
ecs_response = ecs_client.run_task(
cluster='torres',
taskDefinition='torres:16'
)
except Exception as e:
print('Failed ecs call')
print(e)
raise e
task_definition_arns = [t['taskDefinitionArn'] for t in ecs_response['tasks']]
ecs_status = ecs_response['ResponseMetadata']['HTTPStatusCode']
ret = {
'task_definition_arns': task_definition_arns,
'ecs_status': ecs_status
}
else:
print('Wrong instance')
ret = {
'status': 'Wrong instance',
'event': event
}
return ret
python amazon-web-services aws-lambda amazon-cloudwatch
I'm using cloudwatch event to trigger a labmda when a new ecs instance starts up.
I'm a bit mystified by the logs, it looks like the function is called then fails silently and then called again and runs successfully with the same event input.
I understand that lambda functions can be called multiple times from cloudwatch for the same event because the delivery contract is at least once and I plan on making changes to the function so it's idempotent.
My question is, what is happening when it's called the first time and just stops running?
More info based on Jarmod's question
The first time the function is called only the following tags are available:
'Tags': [{'Key': 'aws:ec2launchtemplate:id', 'ResourceId': 'i-0a0500abc17bc7e9e', 'ResourceType': 'instance', 'Value': 'lt-01e5585a011e48b97'}]
This means my code was failing on the following line:
if 'torres' in ec2_response['Tags'][0]['Value']
Since when I set the filter to only get the Name tag, the tags were coming back empty the first time. I'm assuming that the lambda was being re-run based on Lambda re-run documentation and the second time it's called the Name tag is there and everything is great.
So my question becomes, why am I not getting an error in my lambda logs?
Here's the log output:
2019-01-01 11:34:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f40525f8>
Making ec2 name request
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 366.46 ms Billed Duration: 400 ms Memory Size: 128 MB Max Memory Used: 39 MB
2019-01-01 11:35:46
START RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Version: $LATEST
Event: {'version': '0', 'id': '12f0dc8e-2c49-be57-823f-ab6229b12804',
'detail-type': 'EC2 Instance State-change Notification', 'source':
'aws.ec2', 'account': '701704546303', 'time': '2019-01-01T14:34:46Z',
'region': 'us-west-2', 'resources': ['arn:aws:ec2:us-west-
2:701704546303:instance/i-0a4af714ff4396d55'], 'detail': {'instance-
id': 'i-0a4af714ff4396d55', 'state': 'running'}}
, Context: <bootstrap.LambdaContext object at 0x7fc8f724ca58>
Making ec2 name request
torres instance, starting ecs task
END RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8
REPORT RequestId: 63190c9b-0dd2-11e9-b6ed-256f780af4a8 Duration: 1022.97 ms Billed Duration: 1100 ms Memory Size: 128 MB Max Memory Used: 40 MB
Here's the function:
def lambda_handler(event, context):
print('Event: {}n, Context: {}'.format(event, context))
if event['detail-type'] != 'EC2 Instance State-change Notification':
print('Wrong event detail-type')
ret = {
'status': 'Wrong event detail-type'
}
print(event)
else:
print('Making ec2 name request')
ec2_client = boto3.client('ec2', region_name='us-west-2')
try:
ec2_response = ec2_client.describe_tags(
Filters=[
{
'Name': 'resource-id',
'Values': [
event['detail']['instance-id']
]
},
{
'Name': 'key',
'Values': [
'Name'
]
}
]
)
except Exception as e:
print('Failed ec2 call')
print(e)
raise e
if 'torres' in ec2_response['Tags'][0]['Value']:
print('torres instance, starting ecs task')
ecs_client = boto3.client('ecs', region_name='us-west-2')
try:
ecs_response = ecs_client.run_task(
cluster='torres',
taskDefinition='torres:16'
)
except Exception as e:
print('Failed ecs call')
print(e)
raise e
task_definition_arns = [t['taskDefinitionArn'] for t in ecs_response['tasks']]
ecs_status = ecs_response['ResponseMetadata']['HTTPStatusCode']
ret = {
'task_definition_arns': task_definition_arns,
'ecs_status': ecs_status
}
else:
print('Wrong instance')
ret = {
'status': 'Wrong instance',
'event': event
}
return ret
python amazon-web-services aws-lambda amazon-cloudwatch
python amazon-web-services aws-lambda amazon-cloudwatch
edited Jan 3 at 0:06
sshevlyagin
asked Jan 1 at 22:11
sshevlyaginsshevlyagin
3391311
3391311
Is that the complete lambda function? I cant find themaking asg lifecycle hook call
output... - And can you make sure, that a Lambda timeout is not the issue? This is usually my first impulse when something in a possible cold-start-situation fails ;-)
– Maurice
Jan 1 at 23:28
What does ec2_response contain in the first case? Does it actually have any valid content with tags?
– jarmod
Jan 1 at 23:53
@Maurice - that was from an earlier version of it, I removed that from the logs it doesn't affect the problem.
– sshevlyagin
Jan 3 at 0:06
@jarmod - you nailed it, the tag isn't there. I'm not sure why the exception didn't make it to the log though. I guess that's the better question now :)
– sshevlyagin
Jan 3 at 0:07
1
@sshevlyagin This is apparently an Issue with the Python 3.7 Runtime - switch back to 3.6 and you should see the exception.
– Maurice
Jan 3 at 10:06
|
show 2 more comments
Is that the complete lambda function? I cant find themaking asg lifecycle hook call
output... - And can you make sure, that a Lambda timeout is not the issue? This is usually my first impulse when something in a possible cold-start-situation fails ;-)
– Maurice
Jan 1 at 23:28
What does ec2_response contain in the first case? Does it actually have any valid content with tags?
– jarmod
Jan 1 at 23:53
@Maurice - that was from an earlier version of it, I removed that from the logs it doesn't affect the problem.
– sshevlyagin
Jan 3 at 0:06
@jarmod - you nailed it, the tag isn't there. I'm not sure why the exception didn't make it to the log though. I guess that's the better question now :)
– sshevlyagin
Jan 3 at 0:07
1
@sshevlyagin This is apparently an Issue with the Python 3.7 Runtime - switch back to 3.6 and you should see the exception.
– Maurice
Jan 3 at 10:06
Is that the complete lambda function? I cant find the
making asg lifecycle hook call
output... - And can you make sure, that a Lambda timeout is not the issue? This is usually my first impulse when something in a possible cold-start-situation fails ;-)– Maurice
Jan 1 at 23:28
Is that the complete lambda function? I cant find the
making asg lifecycle hook call
output... - And can you make sure, that a Lambda timeout is not the issue? This is usually my first impulse when something in a possible cold-start-situation fails ;-)– Maurice
Jan 1 at 23:28
What does ec2_response contain in the first case? Does it actually have any valid content with tags?
– jarmod
Jan 1 at 23:53
What does ec2_response contain in the first case? Does it actually have any valid content with tags?
– jarmod
Jan 1 at 23:53
@Maurice - that was from an earlier version of it, I removed that from the logs it doesn't affect the problem.
– sshevlyagin
Jan 3 at 0:06
@Maurice - that was from an earlier version of it, I removed that from the logs it doesn't affect the problem.
– sshevlyagin
Jan 3 at 0:06
@jarmod - you nailed it, the tag isn't there. I'm not sure why the exception didn't make it to the log though. I guess that's the better question now :)
– sshevlyagin
Jan 3 at 0:07
@jarmod - you nailed it, the tag isn't there. I'm not sure why the exception didn't make it to the log though. I guess that's the better question now :)
– sshevlyagin
Jan 3 at 0:07
1
1
@sshevlyagin This is apparently an Issue with the Python 3.7 Runtime - switch back to 3.6 and you should see the exception.
– Maurice
Jan 3 at 10:06
@sshevlyagin This is apparently an Issue with the Python 3.7 Runtime - switch back to 3.6 and you should see the exception.
– Maurice
Jan 3 at 10:06
|
show 2 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999342%2faws-lambda-function-initiated-twice-from-cloudwatch-runs-successfully-only-once%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53999342%2faws-lambda-function-initiated-twice-from-cloudwatch-runs-successfully-only-once%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is that the complete lambda function? I cant find the
making asg lifecycle hook call
output... - And can you make sure, that a Lambda timeout is not the issue? This is usually my first impulse when something in a possible cold-start-situation fails ;-)– Maurice
Jan 1 at 23:28
What does ec2_response contain in the first case? Does it actually have any valid content with tags?
– jarmod
Jan 1 at 23:53
@Maurice - that was from an earlier version of it, I removed that from the logs it doesn't affect the problem.
– sshevlyagin
Jan 3 at 0:06
@jarmod - you nailed it, the tag isn't there. I'm not sure why the exception didn't make it to the log though. I guess that's the better question now :)
– sshevlyagin
Jan 3 at 0:07
1
@sshevlyagin This is apparently an Issue with the Python 3.7 Runtime - switch back to 3.6 and you should see the exception.
– Maurice
Jan 3 at 10:06