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

provider/aws: IGW sometimes takes time to create #2174

Closed
radeksimko opened this issue Jun 1, 2015 · 12 comments · Fixed by #6105
Closed

provider/aws: IGW sometimes takes time to create #2174

radeksimko opened this issue Jun 1, 2015 · 12 comments · Fixed by #6105

Comments

@radeksimko
Copy link
Member

When I try to bootstrap a non-trivial infrastructure with an IGW, I sometimes run into the following error:

module.yada_yada.aws_internet_gateway.default: Error: 1 error(s) occurred:

* InvalidInternetGatewayID.NotFound: The internetGateway ID 'igw-c30b7ba3' does not exist
    status code: 400, request id: []

I noticed that for some resources we check if these are created after we send the request for creating before doing anything else, so I guess similar approach may need to be applied here.

// btw. the same infrastructure works well on second run of terraform apply

@radeksimko radeksimko changed the title provider/aws: IGW sometimes take time to create provider/aws: IGW sometimes takes time to create Jun 2, 2015
@catsby
Copy link
Contributor

catsby commented Jun 2, 2015

That's frustrating 😢, specifically the non-trivial part which makes a minimal case hard to reproduce.

Checking the API, I'm not sure what we can do. It sounds like an "eventual consistency inside AWS" type thing. The create call just returns information about the IGW, which doesn't seem to have any notion of a state or status. Even DescribeInternetGateways lack state of the IGW itself, though it does have info on the attached state... I'm not sure that helps, since the error you show is regarding existence at all.

Is there a particular resource that's trying to use this IGW? Maybe we could poll a time or two if we get this error :/

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label Jun 2, 2015
@radeksimko
Copy link
Member Author

I will try and see if I can debug it in any way and come up with any meaningful way of fixing it...
I know it's also not easy for you to reproduce this either... :/

@catsby
Copy link
Contributor

catsby commented Jun 3, 2015

I know it's also not easy for you to reproduce this either

I hope this wasn't received as push-back! It was intended as an expression of mutual suffering :)

@radeksimko
Copy link
Member Author

I hope this wasn't received as push-back! It was intended as an expression of mutual suffering :)

It was an expression of mutual suffering from my side as well. 😸

@stephenchu
Copy link
Contributor

Just to add some details about this. The IGW was "detached" when that error occurred and remained so for a chunk of time. Then subsequent terraform apply that succeeds seems to do so based on the IGW being "attached", however it became so.

@catsby
Copy link
Contributor

catsby commented Jul 22, 2015

Hey @radeksimko – is there any thing you think we can do here, or can we close this in mutual suffering? 😄

@radeksimko
Copy link
Member Author

I'm not sure it's worth playing the whack-a-mole here with resources since this behaviour will likely apply to other resources too... :/

I was thinking of adding something like this:

resource.Retry(1*time.Minute, func() error {

for the read API request.
But adding it across all resources feels like a mess. What do you think? Shall we just accept this as behaviour we won't try to prevent?

@catsby
Copy link
Contributor

catsby commented Jul 29, 2015

I was thinking of adding something like this:

to the resourceAwsInternetGatewayCreate method? A WaitForState() does't sound unreasonable there, or are you talking about something else?

@jszwedko
Copy link
Contributor

Yeah, a WaitForState there seems like it would alleviate some of this @catsby

We see this issue pretty frequently.

@IvanTing
Copy link

IvanTing commented Sep 1, 2015

I also encounter this issue sometimes. When I check the AWS console again, the internet Gateway is actually created. Below is the error message.

InvalidInternetGatewayID.NotFound: The internetGateway ID 'igw-84cf01e1' does not exist
status code: 400, request id: []
Resource 'aws_route_table.r' does not have attribute 'id' for variable 'aws_route_table.r.id'
Resource 'aws_security_group.default' does not have attribute 'id' for variable 'aws_security_group.default.id'
Resource 'aws_security_group.default' does not have attribute 'id' for variable 'aws_security_group.default.id'
Resource 'aws_security_group.default' does not have attribute 'id' for variable 'aws_security_group.default.id'

@catsby catsby removed the waiting-response An issue/pull request is waiting for a response from the community label Oct 28, 2015
@catsby
Copy link
Contributor

catsby commented Oct 28, 2015

We'll proceed with adding a resource.Retry approach here, though I don't know when I'll get to it. Pull Requests accepted 😄

carlossg added a commit to carlossg/terraform that referenced this issue Apr 9, 2016
…ng from creation

Fix some random InvalidInternetGatewayID.NotFound errors
carlossg added a commit to cloudbees/terraform that referenced this issue Apr 11, 2016
carlossg added a commit to carlossg/terraform that referenced this issue Apr 11, 2016
carlossg added a commit to cloudbees/terraform that referenced this issue Apr 11, 2016
carlossg added a commit to carlossg/terraform that referenced this issue Apr 11, 2016
catsby pushed a commit that referenced this issue Apr 13, 2016
…reation (#6105)

* Issue #2174 Check that InternetGateway exists before returning from creation

Fix some random InvalidInternetGatewayID.NotFound errors

* Issue #2174 Reuse IGStateRefreshFunc

* Issue #2174 Need to wait for creation before setting tags
chrislovecnm pushed a commit to chrislovecnm/terraform that referenced this issue Apr 16, 2016
…ng from creation (hashicorp#6105)

* Issue hashicorp#2174 Check that InternetGateway exists before returning from creation

Fix some random InvalidInternetGatewayID.NotFound errors

* Issue hashicorp#2174 Reuse IGStateRefreshFunc

* Issue hashicorp#2174 Need to wait for creation before setting tags
carlossg added a commit to cloudbees/terraform that referenced this issue May 9, 2016
Fix some random InvalidInternetGatewayID.NotFound errors
@ghost
Copy link

ghost commented Apr 26, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants