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

error when destroying a vpc #1628

Closed
ryanking opened this issue Apr 22, 2015 · 12 comments · Fixed by #2532
Closed

error when destroying a vpc #1628

ryanking opened this issue Apr 22, 2015 · 12 comments · Fixed by #2532
Assignees

Comments

@ryanking
Copy link
Contributor

I consistently get this error when trying to destroy a VPC:

  • Network vpc-xxxxxxxx has some mapped public address(es). Please unmap those public address(es) before detaching the gateway. (DependencyViolation)

When that happens I'm left in a state where I basically have to go through and delete everything by hand.

I know destroying a VPC is probably rare, but its useful during the initial setup (create vpc, add some things, destroy, add some more things, apply, etc.).

@bitglue
Copy link

bitglue commented Apr 23, 2015

What are the addresses still in the VPC? Do they relate to something else in your Terraform configuration? Terraform can only delete things in the VPC first if in knows about them, otherwise it might inadvertently delete something it did not create, which is probably undesirable. There are also some bugs (#922, #1582) related to modules and dependencies.

@ryanking
Copy link
Contributor Author

Sorry but I don't have the VPC sitting around anymore. I know there were some elastic IPs in there, but there were some other mappings too.

@phinze
Copy link
Contributor

phinze commented Apr 24, 2015

@ryanking Sorry you hit this - I've been in the same situation and it's super frustrating to have to go and clean up everything manually.

I think we might be able to file this under one of the existing bugs to keep things consolidated. Was the VPC defined in a module?

Tagged in the meantime.

@ryanking
Copy link
Contributor Author

It was not defined in a module.

@arubis
Copy link

arubis commented Apr 29, 2015

I run into this pretty much every time I do a destroy with my current setup.

@saulshanabrook
Copy link

Same I also hit this every time I destroy.

3

@catsby
Copy link
Contributor

catsby commented May 12, 2015

Can anyone contribute a configuration that reproduces this and omits any secrets?
I'd like to debug and try and patch if possible.

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label May 12, 2015
@mikeyhill
Copy link

I just had this happen and it occurs maybe 1 out of 4 destructions, but I haven't been able to determine the cause. I have my VPC provisioned in a module and when this does occur Terraform freezes up on a EIP destruction. So-far I've been lucky that all the resources were destroyed aside from a stray launch config that seems to linger around. I'll see if I can replicate this consistently and send my config (it's pretty large so is there something specific you need?)

@mikeyhill
Copy link

Actually just noticed it happened again while I was typing this but froze up in a different place (aws_vpc.main-vpc: Destruction complete) and left two launch configs behind.

@saulshanabrook
Copy link

@catsby I will isolate a configuration later today.

@catsby
Copy link
Contributor

catsby commented May 12, 2015

@saulshanabrook thanks! It's likely a eventual consistency thing with AWS waiting on this or that to shut down in order to destroy. Something else gets a head of itself in deleting and errors out.

We can either instruct people to use depends_on, or try a more graceful polling approach. Depends on the situation

@mitchellh mitchellh self-assigned this Jun 27, 2015
@mitchellh mitchellh removed the waiting-response An issue/pull request is waiting for a response from the community label Jun 27, 2015
mitchellh added a commit that referenced this issue Jun 29, 2015
provider/aws: vpc delete retry on dependency violation [GH-1628]
@ghost
Copy link

ghost commented May 1, 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 May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants