Yelp / terraform-provider-signalform

SignalForm is a terraform provider to codify SignalFx detectors, charts and dashboards
Apache License 2.0
44 stars 26 forks source link

400 "Failed to deserialize payload" when creating a dashboard #39

Closed ghost closed 5 years ago

ghost commented 5 years ago

We have a (somewhat simple) signalform_dashboard resource being created.

See gist: https://gist.github.com/cb-tjuricek/5d4711493c061f83da0de0e3b93fe380

When attempting to apply, even with the TF_LOG=TRACE variable set, the only information we receive is the following:

2018-10-19T09:01:11.386-0700 [DEBUG] plugin.terraform-provider-signalform: 2018/10/19 09:01:11 [ERR] plugin: stream copy 'stderr' error: stream closed
2018-10-19T09:01:11.386-0700 [DEBUG] plugin.terraform-provider-signalform: 2018/10/19 09:01:11 [ERR] plugin: plugin server: accept unix /Users/tjuricek/Desktop/reno/plugin158257377: use of closed network connection
* signalform_dashboard.cache_layer: For the resource CbDefense Central Cache Layer SignalFx returned status 400: 
{
  "code" : 400,
  "message" : "Failed to deserialize payload"
}

This is a little hard to interpret - is there a way to get more details from the plugin?

I've double checked all chart IDs referenced, and they exist and the charts themselves all appear to be created. It's only this dashboard resource failing.

liorrozen commented 5 years ago

@cb-tjuricek - Not sure if we are experiencing the same underlying issue, but I also hit this same "Failed to deserialize payload" error when attempting to create a dashboard. For me, the issue was that I needed to create a dashboard_group resource and reference it when creating the actual dashboard. I had missed the note talking about this in the docs.

Once I created the group as part of the terraform plan I was able to create and modify the dashboard without problems.

resource "signalform_dashboard_group" "dash_grp1" {
  name        = "Terraformed Dashboard Group"
  description = "Phenomenal cosmic powers!"
}

resource "signalform_dashboard" "dash_1" {
  name            = "Terraformed Dashboard"
  dashboard_group = "${signalform_dashboard_group.dash_grp1.id}"

  time_range = "-1h"
}

That being said, I see that you are referencing a dashboard group that I assume is defined elsewhere - perhaps specifying the dashboard_group id instead of the name would also help.

ghost commented 5 years ago

Thanks @liorrozen - by creating a signalform_dashboard_group resource and referencing it by id, that got around the 400 error. It may have been referencing a group that didn't yet exist.

If there's any way to get more details out of SignalFX - that would be helpful, but ... at least we have this issue now. :)