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

Terraform rpc error + panic runtime error when trying to create QnAMaker with azurerm_cognitive_account resource #8355

Closed
kevroes opened this issue Sep 4, 2020 · 3 comments · Fixed by #8357

Comments

@kevroes
Copy link

kevroes commented Sep 4, 2020

Hi there, I'm running into some issues when using Terraform to deploy infrastructure on Azure. Ich was trying to create a QnAMaker with Terraform. Please find all required information below.

Thanks a lot for the help in advance.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.13.2
+ provider registry.terraform.io/hashicorp/azuread v1.0.0
+ provider registry.terraform.io/hashicorp/azurerm v2.26.0

Affected Resource(s)

  • azurerm_cognitive_account

Terraform Configuration Files

resource "azurerm_app_service_plan" "qnamaker" {
  name                = format("%s-%s-qna", var.project, terraform.workspace)
  location            = azurerm_resource_group.project.location
  resource_group_name = azurerm_resource_group.project.name
  kind = "app"

  sku {
    tier = "Standard"
    size = "S1"
  }
}

resource "azurerm_app_service" "qnamaker" {
  name                = format("%s-%s-qna", var.project, terraform.workspace)
  location            = azurerm_resource_group.project.location
  resource_group_name = azurerm_resource_group.project.name
  app_service_plan_id = azurerm_app_service_plan.qnamaker.id
  client_affinity_enabled = true

  site_config {
    dotnet_framework_version = "v4.0"
    php_version = "5.6"
    remote_debugging_enabled = false
    use_32_bit_worker_process = true
    websockets_enabled = false
    always_on = false
    managed_pipeline_mode = "Integrated"
    default_documents = [
                    "Default.htm",
                    "Default.html",
                    "Default.asp",
                    "index.htm",
                    "index.html",
                    "iisstart.htm",
                    "default.aspx",
                    "index.php",
                    "hostingstart.html"
    ]
    cors {
      allowed_origins = [
        "*"
      ]
    }
  }

  tags = {
    format("hidden-related:%s", azurerm_app_service_plan.qnamaker.id): "empty"
  }
}

resource "azurerm_search_service" "qnamaker" {
  name                = format("%s-%s-qna", var.project, terraform.workspace)
  resource_group_name = azurerm_resource_group.project.name
  location            = azurerm_resource_group.project.location
  sku                 = "standard"
}

resource "azurerm_cognitive_account" "qnamaker" {
  name                = format("%s-%s-qna", var.project, terraform.workspace)
  location            = azurerm_resource_group.project.location
  resource_group_name = azurerm_resource_group.project.name
  kind                = "QnAMaker"
  sku_name = "S0"
  qna_runtime_endpoint = format("https://%s.azurewebsites.net", azurerm_app_service.qnamaker.name)
}

Debug Output

https://gist.github.com/kevroes/3967225fb7a3324d637cd0c0741d4d15

Panic Output

https://gist.github.com/kevroes/b7c084636eac7f1d34d0a9bd7cf59a29

Expected Behavior

The Cognitive Service Account QnAMaker should have been created, using the App Service as QnAMaker Runtime. No Error should occur.

Actual Behavior

While creating the Cognitive Service Account (kind: "QnAMaker") Terraform crashed, with a rpc error and panic runtime error. The resource hasn't been created.

Steps to Reproduce

  1. terraform apply

Important Factoids

Running on local machine in Windows Powershell.

@tombuildsstuff
Copy link
Contributor

Relevant section from the crash log:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x352c67b]

goroutine 116 [running]:
github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cognitive.resourceArmCognitiveAccountCreate(0xc0009dd1f0, 0x40a68e0, 0xc000176280, 0x0, 0x0)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cognitive/cognitive_account_resource.go:165 +0x5cb
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0004a3e60, 0xc000796f50, 0xc000db0780, 0x40a68e0, 0xc000176280, 0x40cdc01, 0xc00050b208, 0xc00081db00)
	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource.go:310 +0x36c

@ghost
Copy link

ghost commented Sep 10, 2020

This has been released in version 2.27.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.27.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Oct 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants