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

Plugin crashes if DHCP network ID is nil #4683

Closed
Shilpa-Gokul opened this issue Jul 12, 2023 · 4 comments · Fixed by #4685
Closed

Plugin crashes if DHCP network ID is nil #4683

Shilpa-Gokul opened this issue Jul 12, 2023 · 4 comments · Fixed by #4685
Labels
service/Power Systems Issues related to Power Systems

Comments

@Shilpa-Gokul
Copy link

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

Affected Resource(s)

  • ibm_pi_dhcps

Terraform Configuration Files

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

data "ibm_pi_dhcps" "dhcp_services" {
  pi_cloud_instance_id =  <cloud_instance_id>
}

Panic Output

https://gist.github.com/Shilpa-Gokul/69c37444decdaeddfe5073caccbe42fa

Expected Behavior

Panic should not have occurred instead a graceful cleanup or shutdown should have happened

Actual Behavior

As the network ID is nil, a panic occurred stating "invalid memory address or nil pointer dereference"

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added the service/Power Systems Issues related to Power Systems label Jul 12, 2023
@rmoralesjr
Copy link
Collaborator

What is the data center that you used?

yussufsh added a commit to yussufsh/terraform-provider-ibm that referenced this issue Jul 12, 2023
@yussufsh
Copy link
Collaborator

yussufsh commented Jul 12, 2023

Above PR will prevent plugin panic as Expected Behavior. The real issue is missing Network ID which needs to be checked by the service broker team.

@rmoralesjr
Copy link
Collaborator

On a dal10 staging, I see a nulls in network structure when in BUILD state.
[{"id":"e58bdd7b-87c6-48cc-8a98-edc9264763","network":{"id":null,"name":null},"status":"BUILD"}]

Later the get DHCP returns the network info when in ACTIVE state.
[{"id":"e58bdd7b-87c6-48cc-8a98-edc9264763","network":{"id":"8710f1fc-6e7c-4482-b134-6695f65326","name":"DHCPSERVERrene-dal10-per_Private"},"status":"ACTIVE"}]

So the terraform code should be changed to handle this temporary condition. I am not sure if this is the root cause for this issue (until we get region zone info to locate logs) but at least we know one of the scenarios to reproduce this condition.

@yussufsh
Copy link
Collaborator

On a dal10 staging, I see a nulls in network structure when in BUILD state. [{"id":"e58bdd7b-87c6-48cc-8a98-edc9264763","network":{"id":null,"name":null},"status":"BUILD"}]

Later the get DHCP returns the network info when in ACTIVE state. [{"id":"e58bdd7b-87c6-48cc-8a98-edc9264763","network":{"id":"8710f1fc-6e7c-4482-b134-6695f65326","name":"DHCPSERVERrene-dal10-per_Private"},"status":"ACTIVE"}]

So the terraform code should be changed to handle this temporary condition. I am not sure if this is the root cause for this issue (until we get region zone info to locate logs) but at least we know one of the scenarios to reproduce this condition.

When in build state dhcp.network should be nil or empty struct from the service broker instead of setting id and name to null.
The temporary fix is provided by #4685 which will also check if id is nil.

yussufsh added a commit to yussufsh/terraform-provider-ibm that referenced this issue Jul 13, 2023
hkantare pushed a commit that referenced this issue Jul 14, 2023
omaraibrahim pushed a commit to omaraibrahim/terraform-provider-ibm that referenced this issue Jul 20, 2023
benbuchanan pushed a commit to benbuchanan/terraform-provider-ibm that referenced this issue Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Power Systems Issues related to Power Systems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants