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

AWS: Skip DetachVolume if volume is not attached #9023

Merged
merged 3 commits into from Oct 3, 2016

Conversation

Jonnymcc
Copy link
Contributor

I manually terminated an instance thus putting the EBS volume in an "available" state. When running terraform apply I got this error...

* aws_volume_attachment.jira_data_volume: Failed to detach Volume (vol-8237ff0d) from Instance (i-8d44ef87): IncorrectState: Volume 'vol-1537ff1d'is in the 'available' state.
    status code: 400, request id: e0fc1368-c2c5-4a9d-83c9-e958c8ee3ca2

This change appears to have fixed the problem. I ran terraform apply and the aws_volume_attachment resource was deleted as expected.

return fmt.Errorf("Error reading EC2 volume %s: %s", vID, desc_err)
}

if *attr.Volumes[0].State == "available" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put a guard here to protect us from the off chance that attr.Volumes is nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label Sep 28, 2016
@Jonnymcc Jonnymcc force-pushed the destroying-detached-vol-attch-res branch from cb79323 to dc4a7b7 Compare September 30, 2016 18:12
@catsby
Copy link
Member

catsby commented Oct 3, 2016

Thanks!

@catsby catsby merged commit f1c5f84 into hashicorp:master Oct 3, 2016
@ghost
Copy link

ghost commented Apr 21, 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.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants