You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run -it --rm -v "$(pwd)/main.tf:/main.tf:ro" --entrypoint /bin/sh hashicorp/terraform:1.3.6
Run this command:
terraform init && terraform plan
Expected: terraform plan succeeds.
Actual: terraform plan terminates with exit code 1 and the below output is logged.
Initializing the backend...
Initializing provider plugins...
- Finding mastercard/restapi versions matching "1.18.0"...
- Installing mastercard/restapi v1.18.0...
- Installed mastercard/restapi v1.18.0 (self-signed, key ID 12575FB7060C00C1)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
╷
│ Error: Request cancelled
│
│ with provider["registry.terraform.io/mastercard/restapi"],
│ on main.tf line 10, in provider "restapi":
│ 10: provider "restapi" {
│
│ The plugin.(*GRPCProvider).ValidateProviderConfig request was cancelled.
╵
Stack trace from the terraform-provider-restapi_v1.18.0 plugin:
panic: Unknown validation type: 6
goroutine 42 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.validateMapValues({0xc0002840c0, 0x2a}, 0xc000500640, 0xc0003f2280, {0xc000538380, 0x3, 0x4})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1909 +0x969
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateMap(0xa65a20, {0xc0002840c0, 0x2a}, {0xa65a20, 0xc000254300}, 0x8210ac, 0xc0000a2ad8, {0xc000538380, 0x3, 0x4})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1816 +0x271
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateType(0xc00027a640, {0xc0002840c0, 0x77788a}, {0xa65a20, 0xc000254300}, 0xc0003f2280, 0xc00007fee0, {0xc000538380, 0x3, 0x4})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:2106 +0x174
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validate(0xa794e0, {0xc0002840c0, 0x2a}, 0xc0003f2280, 0x2, {0xc000538380, 0x3, 0x4})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1531 +0x71a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateObject(0xa794e0, {0xc00003d800, 0x1a}, 0x2, 0x2, {0xc000041bc0, 0x15, 0x194})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1967 +0x585
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateList(0x0, {0xb29de3, 0x18}, {0xa2b3c0, 0xc00000d3f8}, 0xc0003f23c0, 0xa65a20, {0xc00027a040, 0x1, 0x1})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1756 +0xb4e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateType(0xc000225960, {0xb29de3, 0x77788a}, {0xa2b3c0, 0xc00000d3f8}, 0xc0003f23c0, 0xa57cc0, {0xc00027a040, 0x1, 0x1})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:2096 +0x1a5
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validate(0xa794e0, {0xb29de3, 0x18}, 0xc0003f23c0, 0xb1f346, {0xc00027a040, 0x1, 0x1})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/schema.go:1531 +0x71a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.validateObject(0xc000384050, {0x0, 0x0}, 0xc0002541b0, 0xc0004fbc80, {0x10b1af8, 0xa65a20, 0xc000288188})
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:857 +0x294
Error: The terraform-provider-restapi_v1.18.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.
The text was updated successfully, but these errors were encountered:
I hit the same issue today. Tried hard to fix it locally. No matter what I do, the error appeared in or the other form.
Even though the panic is fixed, the endpointParams attribute passed to go oauth2 SDK only accepts list of strings. Nevertheless, Azure management API expects resource to be passed to token endpoint as a string rather list(string).
Having said this, in the current form, irrespective of Terraform SDK validation limitations, I don't find this attribute being useful as it never worked.
For these complex Object types, Terraform recommends diabling the validation by SDK & delegating it to api backend service. Link to the conversation [here].(hashicorp/terraform-plugin-sdk#62 (comment))
harshavmb
added a commit
to harshavmb/terraform-provider-restapi
that referenced
this issue
Aug 12, 2023
Using
oauth_client_credentials.endpoint_params
in the provider configuration leads to “panic: Unknown validation type: 6”.Steps to Reproduce
Create
main.tf
with this content:Start Terraform 1.3.6 container:
docker run -it --rm -v "$(pwd)/main.tf:/main.tf:ro" --entrypoint /bin/sh hashicorp/terraform:1.3.6
Run this command:
terraform init && terraform plan
Expected:
terraform plan
succeeds.Actual:
terraform plan
terminates with exit code 1 and the below output is logged.The text was updated successfully, but these errors were encountered: