Open sandnabba opened 4 years ago
Thanks for sending. Sorry it crashed, that's not ideal. I see that some alert conditions are being set to to have a threshold of "0" which we figured out would fail due to a bug in the Go client but was fixed in here: https://github.com/appoptics/appoptics-api-go/pull/70
I think we should probably update the client dependency to the latest version and perhaps re-run. If you wanted to give it a shot, you can run dep ensure -update github.com/appoptics/appoptics-api-go
to upgrade that dependency and then recompile.
Hi again!
I actually don't know why it looks like the threshold is 0. It is not, and has never been. The alert has been created by Terraform in the first place, so it should never have been able to be created with that value. Could it be some kind of default value in any way? Like defaulting to 0 / false if there is no value set? I would also assume that the state might be somewhat broken, since Terraform crashed.
Anyways, Terraform has been crashing several times now, and It's actually causing so many issues that I'm unable to work with it anymore. It seems to be related to how many alerts I have defined.
I just tried to change the alert condition for 24 alerts. They where all setup correctly, and a terraform plan
showed no changes.
Then I did a small change in the alert condition (duration 600 -> 60), and applied.
On the first run, it successfully changed the condition of 11 alerts before crashing.
The next plan said:
Plan: 0 to add, 13 to change, 0 to destroy
After applying the above change, terraform crashed almost instantly.
The next plan said:
Plan: 22 to add, 0 to change, 0 to destroy.
And now the apply fails for every alert:
Error: Error applying plan:
22 error(s) occurred:
It is failing because all of the alerts are already exists in AO. So in some way the alerts has been removed from the state. However, it is not crashing anymore. So the crash seems to be related to doing a lot of actual changes at the same time?
Hey guys I'm just now seeing this thread (was at Tech Summit in Brno all last week and basically didn't check on anything else). We've landed the PR mentioned above. I'm going to be doing dev on this thing all week this week, so I may reach out with some questions.
@sandnabba FYI in Go, you can't have un-initialized memory (for safety reasons), so every type (and therefore every member of a struct) has a "zero value". The zero value of any Int type is, well, 0
. That's what's going on here.
Today, when applying some changes, Terraform crashed with this message:
Efter running apply again, it now crashes with:
I think that the crashes in because it's trying to create an alert that already exists.
I'll try to clean up my state to see if I can reproduce this error.