terraform-provider-google: Crash When Doing Init For v4.53.0
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
- Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- If an issue is assigned to the
modular-magicianuser, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot, a community member has claimed the issue already.
Terraform Version
1.3.1
Affected Resource(s)
- google_*
Terraform Configuration Files
We set our credentials using the ENV VARs available.
provider google {}
Debug Output
https://gist.github.com/tgoodsell-tempus/bb4ce2a8a3d20752e00a170f1aae4751
Panic Output
Expected Behavior
Provider starts as expected
Actual Behavior
Crashing on init/setup
Steps to Reproduce
Important Factoids
- Do not use the
googleprovider block directly - All configuration is handled by the ENV VARs exposed by the provider
References
- b/269246896
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 76
- Comments: 24 (1 by maintainers)
Same error on here as well since today, on apply and plan
4.53.1is going out now, it should be available within the hour.Edit: Releases for both providers are complete and
4.53.1appears in the Terraform Registry (https://registry.terraform.io/providers/hashicorp/google/4.53.1), individualterraform initruns may be hitting a cache in the meantimeI’ve got a reproduction that’s more representative of a typical user configuration than my earlier one (supplying a bad access token). We have logic during provider initialization that logs the user’s identity into local debug output (using a different identity than expected is a common source of customer issue!) that’s expected to silently log an error if it encounters an issue and proceed, failing later in the configuration or apply. That’s largely because that logic requires an additional scope (
"userinfo-email") that isn’t required by the rest of the provider. Using an access token that does not include that scope (such as one produced by the steps below) triggers the issue.During a large code change to the provider initialization logic, the logging code was inadvertently changed. I’m speculating a bit to the exact cause here (other folks on the team drove the investigation), but I believe that we both accessed global state out of order (causing this crash) and threw an error when we encountered an error when checking the Terraform runner’s identity, rather than moving on. That meant that the initial solution in https://github.com/GoogleCloudPlatform/magic-modules/pull/7285, which resolves the crash, still failed at provider initialization time.
Configuration to produce an invalid access token:
Use that with Terraform:
With the following (simple) configuration:
Looks like the same issue we also facing with: We are running terraform inside Container image: hashicorp/terraform:1.0.8 Issues seems to be within this image, because also we tried to run on MAC and Ubuntu laptops everything works fine. Bellow is an stack trace we are getting:
This seems to be the same bug we have encountered encountered as well.
same error, work around with following for now:
I am having the same error.
Having kinda the same issues/errors here with v4.53.0, everything worked before… I have some nil pointer reference errors:
Avoiding 4.53.0 worked for us too as a workaround.
Same error:
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: Plugin did not respond
│
│ with provider[“registry.terraform.io/hashicorp/google”],
│ on main.tf line 1, in provider “google”:
│ 1: provider “google” {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ConfigureProvider call. The plugin logs may contain
│ more details.
╵
Stack trace from the terraform-provider-google_v4.53.0_x5 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x5ecc01]
goroutine 163 [running]:
github.com/hashicorp/terraform-plugin-log/internal/logging.GetProviderRootLogger(…)
github.com/hashicorp/terraform-plugin-log/tflog.Info({0x0, 0x0}, {0x30d2361, 0x85}, {0x0, 0x0, 0x0})
github.com/hashicorp/terraform-provider-google/google.getCurrUserEmail(0xc00011d500, {0xc000ac4100?, 0x356c300?}, 0xc000f10c50)
github.com/hashicorp/terraform-provider-google/google.(*frameworkProvider).logGoogleIdentities(, {, _}, {{0x0, {0x0, 0x0}}, {0x0, {0x0, 0x0}}, {0x0, …}, …}, …)
github.com/hashicorp/terraform-provider-google/google.(*frameworkProvider).SetupClient(, {, _}, {{0x0, {0x0, 0x0}}, {0x0, {0x0, 0x0}}, {0x0, …}, …}, …)
github.com/hashicorp/terraform-provider-google/google.(*frameworkProvider).ConfigureWithData(, {, _}, {{0x0, {0x0, 0x0}}, {0x0, {0x0, 0x0}}, {0x0, …}, …}, …)
github.com/hashicorp/terraform-provider-google/google.(*frameworkProvider).Configure(0xc00011d500, {0x3575238, 0xc0001dc000}, {{0xc00121e060, 0x5}, {{{0x357b990, 0xc00128b920}, {0x2b3a1e0, 0xc0001fb3b0}}, {0x357ce58, …}}}, …)
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ConfigureProvider(0xc0004b0160, {0x3575238, 0xc0001dc000}, 0xc000f10cc0, 0xc000f10c40)
github.com/hashicorp/terraform-plugin-framework/internal/proto5server.(*Server).ConfigureProvider(0xc0004b0160, {0x3575238?, 0xc001091f20?}, 0x3?)
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ConfigureProvider({0xc000983650, 0xc0009836b0, {0xc000faa460, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, …}, …}, …)
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).Configure(0xc000508d20, {0x3575238?, 0xc001090690?}, 0xc000f108c0)
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_Configure_Handler({0x2f08860?, 0xc000508d20}, {0x3575238, 0xc001090690}, 0xc000db6000, 0x0)
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000001680, {0x357bc20, 0xc000bac340}, 0xc000ec4900, 0xc000ff9290, 0x47d66b8, 0x0)
google.golang.org/grpc.(*Server).handleStream(0xc000001680, {0x357bc20, 0xc000bac340}, 0xc000ec4900, 0x0)
google.golang.org/grpc.(*Server).serveStreams.func1.2()
created by google.golang.org/grpc.(*Server).serveStreams.func1
Error: The terraform-provider-google_v4.53.0_x5 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.