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

plugin crashed when create ECI contaienr group #6894

Open
fsdrw08 opened this issue Jan 23, 2024 · 0 comments
Open

plugin crashed when create ECI contaienr group #6894

fsdrw08 opened this issue Jan 23, 2024 · 0 comments

Comments

@fsdrw08
Copy link

fsdrw08 commented Jan 23, 2024

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v1.6.6
on windows_amd64
+ provider registry.terraform.io/aliyun/alicloud v1.215.0

Affected Resource(s)

Please list the resources as a list, for example:

  • alicloud_eci_container_group

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "alicloud_eci_container_group" "eci" {
  resource_group_id = data.alicloud_resource_manager_resource_groups.rg.groups.0.id
  zone_id           = data.alicloud_vswitches.vsw.vswitches.0.zone_id
  vswitch_id        = data.alicloud_vswitches.vsw.vswitches.0.id
  security_group_id = data.alicloud_security_groups.sg.groups.0.id

  container_group_name   = var.eci_group_name
  instance_type          = var.ecs_instance_type
  restart_policy         = var.eci_restart_policy
  auto_match_image_cache = var.eci_auto_img_cache

  containers {
    name              = var.eci_group_name
    image             = "quay.io/cockpit/ws:latest"
    image_pull_policy = "IfNotPresent"

    commands = [
      "/bin/bash",
      "-c",
      <<-EOT
      cp /mnt/cockpit/..data/cockpit.conf /container/default-bastion.conf;
      /container/label-run --no-tls --port=${data.alicloud_slb_listeners.slb_listener.slb_listeners.0.backend_port};
      EOT
    ]
    # https://cockpit-project.org/guide/latest/cockpit-ws.8
    # args = [
    #   "--no-tls",
    #   "--port=${data.alicloud_slb_listeners.slb_listener.slb_listeners.0.backend_port}"
    # ]

    ports {
      port     = data.alicloud_slb_listeners.slb_listener.slb_listeners.0.backend_port
      protocol = "TCP"
    }

    liveness_probe {
      period_seconds        = "120"
      initial_delay_seconds = "60"
      success_threshold     = "1"
      failure_threshold     = "5"
      timeout_seconds       = "10"
      http_get {
        scheme = "HTTP"
        port   = data.alicloud_slb_listeners.slb_listener.slb_listeners.0.backend_port
        path   = "/"
      }
    }

    volume_mounts {
      name       = "cockpit-cm-conf"
      mount_path = "/mnt/cockpit"
    }

    volume_mounts {
      name       = "nfs-root"
      mount_path = "/mnt"
    }
  }

  volumes {
    name = "cockpit-cm-conf"
    type = "ConfigFileVolume"
    config_file_volume_config_file_to_paths {
      content = base64encode(
        templatefile("cockpit.conf", {
          FQDN = "${var.subdomain}.${data.alicloud_alidns_domains.domain.domains.0.domain_name}"
        })
      )
      path = "cockpit.conf"
    }
  }

  volumes {
    name              = "nfs-root"
    type              = "NFSVolume"
    nfs_volume_path   = "/"
    nfs_volume_server = data.alicloud_nas_mount_targets.nas_mnt.targets.0.mount_target_domain
  }

  # https://help.aliyun.com/document_detail/65415.html
  dns_config {
    name_servers = [
      "100.100.2.136",
      "100.100.2.138",
    ]
  }
}

Debug Output

Stack trace from the terraform-provider-alicloud_v1.215.0.exe plugin:

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

goroutine 45 [running]:
github.com/aliyun/terraform-provider-alicloud/alicloud.resourceAlicloudEciContainerGroupRead(0xc0021cccb0, {0x77acce0?, 0xc000aa4400?})
        github.com/aliyun/terraform-provider-alicloud/alicloud/resource_alicloud_eci_container_group.go:1487 +0x38f4   
github.com/aliyun/terraform-provider-alicloud/alicloud.resourceAlicloudEciContainerGroupCreate(0xc0021cccb0, {0x77acce0?, 0xc000aa4400?})
        github.com/aliyun/terraform-provider-alicloud/alicloud/resource_alicloud_eci_container_group.go:1285 +0x179b   
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc00155e960, 0xc002019180, 0xc0020f1820, {0x77acce0, 0xc000aa4400})
        github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/resource.go:320 +0x438
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc0000c1380, 0xc00217d8b8, 0x78113cb?, 0xf?)
        github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/provider.go:294 +0x70
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00062db28, {0xc001ffb180?, 0x49fd46?}, 0xc001ffb180)
        github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/helper/plugin/grpc_provider.go:895 +0x7c5
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x6fb4f20?, 0xc00062db28}, {0x82a3140, 0xc0020ef290}, 0xc001ffb110, 0x0)
        github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/tfplugin5/tfplugin5.pb.go:3305 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000001e0, {0x82f63a8, 0xc000d60b60}, 0xc0020eca20, 0xc001dadaa0, 0xef1e1a0, 0x0)
        google.golang.org/grpc@v1.56.3/server.go:1335 +0xde3
google.golang.org/grpc.(*Server).handleStream(0xc0000001e0, {0x82f63a8, 0xc000d60b60}, 0xc0020eca20, 0x0)
        google.golang.org/grpc@v1.56.3/server.go:1712 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.56.3/server.go:947 +0xca
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.56.3/server.go:958 +0x15c

Error: The terraform-provider-alicloud_v1.215.0.exe 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.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?

Actual Behavior

What actually happened?

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant