Skip to content
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

Provider Crashing on Specific Tenant #139

Closed
manderson202 opened this issue Apr 14, 2022 · 3 comments · Fixed by #140
Closed

Provider Crashing on Specific Tenant #139

manderson202 opened this issue Apr 14, 2022 · 3 comments · Fixed by #140
Labels
🪲 bug Something isn't working resource/auth0_client

Comments

@manderson202
Copy link

Hello, we are seeing the provider crash on one of our tenants. We are using the latest v0.30.0 version of the provider.

Describe the problem

After running a plan we get the following output:

╷
│ Error: Request cancelled
│
│   with auth0_client_grant.user-management-app-client-grant,
│   on main.tf line 74, in resource "auth0_client_grant" "user-management-app-client-grant":
│   74: resource "auth0_client_grant" "user-management-app-client-grant" {
│
│ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.
╵

╷
│ Error: Plugin did not respond
│
│   with module.module-auth0-tenant.auth0_branding.brand,
│   on .terraform/modules/module-auth0-tenant/main.tf line 36, in resource "auth0_branding" "brand":
│   36: resource "auth0_branding" "brand" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.
╵

// ... [SNIP] ... many more like the above


Stack trace from the terraform-provider-auth0_v0.30.0 plugin:

panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 121 [running]:
github.com/auth0/terraform-provider-auth0/auth0.flattenClientAddons(0xc000690630)
	github.com/auth0/terraform-provider-auth0/auth0/resource_auth0_client.go:998 +0xbdd
github.com/auth0/terraform-provider-auth0/auth0.readClient({0x19c60a8?, 0xc0001fc8d0?}, 0xc0002fd380, {0x17e4580?, 0xc0006f48c0})
	github.com/auth0/terraform-provider-auth0/auth0/resource_auth0_client.go:642 +0x11ae
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0000c5c00, {0x19c60a8, 0xc0001fc8d0}, 0xd?, {0x17e4580, 0xc0006f48c0})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:725 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0000c5c00, {0x19c60a8, 0xc0001fc8d0}, 0xc00009d930, {0x17e4580, 0xc0006f48c0})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1016 +0x47b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000392600, {0x19c6000?, 0xc0006b8a40?}, 0xc0006b8ac0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:613 +0x497
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0003745a0, {0x19c60a8?, 0xc0001fc180?}, 0xc0004ee7e0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:746 +0x438
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x186b740?, 0xc0003745a0}, {0x19c60a8, 0xc0001fc180}, 0xc0004ee780, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000272a80, {0x19c8bd8, 0xc0004824e0}, 0xc00062c000, 0xc0003fe870, 0x1e9ca30, 0x0)
	google.golang.org/[email protected]/server.go:1282 +0xccf
google.golang.org/grpc.(*Server).handleStream(0xc000272a80, {0x19c8bd8, 0xc0004824e0}, 0xc00062c000, 0x0)
	google.golang.org/[email protected]/server.go:1619 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/[email protected]/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/[email protected]/server.go:919 +0x28a

Error: The terraform-provider-auth0_v0.30.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.

ERRO[0011] 1 error occurred:
	* exit status 1

What was the expected behavior?

The plan would complete without error.

Reproduction

I believe this is specific to our tenant as the same TF works fine in all of our other tenants except this one. I opened support request 00745742 to look more into the tenant-specific nature of the error and was told to open an issue here.

Environment

We are using v0.30.0 of the provider. We are using Terraform v1.1.2 run via Terragrunt v0.31.0

@sergiught
Copy link
Contributor

Hey @manderson202 thanks for raising this with us! 🙏🏻 The debug output provided above helped pinpoint the issue and I have a fix up within #140. Would you be able to help test this from your end before we merge it?

We have a make command to install the binary locally without going through the terraform registry you can run make install VERSION=0.30.1 and then update the provider version in your terraform config to v0.30.1. You need go installed locally tho brew install go on mac for example. Or you can install it with https://go.dev/doc/install.

@sergiught
Copy link
Contributor

sergiught commented Apr 14, 2022

We fixed this in https://github.com/auth0/terraform-provider-auth0/releases/tag/v0.30.1. It will be available shortly from the terraform registry. Thanks for your patience 🙏🏻

@manderson202
Copy link
Author

Thank you @sergiughf ! I was able to test this with the local install and it seems to be working as expected. I'll reach out if I run into any other issues.

Really appreciate the quick turnaround!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working resource/auth0_client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants