sumaform icon indicating copy to clipboard operation
sumaform copied to clipboard

terraform destroy fails when there were problems provisioning the environment

Open juliogonzalez opened this issue 7 years ago • 6 comments

With errors such as:

  • module.minsles12sp3.module.minion.output.configuration: variable "domain" is nil, but no error was reported

However terraform destroy works fine when the environment was fully created.

Not sure if this is a sumaform or libvirt provider issue.

Reproducing should be easy: run terraform apply then in the middle of the salt run for one of the instances, stop terraform.

Run terraform destroy

As an alternative, provoke a failure at one of the salt states by changing it at the local clone, run apply, wait until it fails, then run destroy.

juliogonzalez avatar Oct 15 '18 13:10 juliogonzalez

:+1: (as @juliogonzalez requested). Poor @moio ;)

keichwa avatar Oct 15 '18 13:10 keichwa

@keichwa or poor @MalloZup, as it could be a problem at the provider :-\

juliogonzalez avatar Oct 15 '18 14:10 juliogonzalez

It seems @MalloZup has the explanation about this, so he will post it soon.

juliogonzalez avatar Oct 15 '18 15:10 juliogonzalez

@juliogonzalez are there news?

moio avatar Aug 29 '19 12:08 moio

Well, this is happening yet, yes. Yesterday, for example, @srbarrios had to remove an environment manually because of this (in fact he created now a bash script to do it, as otherwise it's a PITA).

But I see @MalloZup didn't add the explanation. @MalloZup?

juliogonzalez avatar Aug 29 '19 13:08 juliogonzalez

looking only at the errror msg module.minsles12sp3.module.minion.output.configuration: variable "domain" is nil, but no error was reported it seems to me more a HCL error rather then a provider errror.

Perhaps I would need a more in deep report likw with TF_LOG=DEBUG and all the steps needed. To me seeing this error, seems that tfstate file doesn't have all IDs or variable set for some X reason.

However we might need a more precise report to see if the PB is on the way you write HCL in sumaform or if it is a provider issue.

A good thing would be to try to reproduce without sumaform and having a reproduction way for that. Or having are more precise issue here. Both are welcome. In any case feel free also when is the case to open an issue upstream

MalloZup avatar Aug 29 '19 13:08 MalloZup