Open venhow opened 3 years ago
@venhow Can you provide the created TF template,thank you.
@chushenmeshile please see below:
terraform { required_version = ">= 0.13" required_providers { alicloud = { source = "aliyun/alicloud" version = "~> 1.93" } } }
provider "alicloud" { region = var.region }
data "alicloud_zones" "main" { available_resource_creation = "Rds" multi = true }
data "terraform_remote_state" "vpc" { backend = "oss"
config = { bucket = "${var.proj}-${var.env}-terraform-state" prefix = var.region region = var.region key = "vpc.tfstate" } }
locals { zone_id = var.zone_id == "" ? data.alicloud_zones.main.zones[0].id : var.zone_id }
resource "alicloud_db_instance" "main" { count = var.upgrade_storage > 0 && var.vswitch_zone == "a" ? 1 : 0 engine = "MySQL" engine_version = "5.6" instance_charge_type = "Postpaid" instance_name = "${var.proj}-${var.env}-general-db" instance_storage = var.upgrade_storage db_instance_storage_type = var.db_instance_storage_type instance_type = var.instance_type auto_upgrade_minor_version = "Auto" ssl_action = "Open" security_ips = concat(data.terraform_remote_state.vpc.outputs.vswitch_app_cidrs, var.security_ips) vswitch_id = data.terraform_remote_state.vpc.outputs.vswitch_data_a_id zone_id = local.zone_id monitoring_period = var.monitoring_period sql_collector_status = var.sql_collector_status
parameters { name = "connect_timeout" value = "60" }
tags = { name = "${var.proj}-${var.env}-general-db" owner = var.owner project = var.proj environment = var.env shutdownatevening = "false" } }
resource "alicloud_db_instance" "b" { count = var.upgrade_storage > 0 && var.vswitch_zone == "b" ? 1 : 0 engine = "MySQL" engine_version = "5.6" instance_charge_type = "Postpaid" instance_name = "${var.proj}-${var.env}-general-db" instance_storage = var.upgrade_storage db_instance_storage_type = var.db_instance_storage_type instance_type = var.instance_type auto_upgrade_minor_version = "Auto" ssl_action = "Open" security_ips = concat(data.terraform_remote_state.vpc.outputs.vswitch_app_cidrs, var.security_ips) vswitch_id = data.terraform_remote_state.vpc.outputs.vswitch_data_b_id zone_id = local.zone_id monitoring_period = var.monitoring_period sql_collector_status = var.sql_collector_status
parameters { name = "connect_timeout" value = "60" }
tags = { name = "${var.proj}-${var.env}-general-db" owner = var.owner project = var.proj environment = var.env shutdownatevening = "false" } }
resource "alicloud_db_instance" "c" { count = var.upgrade_storage > 0 && var.vswitch_zone == "c" ? 1 : 0 engine = "MySQL" engine_version = "5.6" instance_charge_type = "Postpaid" instance_name = "${var.proj}-${var.env}-general-db" instance_storage = var.upgrade_storage db_instance_storage_type = var.db_instance_storage_type instance_type = var.instance_type auto_upgrade_minor_version = "Auto" ssl_action = "Open" security_ips = concat(data.terraform_remote_state.vpc.outputs.vswitch_app_cidrs, var.security_ips) vswitch_id = data.terraform_remote_state.vpc.outputs.vswitch_data_c_id zone_id = local.zone_id monitoring_period = var.monitoring_period sql_collector_status = var.sql_collector_status
parameters { name = "connect_timeout" value = "60" }
tags = { name = "${var.proj}-${var.env}-general-db" owner = var.owner project = var.proj environment = var.env shutdownatevening = "false" } }
resource "alicloud_db_backup_policy" "main" { count = var.upgrade_storage > 0 ? 1 : 0 instance_id = var.vswitch_zone == "c" ? join(",", alicloud_db_instance.c..id) : var.vswitch_zone == "b" ? join(",", alicloud_db_instance.b..id) : join(",", alicloud_db_instance.main.*.id) preferred_backup_period = var.preferred_backup_period preferred_backup_time = var.preferred_backup_time backup_retention_period = var.backup_retention_period enable_backup_log = var.enable_backup_log log_backup_retention_period = var.log_backup_retention_period }
resource "alicloud_db_instance" "instance" { engine = var.engine engine_version = var.engine_version instance_charge_type = "Postpaid" instance_name = "${var.proj}-${var.env}-mysql" instance_storage = var.instance_storage db_instance_storage_type = var.db_instance_storage_type instance_type = var.instance_type auto_upgrade_minor_version = "Auto" ssl_action = "Open" security_ips = concat(data.terraform_remote_state.vpc.outputs.vswitch_app_cidrs, var.security_ips) vswitch_id = var.vswitch_zone == "c" ? data.terraform_remote_state.vpc.outputs.vswitch_data_c_id : var.vswitch_zone == "b" ? data.terraform_remote_state.vpc.outputs.vswitch_data_b_id : data.terraform_remote_state.vpc.outputs.vswitch_data_a_id zone_id = local.zone_id monitoring_period = var.monitoring_period sql_collector_status = var.sql_collector_status
parameters { name = "connect_timeout" value = "60" }
tags = { name = "${var.proj}-${var.env}-mysql" owner = var.owner project = var.proj environment = var.env shutdownatevening = "false" } }
resource "alicloud_db_backup_policy" "instance" { instance_id = alicloud_db_instance.instance.id preferred_backup_period = var.preferred_backup_period preferred_backup_time = var.preferred_backup_time backup_retention_period = var.backup_retention_period enable_backup_log = var.enable_backup_log log_backup_retention_period = var.log_backup_retention_period }
This is crash log: crash 20201130 rds.log.txt
Terraform version: 0.13.5
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = transport is closing
panic: interface conversion: interface {} is nil, not string 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: goroutine 153 [running]: 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/aliyun/terraform-provider-alicloud/alicloud.(RdsService).WaitForDBParameter(0xc00000f538, 0xc000c381a0, 0x14, 0x1f4, 0xc000e0eed0, 0x1, 0x1) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/aliyun/terraform-provider-alicloud/alicloud/service_alicloud_rds.go:1087 +0x9f0 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/aliyun/terraform-provider-alicloud/alicloud.(RdsService).ModifyParameters(0xc00000f538, 0xc000965ea0, 0x5da565f, 0xa, 0x1, 0x1) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/aliyun/terraform-provider-alicloud/alicloud/service_alicloud_rds.go:399 +0xc0d 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/aliyun/terraform-provider-alicloud/alicloud.resourceAlicloudDBInstanceUpdate(0xc000965ea0, 0x5d40640, 0xc000469500, 0x0, 0x0) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/aliyun/terraform-provider-alicloud/alicloud/resource_alicloud_db_instance.go:290 +0x8244 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).Apply(0xc0006e3780, 0xc000b67680, 0xc000cca900, 0x5d40640, 0xc000469500, 0x4d75e01, 0xc000c11868, 0xc000a91500) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk@v1.4.0/helper/schema/resource.go:311 +0x263 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Provider).Apply(0xc000476080, 0xc000e0fa10, 0xc000b67680, 0xc000cca900, 0xc000c66e08, 0xc0000d5820, 0x4d78ca0) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk@v1.4.0/helper/schema/provider.go:294 +0x99 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(GRPCProviderServer).ApplyResourceChange(0xc00000ea20, 0x63cf5a0, 0xc000a779b0, 0xc000a0ccc0, 0xc00000ea20, 0xc000a779b0, 0xc000206b78) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk@v1.4.0/internal/helper/plugin/grpc_provider.go:885 +0x882 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x55fd420, 0xc00000ea20, 0x63cf5a0, 0xc000a779b0, 0xc000a0cc00, 0x0, 0x63cf5a0, 0xc000a779b0, 0xc000c3d000, 0xe3f) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: github.com/hashicorp/terraform-plugin-sdk@v1.4.0/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: google.golang.org/grpc.(Server).processUnaryRPC(0xc0006a0900, 0x6452500, 0xc000103b00, 0xc000223700, 0xc00046ce10, 0xc451920, 0x0, 0x0, 0x0) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: google.golang.org/grpc@v1.27.0/server.go:1024 +0x501 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: google.golang.org/grpc.(Server).handleStream(0xc0006a0900, 0x6452500, 0xc000103b00, 0xc000223700, 0x0) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: google.golang.org/grpc@v1.27.0/server.go:1313 +0xd3f 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: google.golang.org/grpc.(Server).serveStreams.func1.1(0xc00007a430, 0xc0006a0900, 0x6452500, 0xc000103b00, 0xc000223700) 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: google.golang.org/grpc@v1.27.0/server.go:722 +0xa1 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: created by google.golang.org/grpc.(Server).serveStreams.func1 2020-11-30T10:57:31.791+0800 [DEBUG] plugin.terraform-provider-alicloud_v1.104.0: google.golang.org/grpc@v1.27.0/server.go:720 +0xa1 2020-11-30T10:57:31.793+0800 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/aliyun/alicloud/1.104.0/linux_amd64/terraform-provider-alicloud_v1.104.0 pid=5723 error="exit status 2" 2020/11/30 10:57:31 [DEBUG] module.rds.alicloud_db_instance.c[0]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalMaybeTainted 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalWriteState 2020/11/30 10:57:31 [TRACE] EvalWriteState: recording 2 dependencies for module.rds.alicloud_db_instance.c[0] 2020/11/30 10:57:31 [TRACE] EvalWriteState: writing current state object for module.rds.alicloud_db_instance.c[0] 2020/11/30 10:57:31 [DEBUG] module.rds.alicloud_db_instance.instance: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalMaybeTainted 2020/11/30 10:57:31 [TRACE] EvalMaybeTainted: module.rds.alicloud_db_instance.instance encountered an error during creation, so it is now marked as tainted 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalWriteState 2020/11/30 10:57:31 [TRACE] EvalWriteState: removing state object for module.rds.alicloud_db_instance.instance 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalApplyProvisioners 2020/11/30 10:57:31 [TRACE] EvalApplyProvisioners: alicloud_db_instance.instance has no state, so skipping provisioners 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalMaybeTainted 2020/11/30 10:57:31 [TRACE] EvalMaybeTainted: module.rds.alicloud_db_instance.instance encountered an error during creation, so it is now marked as tainted 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalWriteState 2020/11/30 10:57:31 [TRACE] EvalWriteState: removing state object for module.rds.alicloud_db_instance.instance 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalIf 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalIf 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalWriteDiff 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalApplyPost 2020/11/30 10:57:31 [ERROR] eval: terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing 2020/11/30 10:57:31 [ERROR] eval: terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing 2020/11/30 10:57:31 [TRACE] [walkApply] Exiting eval tree: module.rds.alicloud_db_instance.instance 2020/11/30 10:57:31 [TRACE] vertex "module.rds.alicloud_db_instance.instance": visit complete 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "module.rds.alicloud_db_backup_policy.instance" errored, so skipping 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "module.rds.output.database_instance_id (expand)" errored, so skipping 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "output.database_instance_id (expand)" errored, so skipping 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "module.rds.output.database_port (expand)" errored, so skipping 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "output.database_port (expand)" errored, so skipping 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalApplyProvisioners 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "module.rds.output.database_connection_string (expand)" errored, so skipping 2020/11/30 10:57:31 [TRACE] EvalApplyProvisioners: alicloud_db_instance.c[0] is not freshly-created, so no provisioning is required 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalMaybeTainted 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalWriteState 2020/11/30 10:57:31 [TRACE] EvalWriteState: recording 2 dependencies for module.rds.alicloud_db_instance.c[0] 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "output.database_connection_string (expand)" errored, so skipping 2020/11/30 10:57:31 [TRACE] EvalWriteState: writing current state object for module.rds.alicloud_db_instance.c[0] 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalIf 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalIf 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalWriteDiff 2020/11/30 10:57:31 [TRACE] eval: terraform.EvalApplyPost 2020/11/30 10:57:31 [ERROR] eval: terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing 2020/11/30 10:57:31 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing 2020/11/30 10:57:31 [TRACE] [walkApply] Exiting eval tree: module.rds.alicloud_db_instance.c[0] 2020/11/30 10:57:31 [TRACE] vertex "module.rds.alicloud_db_instance.c[0]": visit complete 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "module.rds.provider["registry.terraform.io/aliyun/alicloud"] (close)" errored, so skipping 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "module.rds (close)" errored, so skipping 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping 2020/11/30 10:57:31 [TRACE] dag/walk: upstream of "root" errored, so skipping 2020-11-30T10:57:31.795+0800 [DEBUG] plugin: plugin exited
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform crashed! This is always indicative of a bug within Terraform. A crash log has been placed at "crash.log" relative to your current working directory. It would be immensely helpful if you could please report the crash with Terraform1 so that we can fix this.
When reporting bugs, please include your terraform version. That information is available on the first line of crash.log. You can also get it by running 'terraform --version' on the command line.
SECURITY WARNING: the "crash.log" file that was created may contain sensitive information that must be redacted before it is safe to share on the issue tracker.
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!