-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
ecs service creation fails when using newly created iam policy #2869
Comments
I'm experiencing almost exactly the same problem detailed here. |
Hello – I believe you are correct, this is a timing issue. It takes a few seconds for permissions to propagate through AWS:
source: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html Unfortunately the API doesn't give us any kind of status to base this on. |
I can confirm that in my scenario, a new |
I know it's hacky, but would it make sense to add an artificial delay in execution for the policy dependent step? Seeing that the API gives you no feedback I don't see another option. This is a pretty big deal for automated deployments. Running a failed step twice is not really something that should be happening in a CI system. |
Or would it be possible to poll the API after the role/policy has been created, until it can be described, at which point move on to the next step of the plan? |
I don't think an immediate follow-up
Might have to do this... I'll try the |
I did try to call Therefore I submitted #3061 which just retries ECS service create calls. It took about 2 secs when I was testing it (effectively 3 retries after 500ms). |
Thx @radeksimko |
This problem still occurs for me.
|
@cordoval This could be caused either by naively low timeout (2 mins atm) or strong inconsistency as described here: #3928 Would you mind creating a new issue & attaching debug log (minus any secrets, of course)? Then we would at least know at which point did the error occur. The outcome can be either the solution described in the linked issue #3928 or timeout increase. |
I added a depends_on like in another ticket and it seems to behave better now, i get less errors. I actually forget now once i pass a certain point. I think i will start associating errors with commits that way i can go back and reproduce. Thanks though for now. |
@cordoval When you added a |
depends_on = ["aws_iam_role_policy.ecs_service_role_policy"] on the aws_ecs_service resource block |
Cool, thanks! And you said you were still getting errors, but just less frequently? |
not anymore, not of this type at least. |
I've been running
I'm running into these timeouts regularly. This file has been creating other resources that sometimes manage to increase the timeout to a point where it works, but often I see failures as mentioned above
Let me know how I can help continue to debug! |
@radeksimko thanks for the info! |
@radeksimko Is it possible there's a separate issue? I've gone ahead and created my IAM role in a previous terraform run, so it already exists. When I run
I continue to get the |
totally my fault. figured out a policy issue. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I have what appears to be a timing issue when attempting to create a iam role/security policy and immediately use it as the iam_role of a new ecs service.
I get the following aws error in terraform:
If I specify a pre-existing iam role with an identical policy everything works fine.
I am using the following config:
The text was updated successfully, but these errors were encountered: