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

stack trace with ibm_pi_dhcps data resource #3951

Closed
clnperez opened this issue Aug 4, 2022 · 1 comment · Fixed by #3954
Closed

stack trace with ibm_pi_dhcps data resource #3951

clnperez opened this issue Aug 4, 2022 · 1 comment · Fixed by #3954
Labels
bug crash Panics on provider service/Power Systems Issues related to Power Systems

Comments

@clnperez
Copy link

clnperez commented Aug 4, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

~> terraform version
Terraform v1.2.5
on linux_amd64

Affected Resource(s)

  • ibm_pi_dhcps (data)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

# query dhcp services, match a name

locals {
  ids = data.ibm_pi_dhcps.dhcps.servers[*].network_id
  names = data.ibm_pi_dhcps.dhcps.servers[*].network_name
  dhcp_id_from_name = matchkeys(local.ids, local.names, ["dhcpserver"])[0]
}

provider "ibm" {
  ibmcloud_api_key = "..."
  region           = "tor"
  zone             = "tor01"
}

data "ibm_pi_dhcps" "dhcps" {
  pi_cloud_instance_id = "..."
}

output dhcps {
  value = data.ibm_pi_dhcps.dhcps
}

output dhcp_id {
  value = local.dhcp_id_from_name
}

Note: this may be incorrect TF, but, it does panic so I figure even if I have errors, it shouldn't panic, so I'm uploading it as-is.

Debug Output

Panic Output

│   with data.ibm_pi_dhcps.dhcps,
│   on main.tf line 16, in data "ibm_pi_dhcps" "dhcps":
│   16: data "ibm_pi_dhcps" "dhcps" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-ibm_v1.44.1 plugin:

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

goroutine 131 [running]:
github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power.dataSourceIBMPIDhcpServersRead(0x37a2788, 0xc000488d80, 0xc000151280, 0x31f4680, 0xc0004b9b00, 0xc00133ee20, 0x616d65686373, 0x40e198)
        github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/power/data_source_ibm_pi_dhcps.go:101 +0x36f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0009336c0, 0x37a27c0, 0xc0013487e0, 0xc000151280, 0x31f4680, 0xc0004b9b00, 0x0, 0x0, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:724 +0x17f
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0009336c0, 0x37a27c0, 0xc0013487e0, 0xc000151180, 0x31f4680, 0xc0004b9b00, 0xc0004b9b00, 0xc000151180, 0x0, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/resource.go:943 +0x15c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc0005655d8, 0x37a2718, 0xc0013487e0, 0xc001342340, 0x32217e1, 0x12, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/helper/schema/grpc_provider.go:1179 +0x5b6
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0xc00009c640, 0x37a27c0, 0xc001348000, 0xc00134c000, 0x0, 0x0, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/tf5server/server.go:657 +0x410
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler(0x3118b60, 0xc00009c640, 0x37a27c0, 0xc001348000, 0xc000488840, 0x0, 0x37a27c0, 0xc001348000, 0xc0012100c0, 0x60)
        github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:421 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00019e700, 0x37be458, 0xc000dde4e0, 0xc001627c20, 0xc000db3ad0, 0x48bc850, 0x0, 0x0, 0x0)
        google.golang.org/grpc@v1.45.0/server.go:1282 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc00019e700, 0x37be458, 0xc000dde4e0, 0xc001627c20, 0x0)
        google.golang.org/grpc@v1.45.0/server.go:1619 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc00003f410, 0xc00019e700, 0x37be458, 0xc000dde4e0, 0xc001627c20)
        google.golang.org/grpc@v1.45.0/server.go:921 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.45.0/server.go:919 +0x1fd

Error: The terraform-provider-ibm_v1.44.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.

Expected Behavior

no panic

Actual Behavior

panic

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added bug crash Panics on provider service/Power Systems Issues related to Power Systems labels Aug 4, 2022
@clnperez clnperez changed the title stack trace with ibm_pi_dhcps data resources stack trace with ibm_pi_dhcps data resource Aug 4, 2022
@yussufsh
Copy link
Collaborator

yussufsh commented Aug 6, 2022

Looks like got introduced by recent changes. #3916
Thanks for reporting.

yussufsh added a commit to yussufsh/terraform-provider-ibm that referenced this issue Aug 6, 2022
Fixes IBM-Cloud#3951

Signed-off-by: Yussuf Shaikh <yussuf.shaikh1@ibm.com>
hkantare pushed a commit that referenced this issue Aug 9, 2022
Fixes #3951

Signed-off-by: Yussuf Shaikh <yussuf.shaikh1@ibm.com>
SunithaGudisagarIBM pushed a commit to ibm-vpc/terraform-provider-ibm that referenced this issue Sep 14, 2022
Fixes IBM-Cloud#3951

Signed-off-by: Yussuf Shaikh <yussuf.shaikh1@ibm.com>
SunithaGudisagarIBM pushed a commit to ibm-vpc/terraform-provider-ibm that referenced this issue Sep 14, 2022
Fixes IBM-Cloud#3951

Signed-off-by: Yussuf Shaikh <yussuf.shaikh1@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crash Panics on provider service/Power Systems Issues related to Power Systems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants