cisco-open / terraform-provider-meraki

A Terraform Provider for Cisco Meraki
Mozilla Public License 2.0
15 stars 6 forks source link

resource `meraki_networks_alerts_settings` causes a panic when attempting to import #70

Closed zbuchheit closed 2 months ago

zbuchheit commented 3 months ago

Prerequisites

Describe the bug When attempting to import meraki_networks_alerts_settings, I encounter an panic: runtime error: invalid memory address or nil pointer dereference error

Expected behavior I expect the resource to import correctly without error.

Screenshots Please provide an screenshot of the successful API call with cuRL, Postman, etc.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

obrigg commented 2 months ago

Hi Zach, Can you kindly share the TF file, and enable debugging (by setting TF_LOG=DEBUG, and adding

provider "meraki" {
  meraki_debug = "true"
}

to the TF file. This will help us identify the issue you're experiencing.

zbuchheit commented 2 months ago

The following is my TF file when I run terraform import meraki_networks_alerts_settings.example redactedId

terraform {
  required_providers {
    meraki = {
      source = "cisco-open/meraki"
      version = "0.2.3-alpha"
    }
  }
}

provider "meraki" {
  meraki_debug = "true"
}

resource "meraki_networks_alerts_settings" "example" {

}

It appears when I turn on debugging, that it responds with 200 OK and the body contains what I would expect for the resource. It then encounteres a panic immediately.

The panic stack points to provider.ResponseNetworksGetNetworkAlertsSettingsItemToBodyRs https://github.com/cisco-open/terraform-provider-meraki/blob/8e7518c39aeab69f5e702fe4474e1a57b07476c0/internal/provider/resource_meraki_networks_alerts_settings.go#L755 https://github.com/cisco-open/terraform-provider-meraki/blob/8e7518c39aeab69f5e702fe4474e1a57b07476c0/internal/provider/resource_meraki_networks_alerts_settings.go#L454

fmunozmiranda commented 2 months ago

closed due inactivity. @zbuchheit if you still have this issue, please reopen it.