-
Notifications
You must be signed in to change notification settings - Fork 223
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
Panic on plugin.(*GRPCProvider).ConfigureProvider call #162
Comments
Hi, I was also was also able to reproduce this. It happens whenever you configure 'oauth_client_credentials'. I was able to get a plan to run by building the provider from this older commit. https://github.com/Mastercard/terraform-provider-restapi/tree/ef7f07a2334a87ff50c42625bc63934affbf6646 |
Hello, I am also reproducing this problem with the latest version of the provider (1.16.1) |
@billgrant how are you making use of your custom build of the provider? The only version that appears to be available on Hashicorp's site is the latest. |
@AndreasSko - My guess (I'm no go dev) is that while the schema has the endpoint_parms as optional, the way the code is written doesn't actually make them optional if you have a oauth_client_credentials block. So the code barfs on trying to do something with the empty interface{}? (line 254), Can you configure endpoint_parms and see if it works? I'm not sure what valid values are for that block (I didn't see anything in the docs or examples to indicate what they would be), but I bet it will at least give a different error :) Changing that bit of code to the following at least makes endpoint_parms optional, but I don't know what the correct config is to determine if the endpoint_parms code is truely broken, or if my hack broke it. |
if you don't need the endpoint_parms, and don't mind the above hack to make it usable without them in your provider config, I quickly setup a fork of the restapi provider with this modification (and two other PR's in waiting) here: https://registry.terraform.io/providers/runecalico/restapi/latest/docs/resources/object I am hoping this is just a stop-gap measure and @DRuggeri will be able to fix this error as well as merge in some of the waiting Pull Requests .. |
thanks @runecalico, I had already gone done this route with a local developer override of the provider. forking and having a registry version to use was the next step, thanks for taking care of that. |
You are welcome :) |
Hey there, @runecalico - appreciate the callout. I've been watching this issue, but was a bit unclear on what the root of the problem is just yet. Your proposed patch does get past the issue when there are no |
Well... I'm convinced that triaging this has uncovered a bug in terraform. The provider schema allows us to declare this:
(which basically says, I have a map with each key pointing to a list of strings) ... but when terraform attempts to validate the values of that list, it doesn't know how to handle a list: So... either we shouldn't be allowed to set a map of string lists in our schema, or the validator must support that case. Simply fixing the types in this provider is enough to avoid the bug reported, but unfortunately uncovers another bug that isn't ours :-( The stuff we can control will be fixed in 1.16.2 (which is building now...) |
I am just testing this on
Is there an issue open on terraform upstream? If not, the problem will never be worked on by the core team...
Why are we using a map of list of strings in the first place? It seems like a map of strings would be sufficient, and maybe that can (temporarily) workaround the terraform bug? |
When using the provider (v1.16.1) for the first time with only one resource, I encountered the following error:
The provider block looks like this:
and the resource like this:
So nothing really special here, I think 🤔
I already had a quick look and seems to panic here:
terraform-provider-restapi/restapi/provider.go
Lines 253 to 254 in 0918001
endpoint_params
in theoauth_client_credentials
block.I really appreciate any help 🙂
The text was updated successfully, but these errors were encountered: