digitalocean / terraform-provider-digitalocean

Terraform DigitalOcean provider
https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs
Mozilla Public License 2.0
511 stars 279 forks source link

digitalocean_app panic #1176

Closed iwahbe closed 4 months ago

iwahbe commented 5 months ago

Bug Report


Describe the bug

The provider panics when trying to create an app with cors rules.

Affected Resource(s)

Expected Behavior

The provider plugin should never panic, it should either error or create the resource.

Actual Behavior

The provider panicked.

Steps to Reproduce

  1. terraform apply
  2. Type "yes"

Terraform Configuration Files

terraform {
  required_providers {
    digitalocean = {
      source  = "digitalocean/digitalocean"
      version = "2.39.2"
    }
  }

  required_version = ">= 1.2.0"
}

provider "digitalocean" {}

resource "digitalocean_app" "repro" {
  spec {
    name   = "[REDACTED]"
    region = "nyc3"
    ingress {
      rule {
        cors {
          allow_methods = ["GET", "POST", "PUT", "DELETE"]
        }
      }
    }
  }
}

Terraform version

Terraform v1.8.3
on darwin_arm64
+ provider registry.terraform.io/digitalocean/digitalocean v2.39.2

Debug Output https://gist.github.com/iwahbe/c4964283aac63004f30dde99f7c730e6

Panic Output I didn't see a crash.log, but I have included the stdout of the crash (including the stack trace): https://gist.github.com/iwahbe/cde411cee6a75dd241ef7475d9b8ea71

Additional context

Important Factoids

References

andrewsomething commented 4 months ago

Thanks for flagging this issue! It was fixed in https://github.com/digitalocean/terraform-provider-digitalocean/pull/1184 and will be part of the next release.