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

Terraform Crashes #1701

Closed
Prajyot-Parab opened this issue Jul 17, 2020 · 10 comments
Closed

Terraform Crashes #1701

Prajyot-Parab opened this issue Jul 17, 2020 · 10 comments
Labels
service/Power Systems Issues related to Power Systems

Comments

@Prajyot-Parab
Copy link

Prajyot-Parab commented Jul 17, 2020

terraform apply results in crash on PowerVS - Washington and Dallas region.

Terraform Version

Terraform v0.12.20

Affected Resource(s)

  • Multiple resources

Panic Output

crash.log

Expected Behavior

What should have happened?
terraform apply command should have worked fine.

Actual Behavior

What actually happened?
terraform apply command results in a crash.

Steps to Reproduce

  1. terraform apply

Important Factoids

  • Observed in Washington and Dallas region of PowerVS
Dallas
- ibmcloud_region     = "us-south"
- ibmcloud_zone       = "us-south"

Washington
- ibmcloud_region     = "us-east"
- ibmcloud_zone       = "us-east"
@Prajyot-Parab
Copy link
Author

@surajsub ^^^

@surajsub
Copy link
Contributor

Hmm - it should not crash.. do you have your key loaded on the service instance. I'll take a deeper look at it

@surajsub
Copy link
Contributor

what resource are you trying to provision

@Prajyot-Parab
Copy link
Author

what resource are you trying to provision

We are trying to create VSI

@Prajyot-Parab
Copy link
Author

Hmm - it should not crash.. do you have your key loaded on the service instance. I'll take a deeper look at it

This works fine with London, Toronto regions so I believe the key part should be fine.

@yussufsh
Copy link
Collaborator

After looking at the crash logs found that the index out of bound error here: https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/ibm/data_source_ibm_pi_public_network.go#L71

panic: runtime error: index out of range [0] with length 0
2020-07-16T12:32:57.972Z [DEBUG] plugin.terraform-provider-ibm:
2020-07-16T12:32:57.972Z [DEBUG] plugin.terraform-provider-ibm: goroutine 43 [running]:
2020-07-16T12:32:57.972Z [DEBUG] plugin.terraform-provider-ibm: github.com/IBM-Cloud/terraform-provider-ibm/ibm.dataSourceIBMPIPublicNetworksRead(0xc0004ccaf0, 0x2284220, 0xc0002f7800, 0xc0004ccaf0, 0x0)
2020-07-16T12:32:57.972Z [DEBUG] plugin.terraform-provider-ibm:         /root/go/src/github.com/IBM-Cloud/src/github.com/IBM-Cloud/terraform-provider-ibm/ibm/data_source_ibm_pi_public_network.go:71 +0x2c3

This was failing because there were no public networks here. As a workaround I create a LPAR manually which creating the public network for me.

Feel that this should be taken care in the provider code to handle the failure when public network does not exist initially.
@surajsub

@surajsub
Copy link
Contributor

The power instance does not create a public network when a new instance is created . The public network is created only when 1st pvm instance is created.. It's a chicken and egg problem. I will discuss with the power team.

@yussufsh
Copy link
Collaborator

Hi @surajsub

Can we have something like a flag for public ip pi_public_network in pi_instance? Just like the Gen2 VSI?

@yussufsh
Copy link
Collaborator

Another suggestion is to create the public network if does not exist using data_source_ibm_pi_public_network.

@kavya498
Copy link
Collaborator

kavya498 commented Jul 6, 2021

Fixed the crash..
Closing this issue.. Thanks

@kavya498 kavya498 closed this as completed Jul 6, 2021
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

No branches or pull requests

4 participants