Legacy Dev Forum Posts

 View Only

Sign Up

Terraform export of external contacts crashing plugin

  • 1.  Terraform export of external contacts crashing plugin

    Posted 06-05-2025 18:32

    Tim_Bushell | 2024-08-30 15:49:25 UTC | #1

    I'm using terraform in a linux environment and trying to export external contacts. This is causing the plugin to crash. I've tried with versions 1.36.0 and 1.46.0 of the plugin and hoping to get some assistance on this.

    Here is the error message with the 1.46.0 version of plugin:

    genesyscloudtfexport.export: Creating... ╷ │ Error: Plugin did not respond │ │ with genesyscloudtfexport.export, │ on main.tf line 18, in resource "genesyscloudtfexport" "export": │ 18: resource "genesyscloudtfexport" "export" { │ │ The plugin encountered an error, and failed to respond to the │ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details. ╵

    Stack trace from the terraform-provider-genesyscloud_v1.46.0 plugin:

    panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11592db]

    goroutine 489 [running]: terraform-provider-genesyscloud/genesyscloud/externalcontacts.flattenSdkWhatsAppId(0xc0005df7e8) terraform-provider-genesyscloud/genesyscloud/externalcontacts/resourcegenesyscloudexternalcontactscontactutils.go:244 +0x7b terraform-provider-genesyscloud/genesyscloud/util/resourcedata.SetNillableValueWithInterfaceArrayWithFunc[...](0xc000d0ad80?, {0x17c5aef, 0xb}, 0x24, 0x18?) terraform-provider-genesyscloud/genesyscloud/util/resourcedata/resourcedata.go:153 +0x32 terraform-provider-genesyscloud/genesyscloud/externalcontacts.readExternalContact.func1() terraform-provider-genesyscloud/genesyscloud/externalcontacts/resourcegenesyscloudexternalcontacts_contact.go:108 +0x87d 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 355 github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/retry/state.go:86 +0x23b

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

    I can share some sdk debug logs or the terraform logs if it helps.

    Thanks

    Tim


    John_Carnell | 2024-09-09 12:35:07 UTC | #2

    Hi Tim,

    Sorry I missed this post. I will open a ticket with my team and investigate.

    Thanks, John Carnell Director, Developer Engagement


    Tim_Bushell | 2024-09-09 12:59:59 UTC | #3

    Thanks @John_Carnell.

    Please let me know if there are more details to share that will help the team investigate.

    Tim


    Kevin9000 | 2024-09-16 18:16:19 UTC | #4

    Hi John, Tim,

    any update on this issue? I'm having similar issues here.

    G Support sent me to this post. Case# 0003572116

    Thanks in advance,

    Kevin


    Hemanth | 2024-09-17 11:55:36 UTC | #5

    Hi Kevin9000

    We are tracking and will be addressing this issue. And should be there in this/next release. Will keep this thread posted once the fix is released.

    Thanks Hemanth


    Tim_Bushell | 2024-09-17 12:02:21 UTC | #6

    Hi Kevin9000,

    The details on the ticket opened or progress weren't shared with me yet and no additional details were requested via the forum post or other communication channels.

    I'm glad to see the update from Hemanth to understand that it is in progress overall.

    Tim


    Kevin9000 | 2024-09-17 15:31:37 UTC | #7

    Some additional info. Sometimes it seems to work without any problems. Sometimes crash with a " runtime error: invalid memory address or nil pointer dereference" error.

    But there is also another reason "concurrent map iteration and map write"

    Stack trace from the terraform-provider-genesyscloud _v1.47.0.exe plugin:

    fatal error: concurrent map iteration and map write

    goroutine 18051 [running]: terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter.postProcessHclBytes({0xc002488200?, 0x35?, 0x441?}) terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter- / -hclexporter.go:169 +0x11f terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter.writeHCLToFile({0xc001d44bf8, 0x1, 0x22c8588?}, {0xc001b6c440, 0x35}) terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter- / -hclexporter.go:186 +0xf1 terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter.(HCLExporter).exportHCLConfig(0xc001d44fb8) terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter- / -hcl_exporter.go:54 +0x2cb terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter.(GenesysCloudResourceExporter).generateOutputFiles(0xc001a3cb00) terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter- / -genesyscloud_resourceexporter.go:469 +0x218 terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter.(*GenesysCloudResourceExporter).Export(0xc001a3cb00) terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter- / -genesyscloudresourceexporter.go:216 +0x85 terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter.createTfExport({0x22d5ca0, 0xc0021dfbf0}, 0xc00080f380, {0x1a3e400, 0xc0005b4630}) terraform-provider-genesyscloud - / -genesyscloud- / -tfexporter- / -resourcegenesyscloudtfexport.go:159 +0x78 github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2- / -helper- / -schema.(*Resource).create(0x22d5ca0?, {0x22d5ca0?, 0xc0021dfbf0?}, 0xd?, {0x1a3e400?, 0xc0005b4630?}) github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2@v2.34.0- / -helper- / -schema- / -resource.go:801 +0x7a github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2- / -helper- / -schema.(Resource).Apply(0xc0003eb500, {0x22d5ca0, 0xc0021dfbf0}, 0xc001adcd00, 0xc00080f200, {0x1a3e400, 0xc0005b4630}) github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2@v2.34.0- / -helper- / -schema- / -resource.go:937 +0xa89 github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2- / -helper- / -schema.(GRPCProviderServer).ApplyResourceChange(0xc00050c5d0, {0x22d5ca0?, 0xc0021dfb30?}, 0xc00209fc70) github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2@v2.34.0- / -helper- / -schema- / -grpcprovider.go:1153 +0xd5c github-com - / -hashicorp- / -terraform-plugin-go- / -tfprotov5- / -tf5server.(*server).ApplyResourceChange(0xc0002b72c0, {0x22d5ca0?, 0xc0021df0e0?}, 0xc000cf9f10) github-com - / -hashicorp- / -terraform-plugin-go@v0.23.0- / -tfprotov5- / -tf5server- / -server.go:865 +0x3d0 github-com - / -hashicorp- / -terraform-plugin-go- / -tfprotov5- / -internal- / -tfplugin5.ProviderApplyResourceChangeHandler({0x1cda3e0, 0xc0002b72c0}, {0x22d5ca0, 0xc0021df0e0}, 0xc00080ef80, 0x0) github-com - / -hashicorp- / -terraform-plugin-go@v0.23.0- / -tfprotov5- / -internal- / -tfplugin5- / -tfplugin5_grpc.pb.go:518 +0x1a6 google.golang.org- / -grpc.(*Server).processUnaryRPC(0xc0000f4000, {0x22d5ca0, 0xc0021df050}, {0x22dbd40, 0xc000002000}, 0xc0011119e0, 0xc00050bec0, 0x2cf79f8, 0x0) google.golang.org- / -grpc@v1.63.2- / -server.go:1369 +0xdf8 google.golang.org- / -grpc.(Server).handleStream(0xc0000f4000, {0x22dbd40, 0xc000002000}, 0xc0011119e0) google.golang.org- / -grpc@v1.63.2- / -server.go:1780 +0xe8b google.golang.org- / -grpc.(Server).serveStreams.func2.1() google.golang.org- / -grpc@v1.63.2- / -server.go:1019 +0x8b created by google.golang.org- / -grpc.(*Server).serveStreams.func2 in goroutine 40 google.golang.org- / -grpc@v1.63.2- / -server.go:1030 +0x125

    goroutine 1 [select, 1 minutes]: github-com - / -hashicorp- / -go-plugin.Serve(0xc000356ba0) github-com - / -hashicorp- / -go-plugin@v1.6.0- / -server.go:503 +0x158b github-com - / -hashicorp- / -terraform-plugin-go- / -tfprotov5- / -tf5server.Serve({0x1d7730e, 0x8}, 0xc0003e2760, {0x0, 0x0, 0x0}) github-com - / -hashicorp- / -terraform-plugin-go@v0.23.0- / -tfprotov5- / -tf5server- / -server.go:316 +0xbe5 github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2- / -plugin.tf5serverServe(0xc000356b40) github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2@v2.34.0- / -plugin- / -serve.go:188 +0x4b9 github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2- / -plugin.Serve(0xc000356b40) github-com - / -hashicorp- / -terraform-plugin-sdk- / -v2@v2.34.0- / -plugin- / -serve.go:128 +0x28e main.main() terraform-provider-genesyscloud - / -main.go:159 +0x20b

    goroutine 8 [select, 1 minutes]: github-com - / -hashicorp- / -go-plugin.(gRPCBrokerServer).Recv(0x0?) github-com - / -hashicorp- / -go-plugin@v1.6.0- / -grpc_broker.go:128 +0x65 github-com - / -hashicorp- / -go-plugin.(GRPCBroker).Run(0xc00036bad0) github-com - / -hashicorp- / -go-plugin@v1.6.0- / -grpc_broker.go:582 +0x4f created by github-com - / -hashicorp- / -go-plugin.(*GRPCServer).Init in goroutine 1 github-com - / -hashicorp- / -go-plugin@v1.6.0- / -grpc_server.go:91 +0x57a

    goroutine 9 [syscall, 1 minutes, locked to thread]: syscall.SyscallN(0x0?, {0xc000169c50?, 0xc000169c88?, 0x9bd79b?}) runtime- / -syscallwindows.go:544 +0x107 syscall.Syscall6(0x9ab3a8?, 0x0?, 0x0?, 0x0?, 0x25bfd5d92c8?, 0x1000?, 0x1?, 0xc000169d40?) runtime- / -syscallwindows.go:488 +0x4a syscall.readFile(0x184, {0xc000520000?, 0x1000, 0x25bfd5d92c8?}, 0x0?, 0x800000?) syscall- / -zsyscallwindows.go:1021 +0x8b syscall.ReadFile(...) syscall- / -syscallwindows.go:442 syscall.Read(0xc000127408?, {0xc000520000?, 0x9b705c?, 0x2da2280?}) syscall- / -syscallwindows.go:421 +0x2d internal- / -poll.(*FD).Read(0xc000127408, {0xc000520000, 0x1000, 0x1000}) internal- / -poll- / -fdwindows.go:422 +0x1c5 os.(*File).read(...) os- / -fileposix.go:29 os.(File).Read(0xc0001120b8, {0xc000520000?, 0x400?, 0x1abb640?}) os- / -file.go:118 +0x52 bufio.(Reader).Read(0xc000169f20, {0xc00011a800, 0x400, 0x0?}) bufio- / -bufio.go:241 +0x197 github-com - / -hashicorp- / -go-plugin.copyChan({0x22e07f8, 0xc0002b7040}, 0xc000107860, {0x22cd5c0, 0xc0001120b8?}) github-com - / -hashicorp- / -go-plugin@v1.6.0- / -grpcstdio.go:184 +0x1c5 created by github-com - / -hashicorp- / -go-plugin.newGRPCStdioServer in goroutine 1 github-com - / -hashicorp- / -go-plugin@v1.6.0- / -grpc_stdio.go:40 +0xcc

    goroutine 10 [syscall, 1 minutes, locked to thread]: syscall.SyscallN(0x0?, {0xc000517c50?, 0xc000517c88?, 0x9bd79b?}) runtime- / -syscallwindows.go:544 +0x107 syscall.Syscall6(0x9ab3a8?, 0x0?, 0x0?, 0x0?, 0x25bd82b0828?, 0x1000?, 0x1?, 0xc000517d40?) runtime- / -syscallwindows.go:488 +0x4a syscall.readFile(0x188, {0xc0005b2000?, 0x1000, 0x25bfd429888?}, 0x0?, 0x800000?) syscall- / -zsyscallwindows.go:1021 +0x8b syscall.ReadFile(...) syscall- / -syscallwindows.go:442 syscall.Read(0xc000127908?, {0xc0005b2000?, 0x9b705c?, 0x2da2280?}) syscall- / -syscallwindows.go:421 +0x2d internal- / -poll.(*FD).Read(0xc000127908, {0xc0005b2000, 0x1000, 0x1000}) internal- / -poll- / -fdwindows.go:422 +0x1c5 os.(*File).read(...) os- / -fileposix.go:29 os.(File).Read(0xc0001120c8, {0xc0005b2000?, 0x400?, 0x1abb640?}) os- / -file.go:118 +0x52 bufio.(Reader).Read(0xc000517f20, {0xc00047c400, 0x400, 0x0?}) bufio- / -bufio.go:241 +0x197 github-com - / -hashicorp- / -go-plugin.copyChan({0x22e07f8, 0xc0002b7040}, 0xc0001078c0, {0x22cd5c0, 0xc0001120c8?}) github-com - / -hashicorp- / -go-plugin@v1.6.0- / -grpcstdio.go:184 +0x1c5 created by github-com - / -hashicorp- / -go-plugin.newGRPCStdioServer in goroutine 1 github-com - / -hashicorp- / -go-plugin@v1.6.0- / -grpc_stdio.go:41 +0x13e

    Error: The terraform-provider-genesyscloud _v1.47.0.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.

    don't hesitate to reach out for more info.

    Kr, Kevin


    system | 2024-10-17 15:31:39 UTC | #8

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 28825