MyPureCloud / terraform-provider-genesyscloud

Terraform Provider Genesyscloud
MIT License
35 stars 80 forks source link

Plugin crashed when performing Bulk prompt import using version 1.49.2 and 1.48.3. #1296

Open ramukhsihtas7 opened 2 weeks ago

ramukhsihtas7 commented 2 weeks ago

Tried to import more than 130 prompts to an Org and the plugin crashed halfway. Please look in to it.

Workaround: Imported 40 prompts files at a time to overcome this problem.

Analysis: In each run, initial 25 to 30 prompts get created not exceeding 2 to 5 sec of elapse time. After that noticed prompts started taking more time to get created and if the upload takes more than 50 sec, then the plugin crashes.


Log: │ Error: Plugin did not respond │ │ with genesyscloud_architect_user_prompt.xxxx, │ on main.tf line 1411, in resource "genesyscloud_architect_user_prompt" "xxx": │ 1411: resource "genesyscloud_architect_user_prompt" "xxx" { │ │ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ValidateResourceConfig call. The plugin logs may contain more details. ╵

Stack trace from the terraform-provider-genesyscloud_v1.48.3.exe plugin:

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

goroutine 4594 [running]: terraform-provider-genesyscloud/genesyscloud/architect_user_prompt.(architectUserPromptProxy).verifyPromptResourceFilesAreTranscoded.func1() terraform-provider-genesyscloud/genesyscloud/architect_user_prompt/genesyscloud_architect_user_prompt_proxy.go:275 +0x14a github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry.RetryContext.func1() github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/retry/wait.go:30 +0x4e github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry.(StateChangeConf).WaitForStateContext.func1() github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/retry/state.go:113 +0x1b0 created by github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry.(*StateChangeConf).WaitForStateContext in goroutine 4372 github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/retry/state.go:86 +0x23b

Error: The terraform-provider-genesyscloud_v1.48.3.exe 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.


charliecon commented 2 weeks ago

Hi @ramukhsihtas7. We'll get an engineer working on it as soon as we can.

It looks like the reason that the plugin is crashing is because there is an error that is not being returned (line 275 of this file). If you call the endpoint GET /api/v2/architect/prompts/{promptId}, you should see the error that is causing this crash and maybe you can work around it until we get a fix out on the next release.

It is possible that the API call is failing because the oauth client you're using does not have the required permissions (architect:userPrompt:view) for the endpoint.

Thanks for reporting -Charlie

(Tracking with DEVTOOLING-882)