Coder Social home page Coder Social logo

cannot unmarshal string into Go struct field Yaxis.min of type float64 after upgrading to 0.10.3 about terraform-provider-datadog HOT 11 CLOSED

datadog avatar datadog commented on September 18, 2024 2
cannot unmarshal string into Go struct field Yaxis.min of type float64 after upgrading to 0.10.3

from terraform-provider-datadog.

Comments (11)

RodrigoBerto avatar RodrigoBerto commented on September 18, 2024

any progress on this?

from terraform-provider-datadog.

nyanshak avatar nyanshak commented on September 18, 2024

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?

from terraform-provider-datadog.

davidalger avatar davidalger commented on September 18, 2024

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.

  "yaxis": {
    "max": "100",
    "min": "0"
  }

The above is generated by the Datadog UI whereas Terraform is generating the following:

  "yaxis": {
    "max": 100,
    "min": 0
  }

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:

datadog_timeboard.system_status: datadog_timeboard.system_status: json: cannot unmarshal string into Go struct field Yaxis.max of type float64

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.

min - (Optional) Minimum bound for the graph's yaxis, a string.
max - (Optional) Maximum bound for the graph's yaxis, a string.

This is on Terraform v0.10.8 with terraform-provider-datadog_v1.0.0.

from terraform-provider-datadog.

NabilZaman avatar NabilZaman commented on September 18, 2024

I have also been running into this issue, has there been any progress on resolving this or any workarounds?
EDIT: Okay, well it seems the obvious workaround of removing the yaxis block from within the UI (I had to go into the JSON tab and delete that manually) works.
Would still be swell to be compatible with whatever remote state the datadog API generates.

from terraform-provider-datadog.

lachlancooper avatar lachlancooper commented on September 18, 2024

This is being tracked on the vendored SDK here: zorkian/go-datadog-api#103

from terraform-provider-datadog.

robinbowes avatar robinbowes commented on September 18, 2024

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?

from terraform-provider-datadog.

johansnow avatar johansnow commented on September 18, 2024

This issue still remains in Datadog provider version 1.2.

from terraform-provider-datadog.

nyanshak avatar nyanshak commented on September 18, 2024

Raised #92 to fix this issue by bumping go-datadog-api library version number.

from terraform-provider-datadog.

masci avatar masci commented on September 18, 2024

Closing since fix was implemented in #91 and released in 1.3.0

from terraform-provider-datadog.

rodush avatar rodush commented on September 18, 2024

Reproduced in 1.6.0

from terraform-provider-datadog.

tomasaberg avatar tomasaberg commented on September 18, 2024

Hi!

I still have this problem in datadog v2.0.2

terraform providers -v
Terraform v0.12.3
+ provider.datadog v2.0.2

How I can reproduce this is:

  1. Create a simple screenboard
  2. Go to https://app.datadoghq.com/monitors/manage and check out your new dashboard.
  3. Click Edit
  4. Make no changes at all
  5. Press Save
  6. Run Terraform and receive this message.

Is there a workaround available?

from terraform-provider-datadog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.