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

azurerm_bot_service_azure_bot: plugin crashed with 3.84.0 (interface {} is bool, not string) #24163

Closed
1 task done
patst opened this issue Dec 8, 2023 · 2 comments · Fixed by #24164
Closed
1 task done

Comments

@patst
Copy link
Contributor

patst commented Dec 8, 2023

Is there an existing issue for this?

  • I have searched the existing issues

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 and review the contribution guide to help.

We are using the azurerm_bot_service_azure_bot resource and after upgrading to 3.8.40 (from 3.83.0) the terraform apply crashes.

Terraform Version

1.6.5

AzureRM Provider Version

3.84.0

Affected Resource(s)/Data Source(s)

azurerm_bot_service_azure_bot

Terraform Configuration Files

resource "azurerm_bot_service_azure_bot" "chatbot" {
  name                = "bot"
  display_name        = "bla"
  resource_group_name = azurerm_resource_group.chatbot.name
  location            = var.bot_location
  microsoft_app_id    = azurerm_user_assigned_identity.chatbot.client_id

  microsoft_app_msi_id    = azurerm_user_assigned_identity.chatbot.id
  microsoft_app_tenant_id = azurerm_user_assigned_identity.chatbot.tenant_id
  microsoft_app_type      = "UserAssignedMSI"

  sku = "S1"

  endpoint = var.endpoint

  developer_app_insights_api_key        = azurerm_application_insights_api_key.chatbot.api_key
  developer_app_insights_application_id = azurerm_application_insights.chatbot.app_id
  developer_app_insights_key            = azurerm_application_insights.chatbot.instrumentation_key

}

Debug Output/Panic Output

module.chatbot.azurerm_bot_service_azure_bot.chatbot: Modifying... [id=/subscriptions/asdf/resourceGroups/rgbot/providers/Microsoft.BotService/botServices/bot]

Error: Request cancelled

  with module.chatbot.azurerm_bot_service_azure_bot.chatbot,
  on ../../../../../main.tf line 41, in resource "azurerm_bot_service_azure_bot" "bot":
  41: resource "azurerm_bot_service_azure_bot" "bot" {

The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.

Stack trace from the terraform-provider-azurerm_v3.84.0_x5 plugin:

panic: interface conversion: interface {} is bool, not string

goroutine 15 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/bot.(*AzureBotServiceResource).Update.AzureBotServiceResource.Update.botBaseResource.updateFunc.func1({0x99ab138, 0xc00143f960}, {0xc0014a9680, {0x99ad828, 0xc000011428}, 0xc001568e00, 0x0, {0x99ad9e8, 0xf58a8e0}})
	github.com/hashicorp/terraform-provider-azurerm/internal/services/bot/bot_service_resource_base.go:293 +0xa4c
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func7({0x99ab138, 0xc00143f960}, 0x0?, {0x820d2e0?, 0xc0014a9680?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:121 +0x150
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.(*ResourceWrapper).diagnosticsWrapper.diagnosticsWrapper.func13({0x99ab138?, 0xc00143f960?}, 0x0?, {0x820d2e0?, 0xc0014a9680?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:190 +0x59
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc000562ee0, {0x99ab090, 0xc0029f78c0}, 0xd?, {0x820d2e0, 0xc0014a9680})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:812 +0x11b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000562ee0, {0x99ab090, 0xc0029f78c0}, 0xc001aa0d00, 0xc001568900, {0x820d2e0, 0xc0014a9680})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:919 +0x83a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0004a5fc8, {0x99ab090?, 0xc0029f77d0?}, 0xc00132d630)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1060 +0xdbc
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc001b8f4a0, {0x99ab090?, 0xc0029f6960?}, 0xc00143e770)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:859 +0x56a
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x8d14c00?, 0xc001b8f4a0}, {0x99ab090, 0xc0029f6960}, 0xc00143e700, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002e01e0, {0x99bca60, 0xc001c7e4e0}, 0xc0029f87e0, 0xc001c6ef00, 0xf54a9f8, 0x0)
	google.golang.org/[email protected]/server.go:1374 +0xde7
google.golang.org/grpc.(*Server).handleStream(0xc0002e01e0, {0x99bca60, 0xc001c7e4e0}, 0xc0029f87e0, 0x0)
	google.golang.org/[email protected]/server.go:1751 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
	google.golang.org/[email protected]/server.go:986 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 35
	google.golang.org/[email protected]/server.go:997 +0x145

Error: The terraform-provider-azurerm_v3.84.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Expected Behaviour

no crash

Actual Behaviour

No response

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

@patst
Copy link
Contributor Author

patst commented Dec 8, 2023

The error was introduced with this change: https://github.com/hashicorp/terraform-provider-azurerm/pull/24125/files#diff-66ac2f377a9da60b946a33a2c876ea89d5d71271f32dd75d4b30b9b8f3a6d519R293

It must be casted to bool, not string or removed. It seems to be introduced by accident, at least to me the value does not make sense at that point

Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant