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

meraki_networks panics on creation if the organization id is invalid #101

Closed
1 of 3 tasks
VenelinMartinov opened this issue Jul 8, 2024 · 3 comments
Closed
1 of 3 tasks

Comments

@VenelinMartinov
Copy link

Prerequisites

  • Have you tested the operation in the API directly?
  • Do you have the latest Terraform provider version?
  • Review the compatibility matrix before opening an issue.

Describe the bug
A clear and concise description of what the bug is.

Running the example in the meraki_networks docs triggers a panic upon creation:

https://registry.terraform.io/providers/cisco-open/meraki/latest/docs/resources/networks

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # meraki_networks.example will be created
  + resource "meraki_networks" "example" {
      + enrollment_string           = (known after apply)
      + id                          = (known after apply)
      + is_bound_to_config_template = (known after apply)
      + name                        = "Main Office"
      + network_id                  = (known after apply)
      + notes                       = "Additional description of the network"
      + organization_id             = "your_organization_id"
      + product_types               = [
          + "appliance",
          + "switch",
          + "wireless",
        ]
      + tags                        = [
          + "tag1",
          + "tag2",
        ]
      + time_zone                   = "America/Los_Angeles"
      + url                         = (known after apply)
    }

Plan: 1 to add, 0 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.

yes
  Enter a value:
meraki_networks.example: Creating...
╷
│ Error: Request cancelled
│
│ The plugin6.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵

Stack trace from the terraform-provider-meraki_v0.2.5-alpha plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10343f6ac]

goroutine 13 [running]:
github.com/cisco-open/terraform-provider-meraki/internal/provider.getAllItemsNetworks({{0x14000166280, 0x1400010c6c0}, 0x14000118300, 0x14000118300, 0x14000118300, 0x14000118300, 0x14000118300, 0x14000118300, 0x14000118300, 0x14000118300, ...}, ...)
	github.com/cisco-open/terraform-provider-meraki/internal/provider/resource_meraki_networks.go:521 +0x9c
github.com/cisco-open/terraform-provider-meraki/internal/provider.(*NetworksResource).Create(0x1400007a4d8, {0x104053348, 0x1400044a8a0}, {{{{0x10405af88, 0x1400020e0c0}, {0x103dd7d00, 0x1400044ba40}}, {0x10406d128, 0x14000140050}}, {{{0x10405af88, ...}, ...}, ...}, ...}, ...)
	github.com/cisco-open/terraform-provider-meraki/internal/provider/resource_meraki_networks.go:167 +0x350
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).CreateResource(0x140001e3040, {0x104053348, 0x1400044a8a0}, 0x1400017f560, 0x1400017f500)
	github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/fwserver/server_createresource.go:101 +0x41c
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange(0x1400017f6c0?, {0x104053348, 0x1400044a8a0}, 0x140004600a0, 0x1400017f6c0)
	github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/fwserver/server_applyresourcechange.go:57 +0x380
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0x140001e3040, {0x104053348?, 0x1400044a780?}, 0x14000460000)
	github.com/hashicorp/terraform-plugin-framework@v1.7.0/internal/proto6server/server_applyresourcechange.go:55 +0x314
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0x1400022e8c0, {0x104053348?, 0x140003fdda0?}, 0x14000226310)
	github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/tf6server/server.go:865 +0x2b0
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x104003940?, 0x1400022e8c0}, {0x104053348, 0x140003fdda0}, 0x14000328b00, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:518 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001ab000, {0x104053348, 0x14000417dd0}, {0x10406b618, 0x1400047a000}, 0x1400037f440, 0x140003079b0, 0x1048b83d8, 0x0)
	google.golang.org/grpc@v1.63.2/server.go:1369 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x140001ab000, {0x10406b618, 0x1400047a000}, 0x1400037f440)
	google.golang.org/grpc@v1.63.2/server.go:1780 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/grpc@v1.63.2/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 20
	google.golang.org/grpc@v1.63.2/server.go:1030 +0x150

Error: The terraform-provider-meraki_v0.2.5-alpha 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.

Error: exit status 1

Expected behavior
A clear and concise description of what you expected to happen.

No panic should happen - if an error has happened it should be displayed instead.

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

Environment (please complete the following information):

  • Meraki Dashboard version:
  • Terraform version: Terraform v1.9.1
  • Meraki provider version: 0.2.5-alpha
  • OS Version:

Additional context
Add any other context about the problem here.

@VenelinMartinov VenelinMartinov changed the title meraki_networks panics on creation meraki_networks panics on creation if the organization id is invalid Jul 8, 2024
fmunozmiranda added a commit that referenced this issue Jul 10, 2024
…#101

- wireless identity psk configuration works but the output showing bug error #89
fmunozmiranda added a commit that referenced this issue Jul 15, 2024
BUGFIXES:
* Issue #88 fixed.
* Issue #89 fixed.
* Issue #92 fixed.
* Issue #93 fixed.
* Issue #94 fixed.
* Issue #96 fixed.
* Issue #97 fixed.
* Issue #98 fixed.
* Issue #99 fixed.
* Issue #100 fixed.
* Issue #101 fixed.
* Issue #107 fixed.
* Issue #108 fixed.
* Issue #109 fixed.
@fmunozmiranda fmunozmiranda mentioned this issue Jul 15, 2024
1 task
@fmunozmiranda
Copy link
Collaborator

@VenelinMartinov please try it again with new version and update us.

@fmunozmiranda
Copy link
Collaborator

If we do not receive a response it will be closed in the next 24 hours.

@VenelinMartinov
Copy link
Author

Yup, can confirm this is fixed. Thanks for addressing @fmunozmiranda!

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

No branches or pull requests

2 participants