Dealing with resources stuck in "deposed" state.

1,265 views
Skip to first unread message

Jonathan D. Proulx

unread,
Jun 28, 2017, 10:32:53 AM6/28/17
to Terraform

I have a set of 8 compute resources which just got torn down and
recreated with new backing image.

3 errored during deletion phase with timeouts unrelated to terraform
so I deleted them by hand, which clearly I shouldn't have done...

Now every time I run 'plan' it shows the 3 "deposed" resources to be
deleted and every time I run 'apply' it errors trying to delete them
because they don't exist.

I can see the deposed resources in the terraform.tfstate.backup file.
Presumably I could edit that and do a "state push" to make terraform
forget the deposed resources btu there has to be a better way, doesn't
there?

Thought about "state rm" but doesn't seem to be a way to distinguish
the existing active resource and the nonexistant deposed resource...

-Jon

Lowe Schmidt

unread,
Jun 28, 2017, 1:11:29 PM6/28/17
to terrafo...@googlegroups.com
What provider are you using?

--
Lowe Schmidt | +46 723 867 157


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/20170628143248.GB6780%40csail.mit.edu.
For more options, visit https://groups.google.com/d/optout.

Jonathan D. Proulx

unread,
Jun 28, 2017, 1:55:18 PM6/28/17
to terrafo...@googlegroups.com
On Wed, Jun 28, 2017 at 07:11:22PM +0200, Lowe Schmidt wrote:
: What provider are you using?

openstack

sorry didn't realize it would be provider specific.

-Jon

: --
: Lowe Schmidt | +46 723 867 157
: On 28 June 2017 at 16:32, Jonathan D. Proulx <[1]j...@csail.mit.edu>
: wrote:
:
: I have a set of 8 compute resources which just got torn down and
: recreated with new backing image.
: 3 errored during deletion phase with timeouts unrelated to terraform
: so I deleted them by hand, which clearly I shouldn't have done...
: Now every time I run 'plan' it shows the 3 "deposed" resources to be
: deleted and every time I run 'apply' it errors trying to delete them
: because they don't exist.
: I can see the deposed resources in the terraform.tfstate.backup
: file.
: Presumably I could edit that and do a "state push" to make terraform
: forget the deposed resources btu there has to be a better way,
: doesn't
: there?
: Thought about "state rm" but doesn't seem to be a way to distinguish
: the existing active resource and the nonexistant deposed resource...
: -Jon
: --
: This mailing list is governed under the HashiCorp Community
: Guidelines - [2]https://www.hashicorp.com/community-guidelines.html.
: Behavior in violation of those guidelines may result in your removal
: from this mailing list.
: GitHub Issues: [3]https://github.com/hashicorp/terraform/issues
: IRC: #terraform-tool on Freenode
: ---
: You received this message because you are subscribed to the Google
: Groups "Terraform" group.
: To unsubscribe from this group and stop receiving emails from it,
: send an email to [4]terraform-too...@googlegroups.com.
: To view this discussion on the web visit
: [5]https://groups.google.com/d/msgid/terraform-tool/
: 20170628143248.GB6780%40csail.mit.edu.
: For more options, visit [6]https://groups.google.com/d/optout.
:
: --
: This mailing list is governed under the HashiCorp Community Guidelines
: - [7]https://www.hashicorp.com/community-guidelines.html. Behavior in
: violation of those guidelines may result in your removal from this
: mailing list.
:
: GitHub Issues: [8]https://github.com/hashicorp/terraform/issues
: IRC: #terraform-tool on Freenode
: ---
: You received this message because you are subscribed to the Google
: Groups "Terraform" group.
: To unsubscribe from this group and stop receiving emails from it, send
: an email to [9]terraform-too...@googlegroups.com.
: To view this discussion on the web visit
: [10]https://groups.google.com/d/msgid/terraform-tool/CAC-wWcSYT-B5RyL%2
: BhGsT_ambDbupEAPTETbdY6RbQKeweqMs1g%40mail.gmail.com.
: For more options, visit [11]https://groups.google.com/d/optout.
:
:References
:
: 1. mailto:j...@csail.mit.edu
: 2. https://www.hashicorp.com/community-guidelines.html
: 3. https://github.com/hashicorp/terraform/issues
: 4. mailto:terraform-too...@googlegroups.com
: 5. https://groups.google.com/d/msgid/terraform-tool/2017062814...@csail.mit.edu
: 6. https://groups.google.com/d/optout
: 7. https://www.hashicorp.com/community-guidelines.html
: 8. https://github.com/hashicorp/terraform/issues
: 9. mailto:terraform-too...@googlegroups.com
: 10. https://groups.google.com/d/msgid/terraform-tool/CAC-wWcSYT-B5RyL+hGsT_amb...@mail.gmail.com?utm_medium=email&utm_source=footer
: 11. https://groups.google.com/d/optout

Joe Topjian

unread,
Jun 28, 2017, 7:59:42 PM6/28/17
to terrafo...@googlegroups.com
This might be a bug in the OpenStack provider if the resource doesn't exist and Terraform isn't catching that. I say "might" because it's always possible you've hit some unique OpenStack-y issue with how the resource was deleted and any amount of accounting for in the provider won't help. :)

Could you open an issue at https://github.com/terraform-providers/terraform-provider-openstack? Best case scenario is if you do "openstack --debug server show <uuid>" and a 404 is being returned. If/when you file the issue, let me know the result of that command.

In general, I think any of the providers are susceptible to this issue. It's possible that the resource is in an odd state that the provider hasn't accounted for (whether by error, modification outside of Terraform, etc). In this case, I would imagine the best things to do are to report a bug and, in the meantime, modify the Terraform state. I could be wrong about that, though, and please correct me if I am.

:     send an email to [4]terraform-tool+unsubscribe@googlegroups.com.
:     To view this discussion on the web visit
:     [5]https://groups.google.com/d/msgid/terraform-tool/
:     20170628143248.GB6780%40csail.mit.edu.
:     For more options, visit [6]https://groups.google.com/d/optout.
:
:   --
:   This mailing list is governed under the HashiCorp Community Guidelines
:   - [7]https://www.hashicorp.com/community-guidelines.html. Behavior in
:   violation of those guidelines may result in your removal from this
:   mailing list.
:
:   GitHub Issues: [8]https://github.com/hashicorp/terraform/issues
:   IRC: #terraform-tool on Freenode
:   ---
:   You received this message because you are subscribed to the Google
:   Groups "Terraform" group.
:   To unsubscribe from this group and stop receiving emails from it, send
:   an email to [9]terraform-tool+unsubscribe@googlegroups.com.
:   To view this discussion on the web visit
:   9. mailto:terraform-tool+unsub...@googlegroups.com
:  10. https://groups.google.com/d/msgid/terraform-tool/CAC-wWcSYT-B5RyL+hGsT_ambDbupEAPTETbdY6RbQKeweqMs1g@mail.gmail.com?utm_medium=email&utm_source=footer
:  11. https://groups.google.com/d/optout

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/terraform/issues

IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/20170628175512.GC6780%40csail.mit.edu.

Jonathan Proulx

unread,
Jun 29, 2017, 10:29:18 AM6/29/17
to terrafo...@googlegroups.com
On Wed, Jun 28, 2017 at 05:59:37PM -0600, Joe Topjian wrote:
:This might be a bug in the OpenStack provider if the resource doesn't exist
:and Terraform isn't catching that. I say "might" because it's always
:possible you've hit some unique OpenStack-y issue with how the resource was
:deleted and any amount of accounting for in the provider won't help. :)

It looks normal to me, but my expectation are definitely warped in an
OpenStacky way :)

:Could you open an issue at
:https://github.com/terraform-providers/terraform-provider-openstack? Best
:case scenario is if you do "openstack --debug server show <uuid>" and a 404
:is being returned. If/when you file the issue, let me know the result of
:that command.

https://github.com/terraform-providers/terraform-provider-openstack/issues/44

openstack CLI debug at:
https://gist.github.com/jon-proulx/141b6bd9d9811a124069c2bc42ae7642

:In general, I think any of the providers are susceptible to this issue.
:It's possible that the resource is in an odd state that the provider hasn't
:accounted for (whether by error, modification outside of Terraform, etc).
:In this case, I would imagine the best things to do are to report a bug
:and, in the meantime, modify the Terraform state. I could be wrong about
:that, though, and please correct me if I am.


if you think it useful for debugging/testing I can leave these in this
error state since it doesn't actually effect anything (yet anyway, if
I roll another image or something not sure how terraform will like
multiple deposed copies of a resource).

Thanks,
-Jon

:On Wed, Jun 28, 2017 at 11:55 AM, Jonathan D. Proulx <j...@csail.mit.edu>
:> : send an email to [4]terraform-too...@googlegroups.com.
:> : To view this discussion on the web visit
:> : [5]https://groups.google.com/d/msgid/terraform-tool/
:> : 20170628143248.GB6780%40csail.mit.edu.
:> : For more options, visit [6]https://groups.google.com/d/optout.
:> :
:> : --
:> : This mailing list is governed under the HashiCorp Community Guidelines
:> : - [7]https://www.hashicorp.com/community-guidelines.html. Behavior in
:> : violation of those guidelines may result in your removal from this
:> : mailing list.
:> :
:> : GitHub Issues: [8]https://github.com/hashicorp/terraform/issues
:> : IRC: #terraform-tool on Freenode
:> : ---
:> : You received this message because you are subscribed to the Google
:> : Groups "Terraform" group.
:> : To unsubscribe from this group and stop receiving emails from it, send
:> : an email to [9]terraform-too...@googlegroups.com.
:> : To view this discussion on the web visit
:> : [10]https://groups.google.com/d/msgid/terraform-tool/CAC-
:> wWcSYT-B5RyL%2
:> : BhGsT_ambDbupEAPTETbdY6RbQKeweqMs1g%40mail.gmail.com.
:> : 4. mailto:terraform-too...@googlegroups.com
:> : 5. https://groups.google.com/d/msgid/terraform-tool/
:> 2017062814...@csail.mit.edu
:> : 6. https://groups.google.com/d/optout
:> : 9. mailto:terraform-too...@googlegroups.com
:> : 10. https://groups.google.com/d/msgid/terraform-tool/CAC-
:> wWcSYT-B5RyL+hGsT_ambDb...@mail.gmail.com?utm_medium=
:> email&utm_source=footer
:> : 11. https://groups.google.com/d/optout
:>
:> --
:> This mailing list is governed under the HashiCorp Community Guidelines -
:> https://www.hashicorp.com/community-guidelines.html. Behavior in
:> violation of those guidelines may result in your removal from this mailing
:> list.
:>
:> GitHub Issues: https://github.com/hashicorp/terraform/issues
:> IRC: #terraform-tool on Freenode
:> ---
:> You received this message because you are subscribed to the Google Groups
:> "Terraform" group.
:> To unsubscribe from this group and stop receiving emails from it, send an
:> email to terraform-too...@googlegroups.com.
:> To view this discussion on the web visit https://groups.google.com/d/
:> msgid/terraform-tool/20170628175512.GC6780%40csail.mit.edu.
:> For more options, visit https://groups.google.com/d/optout.
:>
:
:--
:This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
:
:GitHub Issues: https://github.com/hashicorp/terraform/issues
:IRC: #terraform-tool on Freenode
:---
:You received this message because you are subscribed to the Google Groups "Terraform" group.
:To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
:To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/CA%2By7hvgXTo4XhCR3Pyi0ht6p_q3U09tytToLXRUZtRcyko8TFg%40mail.gmail.com.
:For more options, visit https://groups.google.com/d/optout.

--
Reply all
Reply to author
Forward
0 new messages