Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceConflictException when updating lambda configuration #16

Open
fbn-roussel opened this issue Dec 9, 2021 · 1 comment
Open

Comments

@fbn-roussel
Copy link

I get this this error in the loop step when the lambda configuration is updated and number of invocations is > 1 :

{
  "errorType": "ResourceConflictException",
  "errorMessage": "The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:eu-west-1:xxxxxxxx:function:xxxxxxxxxxxx",
  "trace": [
    "ResourceConflictException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:eu-west-1:xxxxxxxx:function:xxxxxxxxxxxx",
    "    at Object.extractError (/var/task/node_modules/aws-sdk/lib/protocol/json.js:51:27)",
    "    at Request.extractError (/var/task/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)",
    "    at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)",
    "    at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)",
    "    at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:683:14)",
    "    at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)",
    "    at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)",
    "    at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10",
    "    at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:38:9)",
    "    at Request.<anonymous> (/var/task/node_modules/aws-sdk/lib/request.js:685:12)"
  ]
}

I don't really get why this happen as we have a for loop with await keywords :

	let done = 0;
	for (let i = 0; i < count; i++) {
		await updateEnvVar(functionName, envVars);
		await invoke(functionName, payload);
		done++;

		if (context.getRemainingTimeInMillis() < 10000) {
			return { ...input, count: count - done };
		}
	}

A potential fix could be to add retry behavior to the update lambda configuration call.

I will make a PR.

SAR version : 1.4.0.

@drissamri
Copy link
Contributor

I've fixed this with the SDK Waiter functionality in #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants