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

Unable to update Dashboard #760

Open
KaoruDev opened this issue Dec 1, 2022 · 3 comments
Open

Unable to update Dashboard #760

KaoruDev opened this issue Dec 1, 2022 · 3 comments
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@KaoruDev
Copy link

KaoruDev commented Dec 1, 2022

What happened?

Updating a dashboard results in: Error 400: Update Dashboard should specify a non empty etag

Steps to reproduce

1 . Create a dashboard:

export const dashboard = new cloudDashboards.Dashboard("postgres", {
  displayName: "Postgres Metrics",
  name: `projects/me_project_id/dashboards/postgres-metrics`,
  mosaicLayout: {
    columns: 12,
    tiles: [
      {
        height: 1,
        widget: {
          text: {
            content: "# Test One two \nDis be a test mon",
            format: cloudTypes.enums.monitoring.v1.TextFormat.Markdown,
          },
        },
        width: 12,
        xPos: 0,
        yPos: 0,
      },
    ],
  },
});
  1. Run Pulumi up
  2. Change width to 3
  3. Run Pulumi up and see failure

Expected Behavior

Updates the dashboard

Actual Behavior

Fails with:

Error 400: Update Dashboard should specify a non empty etag.: "https://monitoring.googleapis.com/v1/projects/me_project_id/dashboards/postgres-metrics" map[displayName:Postgres Metrics mosaicLayout:map[columns:12 tiles:[map[height:1 widget:map[text:map[content:# Test One two
    Dis be a test mon format:MARKDOWN]] width:12 xPos:0 yPos:0]]] name:projects/binti-us-family-dev/dashboards/postgres-metrics]

Output of pulumi about

CLI
Version      3.46.1
Go Version   go1.19.2
Go Compiler  gc

Plugins
NAME    VERSION
nodejs  unknown

Host
OS       darwin
Version  12.6.1
Arch     x86_64

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@KaoruDev KaoruDev added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 1, 2022
@KaoruDev
Copy link
Author

KaoruDev commented Dec 1, 2022

Deleting and creating a replace works around this issue -- still not ideal tho 😞

@lblackstone lblackstone removed the needs-triage Needs attention from the triage team label Dec 1, 2022
@lblackstone
Copy link
Member

This looks like a similar issue to #264 and #323. Probably a bug in the update schema mapping for this resource.

@StevePotter
Copy link

StevePotter commented Dec 11, 2023

This was a problem for me in the legacy provider as well. The only reason I switched from legacy to gcp native was the strong type support for dashboards, as you had to serialize everything into JSON in the legacy provider. I was surprised to not see the etag issue addressed.

See the etag property in their docs:

etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. An etag is returned in the response to dashboards.get, and users are expected to put that etag in the request to dashboards.patch to ensure that their change will be applied to the same version of the Dashboard configuration. The field should not be passed during dashboard creation.

I'm not a pulumi engineer, but I assume the fix involves grabbing the etag from the state and including that in the Dashboard object before serializing to json.

As it stands, it's broken. At least update the documentation and samples, or somehow make it replace as a default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants