rollbar / terraform-provider-rollbar

Terraform provider for Rollbar
https://rollbar.com
MIT License
28 stars 13 forks source link

Team resouce after created saves "null" IDs since ver 1.11.0 #368

Closed JJaakson closed 1 year ago

JJaakson commented 1 year ago

Recently discovered with terraform-provider-rollbar version 1.13.0 I would get this error message after creating a new team with this provider (and every plan afterwards):

╷
│ Error: id must be non-zero
│ 
│   with rollbar_team.Jjaakson_test_9,
│   on main.tf line 15, in resource "rollbar_team" "Jjaakson_test_9":
│   15: resource "rollbar_team" "Jjaakson_test_9" {
│ 
╵

And after inspecting the "generated" local .tfstate file I saw that:

...
          "attributes": {
            "access_level": "standard",
            "account_id": null,
            "id": "0",
            "name": "Jjaakson test 9"
          },
...

Found out that when I used Rollbar provider version 1.10.0, this error did not occur. Only difference for creating teams between versions 1.10.0 and 1.13.0 are that when creating the object it does not get client.Mutex.Lock() "locked" in the older version.


This is what I used in my .tf file:

terraform {
  required_providers {
    rollbar = {
      source = "rollbar/rollbar"
      version = "1.13.0"
    }
  }
}

provider "rollbar" {
  api_key = "token placeholder"
}

resource "rollbar_team" "Jjaakson_test_9" {
  name = "Jjaakson test 9"
}
ghost commented 1 year ago

@JJaakson Thanks for reporting this issue. I suspect this issue might have the same root cause as #359. We'll look into this, and I'll get back to you with a fix.

ghost commented 1 year ago

@JJaakson We decided to remove the mutexes in question from the code. We expect these transient errors to disappear. Additionally, running your config will be slightly faster too.

ghost commented 1 year ago

@JJaakson Hold on. We suspect an issue with our API that can cause the problem you reported. We need to look into this more. I'll keep you posted.

ghost commented 1 year ago

@JJaakson We released an API fix a few weeks ago that resolves this issue. Feel free to reopen this issue if you still bump into this issue again.