terraform-provider-artifactory: Getting `plugin did not respond` errors with v8.2.1

Describe the bug When running a terraform plan, I’m getting the following error:

Error: Plugin did not respond 
The plugin encountered an error, and failed to respond to the
plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
details.

Followed by a lot of request cancelled errors, similar to:

 Error: Request cancelled

  with artifactory_user.this,
  on file.tf line 6, in resource "artifactory_user" "this":
   6: resource "artifactory_user" "this" {

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

I’m not able to include a snippet since I don’t exactly know which part of the code is causing the plugin to not respond.

This however is the stack trace I got:

Stack trace from the terraform-provider-artifactory_v8.2.1 plugin:
panic: runtime error: index out of range [1] with length 1
goroutine 1745 [running]:
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySetElements({0x100bbc0, 0xc0007c8240}, {{{0xc00125c600, 0x7, 0xc}}, {0x100efc8, 0xc0006c0270}, {0x100efc8, 0xc0006ccea0}}, 0xc0007c81e0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:145 +0xdc8
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySet({0x100bbc0, 0xc0007c8240}, {{{0xc00125c600, 0x7, 0xc}}, {0x100efc8, 0xc0006c0270}, {0x100efc8, 0xc0006ccea0}}, 0xc0007c81e0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:27 +0x497
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEquality({0x100bbc0, 0xc0007c80f0}, {{{0xc00125c600, 0x7, 0xc}}, {0x100efc8, 0xc0006c0270}, {0x100efc8, 0xc0006ccea0}}, 0xc0007c81e0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality.go:79 +0x53e
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualityObjectAttributes({0x100bbc0, 0xc0007c80f0}, {{{0xc000631f40, 0x6, 0xa}}, {0x100ef38, 0xc001265c38}, {0x100ef38, 0xc001265f38}}, 0xc0007c8090)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_object.go:154 +0x97e
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualityObject({0x100bbc0, 0xc0007c80f0}, {{{0xc000631f40, 0x6, 0xa}}, {0x100ef38, 0xc001265c38}, {0x100ef38, 0xc001265f38}}, 0xc0007c8090)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_object.go:27 +0x497
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEquality({0x100bbc0, 0xc0006cd500}, {{{0xc000631f40, 0x6, 0xa}}, {0x100ef38, 0xc001265c38}, {0x100ef38, 0xc001265f38}}, 0xc0007c8090)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality.go:77 +0x4cb
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySetElements({0x100bbc0, 0xc0006cd500}, {{{0xc00102ee00, 0x5, 0x8}}, {0x100efc8, 0xc0006c0300}, {0x100efc8, 0xc0006ccf30}}, 0xc0006cd4a0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:152 +0x82a
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySet({0x100bbc0, 0xc0006cd500}, {{{0xc00102ee00, 0x5, 0x8}}, {0x100efc8, 0xc0006c0300}, {0x100efc8, 0xc0006ccf30}}, 0xc0006cd4a0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:27 +0x497
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEquality({0x100bbc0, 0xc0006cd440}, {{{0xc00102ee00, 0x5, 0x8}}, {0x100efc8, 0xc0006c0300}, {0x100efc8, 0xc0006ccf30}}, 0xc0006cd4a0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality.go:79 +0x53e
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualityObjectAttributes({0x100bbc0, 0xc0006cd440}, {{{0xc000768240, 0x4, 0x6}}, {0x100ef38, 0xc001265c50}, {0x100ef38, 0xc001265f68}}, 0xc0006cd3e0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_object.go:154 +0x97e
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualityObject({0x100bbc0, 0xc0006cd440}, {{{0xc000768240, 0x4, 0x6}}, {0x100ef38, 0xc001265c50}, {0x100ef38, 0xc001265f68}}, 0xc0006cd3e0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_object.go:27 +0x497
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEquality({0x100bbc0, 0xc0006cd380}, {{{0xc000768240, 0x4, 0x6}}, {0x100ef38, 0xc001265c50}, {0x100ef38, 0xc001265f68}}, 0xc0006cd3e0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality.go:77 +0x4cb
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySetElements({0x100bbc0, 0xc0006cd380}, {{{0xc0006d5b00, 0x3, 0x4}}, {0x100efc8, 0xc0006c04b0}, {0x100efc8, 0xc0006cd0e0}}, 0xc0006cd320)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:152 +0x82a
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySet({0x100bbc0, 0xc0006cd380}, {{{0xc0006d5b00, 0x3, 0x4}}, {0x100efc8, 0xc0006c04b0}, {0x100efc8, 0xc0006cd0e0}}, 0xc0006cd320)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:27 +0x497
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEquality({0x100bbc0, 0xc0006cd2c0}, {{{0xc0006d5b00, 0x3, 0x4}}, {0x100efc8, 0xc0006c04b0}, {0x100efc8, 0xc0006cd0e0}}, 0xc0006cd320)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality.go:79 +0x53e
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualityObjectAttributes({0x100bbc0, 0xc0006cd2c0}, {{{0xc000e5eea0, 0x2, 0x2}}, {0x100ef38, 0xc001265ce0}, {0x100ef38, 0xc001265fb0}}, 0xc0006cd260)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_object.go:154 +0x97e
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualityObject({0x100bbc0, 0xc0006cd2c0}, {{{0xc000e5eea0, 0x2, 0x2}}, {0x100ef38, 0xc001265ce0}, {0x100ef38, 0xc001265fb0}}, 0xc0006cd260)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_object.go:27 +0x497
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEquality({0x100bbc0, 0xc0006cd230}, {{{0xc000e5eea0, 0x2, 0x2}}, {0x100ef38, 0xc001265ce0}, {0x100ef38, 0xc001265fb0}}, 0xc0006cd260)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality.go:77 +0x4cb
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySetElements({0x100bbc0, 0xc0006cd230}, {{{0xc00071eb70, 0x1, 0x1}}, {0x100efc8, 0xc0006c0ab0}, {0x100efc8, 0xc0006cd1d0}}, 0xc0018d2e98)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:152 +0x82a
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEqualitySet({0x100bbc0, 0xc0006cd230}, {{{0xc00071eb70, 0x1, 0x1}}, {0x100efc8, 0xc0006c0ab0}, {0x100efc8, 0xc0006cd1d0}}, 0xc0018d2e98)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality_set.go:27 +0x497
github.com/hashicorp/terraform-plugin-framework/internal/fwschemadata.ValueSemanticEquality({0x100bbc0, 0xc0016b4600}, {{{0xc00071eb70, 0x1, 0x1}}, {0x100efc8, 0xc0006c0ab0}, {0x100efc8, 0xc0006cd1d0}}, 0xc0018d2e98)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwschemadata/value_semantic_equality.go:79 +0x53e
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.SchemaSemanticEquality({0x100bbc0, 0xc0016b4600}, {{{0xe661af, 0x5}, {0x1011a88, 0xc0000a9950}, {{0x1010620, 0xc0003f1cb0}, {0xd61100, 0xc0012ad560}}}, ...}, ...)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwserver/schema_semantic_equality.go:126 +0x81d
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc000176000, {0x100bbc0, 0xc0016b4600}, 0xc0016b46f0, 0xc0018d33f8)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/fwserver/server_readresource.go:135 +0x950
github.com/hashicorp/terraform-plugin-framework/internal/proto5server.(*Server).ReadResource(0xc000176000, {0x100bbc0?, 0xc0016b44b0?}, 0xc00103b6c0)
	github.com/hashicorp/terraform-plugin-framework@v1.3.0/internal/proto5server/server_readresource.go:56 +0x27b
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ReadResource({0xc000470090, 0xc0004700f0, {0xc0006f4b60, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...)
	github.com/hashicorp/terraform-plugin-mux@v0.9.0/tf5muxserver/mux_server_ReadResource.go:26 +0x102
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0002683c0, {0x100bbc0?, 0xc0016a59b0?}, 0xc0017b2e40)
	github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov5/tf5server/server.go:748 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xe31120?, 0xc0002683c0}, {0x100bbc0, 0xc0016a59b0}, 0xc0001f68c0, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.15.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:383 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001f2000, {0x1010960, 0xc00051e4e0}, 0xc001745c20, 0xc00061e930, 0x15ade90, 0x0)
	google.golang.org/grpc@v1.54.0/server.go:1345 +0xdf0
google.golang.org/grpc.(*Server).handleStream(0xc0001f2000, {0x1010960, 0xc00051e4e0}, 0xc001745c20, 0x0)
	google.golang.org/grpc@v1.54.0/server.go:1722 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/grpc@v1.54.0/server.go:966 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.54.0/server.go:964 +0x28a
Error: The terraform-provider-artifactory_v8.2.1 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.
2023-06-22T19:32:55.325Z [DEBUG] provider: plugin exited

Requirements for and issue

  • A description of the bug
  • A fully functioning terraform snippet that can be copy&pasted (no outside files or ENV vars unless that’s part of the issue). If this is not supplied, this issue will likely be closed without any effort expended.
  • Your version of artifactory (you can curl it at $host/artifactory/api/system/version
  • Your version of terraform
  • Your version of terraform provider

version of artifactory: 7.59.9 version of terraform: 1.4.6 verrsion of terraform provider: 8.2.1

Thank you so much for your consideration!

Expected behavior terraform plan succeeding

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 25

Commits related to this issue

Most upvoted comments

@charmmarch we’ve noticed that the permission target resource test is running much longer when migrated to the plugin framework. We have a ticket to investigate but haven’t started yet. We will look into it since it’s causing problems for you.

@charmmarch I’d encourage you to also voice your experience in this HashiCorp community thread: https://discuss.hashicorp.com/t/performance-issue-with-terraform-plugin-framework/58422 Hopefully TF team will see it and prioritize the fix.

@alexhung - I just tried right now using version 9.0.0 and the behavior is the same. 72 minutes has elapsed and terraform plan did not even start. The process timed out.

@neatcoder This looks like a separate issue. Please create a new GitHub issue.

@alexhung Here’s the new issue #782

@charmmarch Looks like there is some performance improvement coming in the next framework release: https://github.com/hashicorp/terraform-plugin-framework/issues/775#issuecomment-1618814589

@alexhung , thank you so much for looking into this. True to that issue you linked above, many of our artifactory_permission_target resource definitions contain block sets. Looking forward to when the framework version gets upgraded to benefit from the fix. 👍

I got the same error with version ~> 8.0 of the plugin, but it does not seem to error with version ~> 7.0 of the plugin.

The resources it was failing on for me were:

│ Error: Request cancelled
│ 
│   with artifactory_permission_target.local_private_repo_access,
│   on permissions.tf line 3, in resource "artifactory_permission_target" "local_private_repo_access":
│    3: resource "artifactory_permission_target" "local_private_repo_access" {

...

╷
│ Error: Request cancelled
│ 
│   with artifactory_user.bob,
│   on users.tf line 11, in resource "artifactory_user" "bob":
│   11: resource "artifactory_user" "bob" {

These were the only two resource types impacted for us.

Note that I’m currently migrating from an ancient version (2.2.7), and had to re-import all of the resources since the resource names from all of the repository types changed).

Maybe this has something to do with changes to how users are put into groups? From the current documentation it looks like this information goes into the user resource, but before we always put it into the group resource.