PaloAltoNetworks / terraform-provider-panos

Terraform Panos provider
https://www.terraform.io/docs/providers/panos/
MIT License
89 stars 71 forks source link

1.10 provider and Terraform 1.1.7 crashes on stock Panorama 1.10.13 Azure Marketplace appliance #331

Closed jstewart612 closed 2 years ago

jstewart612 commented 2 years ago

The resource:

resource "panos_general_settings" "panorama-test" {
  hostname                = "panorama-test001.nonprod.useast2.rentpath.com"
  dns_primary             = "172.28.106.254"
  dns_secondary           = "1.1.1.1"
  ntp_primary_address     = "ipa001.useast2.rentpath.com"
  ntp_secondary_address   = "0.ro.pool.ntp.org"
  ntp_primary_auth_type   = "none"
  ntp_secondary_auth_type = "none"
  timezone                = "US/Eastern"
}

The crash:

running "/usr/local/bin/terraform apply -input=false -parallelism=250 \"/atlantis-data/repos/rentpath/terraform/2954/default/neteng/network-test/panorama-test/default.tfplan\"" in "/atlantis-data/repos/rentpath/terraform/2954/default/neteng/network-test/panorama-test": exit status 1
panos_general_settings.panorama-test: Creating...
╷
│ Error: Plugin did not respond
│ 
│   with panos_general_settings.panorama-test,
│   on general_settings.tf line 1, in resource "panos_general_settings" "panorama-test":
│    1: resource "panos_general_settings" "panorama-test" {
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵

Stack trace from the terraform-provider-panos_v1.10.0 plugin:

panic: interface conversion: interface {} is *pango.Panorama, not *pango.Firewall

goroutine 32 [running]:
github.com/terraform-providers/terraform-provider-panos/panos.createUpdateGeneralSettings(0xc000ad93b0, 0x1530300, 0xc00000a1e0, 0x2, 0x1ed8b40)
    github.com/terraform-providers/terraform-provider-panos/panos/resource_general_settings.go:181 +0x434
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc00044bea0, 0xc000cfdc20, 0xc0007e5a00, 0x1530300, 0xc00000a1e0, 0x139dc01, 0xc000227dd8, 0xc0003d90e0)
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/resource.go:320 +0x375
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc0001bc600, 0xc000679a38, 0xc000cfdc20, 0xc0007e5a00, 0xc0000cebc8, 0xc0007e3d10, 0x139fb20)
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/helper/schema/provider.go:294 +0x99
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc00000eb28, 0x17723d0, 0xc0002f3620, 0xc000ad8e00, 0xc00000eb28, 0xc0002f3620, 0xc00014dba0)
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/helper/plugin/grpc_provider.go:895 +0x8a5
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x14ea840, 0xc00000eb28, 0x17723d0, 0xc0002f3620, 0xc000e81aa0, 0x0, 0x17723d0, 0xc0002f3620, 0xc000acef00, 0x49d)
    github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/tfplugin5/tfplugin5.pb.go:3305 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003536c0, 0x177b938, 0xc000415800, 0xc0007f0700, 0xc0009a4600, 0x1e97b20, 0x0, 0x0, 0x0)
    google.golang.org/grpc@v1.32.0/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc0003536c0, 0x177b938, 0xc000415800, 0xc0007f0700, 0x0)
    google.golang.org/grpc@v1.32.0/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000126210, 0xc0003536c0, 0x177b938, 0xc000415800, 0xc0007f0700)
    google.golang.org/grpc@v1.32.0/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
    google.golang.org/grpc@v1.32.0/server.go:857 +0x1fd

Error: The terraform-provider-panos_v1.10.0 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.
welcome-to-palo-alto-networks[bot] commented 2 years ago

:tada: Thanks for opening your first issue here! Welcome to the community!

shinmog commented 2 years ago

Unfortunately this resource is firewall only and does not yet support Panorama. Just verified, but this is also called out in the docs.

A github issue is already open for wanting to configure Panorama general settings: https://github.com/PaloAltoNetworks/terraform-provider-panos/issues/313

I'm going to change this crash to a nice error saying that there is no Panorama equivalent so this is more apparent, then will close this issue out.