PaloAltoNetworks / terraform-templates

This repo contains Terraform templates to deploy infrastructure on AWS and Azure and to secure them using the Palo Alto Networks Next Generation Firewalls
Apache License 2.0
146 stars 151 forks source link

create syslog profile using panos_syslog_server_profile results in stack trace #37

Closed gopurx closed 1 year ago

gopurx commented 1 year ago

Describe the bug

While using resource "panos_syslog_server_profile" is resulting in stack trace

Expected behavior

Creation of syslog server profile

Current behavior

terraform apply fails with go lang stack trace

Possible solution

Steps to reproduce

`resource "panos_syslog_server_profile" "syslog_setup" { name = "myProfile" syslog_server { name = "my-server" server = "syslog.example.com" }

lifecycle {
    create_before_destroy = true
}

}`

Error: `Plan: 1 to add, 0 to change, 0 to destroy. panos_syslog_server_profile.syslog_setup: Creating... ╷ │ Error: Request cancelled │ │ with panos_syslog_server_profile.syslog_setup, │ on templates.tf line 54, in resource "panos_syslog_server_profile" "syslog_setup": │ 54: resource "panos_syslog_server_profile" "syslog_setup" { │ │ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled. ╵

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

panic: interface conversion: interface {} is nil, not string

goroutine 47 [running]: github.com/terraform-providers/terraform-provider-panos/panos.createSyslogServerProfile(0x1da3660, {0x1f1a2c0, 0xc00000a1e0}) github.com/terraform-providers/terraform-provider-panos/panos/syslog_server_profile.go:145 +0x56c github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).Apply(0xc0007d0960, 0xc0008f6f50, 0xc00091e1e0, {0x1f1a2c0, 0xc00000a1e0}) 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(0xc0001a8900, 0xc000e21a68, 0x1f2e05d, 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(0xc0000b3520, {0xc0008f0cb0, 0x10b08e6}, 0xc0008f0cb0) 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({0x1edfec0, 0xc0000b3520}, {0x2170bf0, 0xc0007e4300}, 0xc00064c0c0, 0x0) github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/tfplugin5/tfplugin5.pb.go:3305 +0x170 google.golang.org/grpc.(Server).processUnaryRPC(0xc0008d4380, {0x2181c20, 0xc0005fa000}, 0xc000316b00, 0xc0008d3920, 0x295e3c0, 0x0) google.golang.org/grpc@v1.32.0/server.go:1194 +0xc8f google.golang.org/grpc.(Server).handleStream(0xc0008d4380, {0x2181c20, 0xc0005fa000}, 0xc000316b00, 0x0) google.golang.org/grpc@v1.32.0/server.go:1517 +0xa2a google.golang.org/grpc.(Server).serveStreams.func1.2() google.golang.org/grpc@v1.32.0/server.go:859 +0x98 created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/grpc@v1.32.0/server.go:857 +0x294

Error: The terraform-provider-panos_v1.11.1 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 1 year ago

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

gopurx commented 1 year ago

by mistake created for this repo