-
Notifications
You must be signed in to change notification settings - Fork 383
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
cannot unmarshal string into Go struct field Yaxis.min of type float64 after upgrading to 0.10.3 #19
Comments
any progress on this? |
I haven't been able to reproduce this (tried going from 0.10.2 to 0.10.3, as well as from 0.9.0 to 0.10.3). I'm not sure which datadog plugin version you were using, but I suspect this issue has been fixed. @RodrigoBerto, can you confirm and close or provide more info on the problem? |
I've run across this myself…and discovered it stems from the the yaxis config block generating different JSON than the Datadog UI does. The following blip in the JSON will cause the import to fail.
The above is generated by the Datadog UI whereas Terraform is generating the following:
This breaks the import as well as continued use of a Terraform plan. I.e. if I alter a time board from the Datadog UI, setting the y-axis values, the JSON will now have strings instead of floats resulting in the following output on a plan run:
The Terraform docs still state these should be strings and strings are in fact what the HCL expects, but for some reason it would appear that a float is being used internally.
This is on Terraform v0.10.8 with terraform-provider-datadog_v1.0.0. |
I have also been running into this issue, has there been any progress on resolving this or any workarounds? |
This is being tracked on the vendored SDK here: zorkian/go-datadog-api#103 |
This looks similar to https://github.com/terraform-providers/terraform-provider-datadog/issues/10 which was fixed upstream, ie. Datadog fixed their API frontend to send int not string. Do they need to do the same here? |
This issue still remains in Datadog provider version 1.2. |
* v2.13.0 of go-datadog-api library adds a custom unmarshaller for Yaxis struct, which can properly handle the issue where strings (e.g. "99") for yaxis.max would cause the tf provider to bail out.
Raised #92 to fix this issue by bumping go-datadog-api library version number. |
Closing since fix was implemented in #91 and released in 1.3.0 |
Reproduced in 1.6.0 |
Hi! I still have this problem in datadog v2.0.2
How I can reproduce this is:
Is there a workaround available? |
Running terraform plan or apply over existent terraform datadog timeboards resulted in a
json: cannot unmarshal string into Go struct field Yaxis.min of type float64
errorNote that despite the error is happening with terraform v0.10.3, I was able to push changes to datadog with this version of terraform until 31/08. But since early September, it has started to fail with that error.
Deleting existent terraform.state and re running plan or apply using the same timeboard configuration works. But doing this will duplicate information in ddog as it will recreate all resources.
The following is how the graph looks atm:
And in terraform.state it is shown as
Terraform Version
v0.10.3
Affected Resource(s)
datadog_timeboard
Expected Behavior
The state file should have been modified with the new added configuration in the datadog timeboard
Actual Behavior
Terraform plan or apply is failing. The error reads
json: cannot unmarshal string into Go struct field Yaxis.min of type float64
Steps to Reproduce
The text was updated successfully, but these errors were encountered: