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

Can't create site network template with TACACS conifg #86

Open
rczf opened this issue Feb 20, 2025 · 0 comments
Open

Can't create site network template with TACACS conifg #86

rczf opened this issue Feb 20, 2025 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rczf
Copy link

rczf commented Feb 20, 2025

Describe the bug

Plugin did not respond error while trying to apply site network template with tacacs = {} section.

To Reproduce

Create and apply switch template with tacacs configuration.

Terraform configuration

An extract of the Terraform configuration related to this issue

resource "mist_site_networktemplate" "TEST" {
  remove_existing_configs = true
  site_id                 = mist_site.TEST.id
  switch_mgmt             = {
    tacacs                = {
      default_role = "none"
      enabled      = false
    }
  }
}
...

Error Message

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.sites_EMEA.mist_site_networktemplate.TEST will be updated in-place
  ~ resource "mist_site_networktemplate" "TEST" {
      + switch_mgmt             = {
          + ap_affinity_threshold = 10
          + config_revert_timer   = 10
          + dhcp_option_fqdn      = false
          + mxedge_proxy_port     = 2222
          + tacacs                = {
              + default_role = "none"
              + enabled      = false
            }
        }
        # (2 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.sites_EMEA.mist_site_networktemplate.TEST: Modifying...
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-mist_v0.2.20 plugin:

panic: interface conversion: interface {} is resource_site_networktemplate.ProtectReValue, not resource_site_networktemplate.TacacsValue

goroutine 44 [running]:
github.com/Juniper/terraform-provider-mist/internal/resource_site_networktemplate.switchMgmtTacacsTerraformToSdk({0x3854a58, 0xc00077b170}, 0xc00057f558, {0xc0005984e0?, 0xc000312600?, 0x10?})
        github.com/Juniper/terraform-provider-mist/internal/resource_site_networktemplate/terraform_to_sdk_switch_mgmt.go:124 +0x30d
github.com/Juniper/terraform-provider-mist/internal/resource_site_networktemplate.switchMgmtTerraformToSdk({0x3854a58, _}, _, {{0x2, 0xa}, {0x0, {0x0, 0x0}}, {0x0, 0x0}, ...})
        github.com/Juniper/terraform-provider-mist/internal/resource_site_networktemplate/terraform_to_sdk_switch_mgmt.go:206 +0x73f
github.com/Juniper/terraform-provider-mist/internal/resource_site_networktemplate.TerraformToSdk({0x3854a58, 0xc00077b170}, 0xc000430808)
        github.com/Juniper/terraform-provider-mist/internal/resource_site_networktemplate/terraform_to_sdk.go:150 +0x229c
github.com/Juniper/terraform-provider-mist/internal/provider.(*siteNetworkTemplateResource).Update(0xc000777b40, {0x3854a58, 0xc00077b170}, {{{{0x3892c78, 0xc0001ea2a0}, {0x2e142a0, 0xc000164060}}, {0x3899c88, 0xc0001db180}}, {{{0x3892c78, ...}, ...}, ...}, ...}, ...)
        github.com/Juniper/terraform-provider-mist/internal/provider/site_networktemplate_resource.go:173 +0x2a5
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).UpdateResource(0xc0001aa008, {0x3854a58, 0xc00077b170}, 0xc000581480, 0xc000581458)
        github.com/hashicorp/[email protected]/internal/fwserver/server_updateresource.go:122 +0x6ee
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange(0xc0001aa008, {0x3854a58, 0xc00077b170}, 0xc000162730, 0xc000581640)
        github.com/hashicorp/[email protected]/internal/fwserver/server_applyresourcechange.go:102 +0x192
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0xc0001aa008, {0x3854a58?, 0xc00077b080?}, 0xc000162690)
        github.com/hashicorp/[email protected]/internal/proto6server/server_applyresourcechange.go:55 +0x38e
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0xc0001ac000, {0x3854a58?, 0xc00077a6f0?}, 0xc000176bd0)
        github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:865 +0x3bc
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x30ea7e0, 0xc0001ac000}, {0x3854a58, 0xc00077a6f0}, 0xc000416a00, 0x0)
        github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:611 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001a0000, {0x3854a58, 0xc00077a660}, {0x38960e0, 0xc0001ae1a0}, 0xc000773b00, 0xc00019e6f0, 0x4954d98, 0x0)
        google.golang.org/[email protected]/server.go:1394 +0xe2b
google.golang.org/grpc.(*Server).handleStream(0xc0001a0000, {0x38960e0, 0xc0001ae1a0}, 0xc000773b00)
        google.golang.org/[email protected]/server.go:1805 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/[email protected]/server.go:1029 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 27
        google.golang.org/[email protected]/server.go:1040 +0x125

Error: The terraform-provider-mist_v0.2.20 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.
@rczf rczf added the bug Something isn't working label Feb 20, 2025
tmunzer added a commit that referenced this issue Feb 20, 2025
@tmunzer tmunzer added this to the v0.2.21 milestone Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants