首页 > 解决方案 > 为什么我会收到此 GRPCProvider UpgradeResourceState terraform 错误?

问题描述

问题:在将 terraform 从 0.14.4 更新到 1.0.8 以解决 GCP 数据目录标记表的其他一些问题后,我在尝试应用 terraform 时遇到了新错误。

│ Error: Request cancelled
│ 
│   with module.ds-bigquery.google_bigquery_table.prism_tables_no_partition["co.expenses"],
│   on ds-bigquery/bq-prism-tables.tf line 249, in resource "google_bigquery_table" "prism_tables_no_partition":
│  249: resource "google_bigquery_table" "prism_tables_no_partition" {
│ 
│ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.

和这个痕迹

Stack trace from the terraform-provider-google_v3.61.0_x5 plugin:

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

goroutine 4466 [running]:
github.com/hashicorp/terraform-provider-google/google.bigQueryTablecheckNameExists(0xc000df9600, 0x1, 0x1, 0x0, 0x2d21b78)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google/google/resource_bigquery_table.go:26 +0x164
github.com/hashicorp/terraform-provider-google/google.jsonCompareWithMapKeyOverride(0x2526520, 0xc000543940, 0x2526520, 0xc000543ae0, 0x2d22688, 0x40c201, 0xc000df9f30, 0x10)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google/google/resource_bigquery_table.go:47 +0x63f
github.com/hashicorp/terraform-provider-google/google.jsonCompareWithMapKeyOverride(0x275dac0, 0xc000c5ec00, 0x275dac0, 0xc000c5f140, 0x2d22688, 0x1, 0xc000f90120, 0xc000fd1000)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google/google/resource_bigquery_table.go:87 +0x3db
github.com/hashicorp/terraform-provider-google/google.jsonCompareWithMapKeyOverride(0x275dac0, 0xc000c5ebd0, 0x275dac0, 0xc000c5f110, 0x2d22688, 0xc000df9410, 0x194, 0x2526520)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google/google/resource_bigquery_table.go:87 +0x3db
github.com/hashicorp/terraform-provider-google/google.jsonCompareWithMapKeyOverride(0x2526520, 0xc0005439a0, 0x2526520, 0xc000543b40, 0x2d22688, 0x0, 0x0, 0x0)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google/google/resource_bigquery_table.go:56 +0x73f
github.com/hashicorp/terraform-provider-google/google.bigQueryTableSchemaDiffSuppress(0x2bf5c3a, 0x6, 0xc000e2c900, 0x88c, 0xc000e2db00, 0x88a, 0xc0012ee200, 0xc000a17500)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-google/google/resource_bigquery_table.go:147 +0x253
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.diff(0xc000936870, 0x2bf5c3a, 0x6, 0xc000946280, 0xc0005426e0, 0x31f89e0, 0xc0012ee200, 0x0, 0x0, 0x0)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.4/helper/schema/schema.go:972 +0x37c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc000936870, 0x31c7be0, 0xc000f6e380, 0xc00124a0e0, 0xc001264c30, 0xc00071fec0, 0x2bcafa0, 0xc0000b9200, 0x430fe00, 0x2561960, ...)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.4/helper/schema/schema.go:522 +0x215
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0xc00093b2c0, 0x31c7be0, 0xc000f6e380, 0xc00124a0e0, 0xc001264c30, 0x2bcafa0, 0xc0000b9200, 0x0, 0x0, 0x0)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.4/helper/schema/resource.go:446 +0x9f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).PlanResourceChange(0xc0000d2960, 0x31c7be0, 0xc000f6e380, 0xc000319540, 0xc000f6e380, 0xc0012ea500, 0x320b3c0)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.4.4/helper/schema/grpc_provider.go:693 +0x792
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).PlanResourceChange(0xc000dad120, 0x31c7be0, 0xc000f6e380, 0xc00124a000, 0xc000dad120, 0xc000e6c480, 0xc000847ba0)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/server/server.go:315 +0xac
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_PlanResourceChange_Handler(0x2b1ee60, 0xc000dad120, 0x31c7ca0, 0xc000e6c480, 0xc0012ea5a0, 0x0, 0x31c7ca0, 0xc000e6c480, 0xc000ee2000, 0x28b5)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:362 +0x217
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001bc700, 0x3202040, 0xc000702c00, 0xc000fbc700, 0xc00080c960, 0x42d0ec8, 0x0, 0x0, 0x0)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.36.0/server.go:1217 +0x50a
google.golang.org/grpc.(*Server).handleStream(0xc0001bc700, 0x3202040, 0xc000702c00, 0xc000fbc700, 0x0)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.36.0/server.go:1540 +0xcfd
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000721c40, 0xc0001bc700, 0x3202040, 0xc000702c00, 0xc000fbc700)
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.36.0/server.go:878 +0xa1
created by google.golang.org/grpc.(*Server).serveStreams.func1
    /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.36.0/server.go:876 +0x204

Error: The terraform-provider-google_v3.61.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.

我尝试过的事情:

我不知道还有什么可以在这里尝试的。

标签: terraformterraform-provider-gcp

解决方案


对我来说,这个问题的答案是运行以​​下命令:

terraform init --upgrade

就这些。如果我能在某处找到这个答案就好了。嗯,现在已经发布了。


推荐阅读