fargatecli icon indicating copy to clipboard operation
fargatecli copied to clipboard

EntityAlreadyExists error when creating a service

Open gmcguire opened this issue 6 years ago • 1 comments

When creating a service in an empty cluster, I'm seeing the following error:

EntityAlreadyExists: Role with name ecsTaskExecutionRole already exists.
	status code: 409, request id: 6eb085be-77e1-11e9-a00c-09daa6044045

It looks like for whatever reason the GetRole call in CreateEcsTaskExecutionRole isn't finding the existing role, and tries to recreate it.

https://github.com/jpignata/fargate/blob/master/iam/role.go#L28

If I delete the role, this code recreates it correctly, but the next service I try to add hits the same error.

gmcguire avatar May 16 '19 13:05 gmcguire

Also experiencing this issue. It seems to happen for me when fargate task run fails before launching a container. You can repro this by running fargate with a new IAM user with enough IAM policy grants to create the ecsTaskExecutionRole but nothing else.

joshenders avatar Dec 26 '20 10:12 joshenders