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

Error: rpc error: code = Unavailable desc = transport is closing with datadog 2.19.1 #847

Closed
venthur opened this issue Jan 20, 2021 · 4 comments

Comments

@venthur
Copy link
Contributor

venthur commented Jan 20, 2021

I think the problem is related to dashboards that have no id, i.e. new dashboards.

Terraform Version

Terraform v0.14.4
+ provider registry.terraform.io/datadog/datadog v2.19.1
+ provider registry.terraform.io/hashicorp/aws v3.24.1
+ provider registry.terraform.io/hashicorp/kubernetes v1.13.3

Affected Resource(s)

Please list the resources as a list, for example:

  • datadog_dashboard

I have two dashboards (and nothing more datadog related) and the error message appears twice.

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

provider "datadog" {
  api_key = "..."
  app_key = "..."
  api_url = "https://api.datadoghq.eu/"
}

resource "datadog_dashboard" "Test" {
  title = "X"
  description = "Some Test Dasbhoard"
  layout_type = "ordered"
  is_read_only = true

  widget {
    change_definition {
      request {
        q = "avg:system.load.1{env:staging} by {account}"
        change_type = "absolute"
        compare_to = "week_before"
        increase_good = true
        order_by = "name"
        order_dir = "desc"
        show_present = true
      }
      title = "Widget Title"
      time = {
        live_span = "1h"
      }
    }
  }
}

resource "datadog_dashboard" "Test2" {
  title = "X"
  description = "Some Test Dasbhoard"
  layout_type = "free"

  widget { }
}

Debug Output

2021-01-20T08:52:08.124+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: 2021/01/20 08:52:08 [DEBUG] setting computed for "dashboard_lists_removed" from ComputedKeys
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: 2021/01/20 08:52:08 
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: POST /api/v1/dashboard HTTP/1.1
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Host: api.datadoghq.eu
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: User-Agent: terraform-provider-datadog/2.19.1 (terraform 1.15.0; terraform-cli 0.14.4) datadog-api-client-go/1.0.0-beta.13 (go go1.15.6; os linux; arch amd64)
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Content-Length: 482
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Accept: application/json
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Content-Type: application/json
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Dd-Api-Key: REDACTED
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Dd-Application-Key: REDACTED
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Dd-Operation-Id: CreateDashboard
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: Accept-Encoding: gzip
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: 
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: {"description":"Some Test Dasbhoard","id":"","is_read_only":true,"layout_type":"ordered","notify_list":[],"template_variable_presets":[],"template_variables":[],"title":"[BFR] Test Timeboard","widgets":[{"definition":{"requests":[{"change_type":"absolute","compare_to":"week_before","increase_good":true,"order_by":"name","order_dir":"desc","q":"avg:system.load.1{env:staging} by {account}","show_present":true}],"time":{"live_span":"1h"},"title":"Widget Title","type":"change"}}]}
2021-01-20T08:52:08.125+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: 
2021-01-20T08:52:08.138+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: 2021/01/20 08:52:08 [DEBUG] setting computed for "dashboard_lists_removed" from ComputedKeys
2021-01-20T08:52:08.142+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: panic: interface conversion: interface {} is nil, not map[string]interface {}
2

Panic Output

2021-01-20T08:52:08.142+0100 [DEBUG] plugin.terraform-provider-datadog_v2.19.1: panic: interface conversion: interface {} is nil, not map[string]interface {}

Expected Behavior

Dashboards should be created.

Actual Behavior

Nothing, except the error message.

Steps to Reproduce

  1. terraform apply

Important Factoids

nope

References

@therve
Copy link
Contributor

therve commented Jan 20, 2021

Hello, I believe the issue is with the empty widget: widget { }. Can you try without that? We'll try to improve error detection. Thanks.

@venthur
Copy link
Contributor Author

venthur commented Jan 20, 2021

you're right, removing the second dashboard without the empty widget solves the problem.

@therve
Copy link
Contributor

therve commented Jan 20, 2021

I think that problem has been worked around with #815 . We'll release it soon.

@therve
Copy link
Contributor

therve commented Jan 20, 2021

Should be fixed in 2.20.0, thanks!

@therve therve closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants