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

[crash-log] Azure - if instance stopped results in an error with plan or refresh #4143

Closed
davehodgson opened this issue Dec 2, 2015 · 3 comments

Comments

@davehodgson
Copy link

The attached file was generate while running terraform apply, the only change I intentionally made was to remove one .tf file from the directory which had two resources in it (a hosted service and an instance) to get terraform to delete it. I had done this probably 10 times before in the past couple of hours with no issue.

The line below is the only suspect one that I noticed in the crash log but I'm not a coder so can't be sure

2015/12/02 13:59:28 [DEBUG] terraform-provider-azure.exe: panic: runtime error: index out of range

The resources I removed intentionally are called:
resource "azure_hosted_service" "ir-Int-VM1"
resource "azure_instance" "ir-Int-VM1"

However the index out of range seems to apply to security group rules. I have had a lot of trouble getting them to apply to multiple security groups, several rules apply to several groups and I repeatedly hit contention errors, I found by running apply several (maybe 7 or 8) eventually got them al all created, not sure if that is relevant, just FYI though.
crash.log.txt

Cheers
Dave

PS: When I tried to upload the crash.log as requested, the forum errors because it can't accept .log files

@davehodgson
Copy link
Author

After some more digging, I had accidentally stopped one of the VMs in the Azure Portal: azure_instance.ir-Client-VM1

It goes to status stopped(deallocated)

I started it again and manually deleted the "azure_hosted_service" "ir-Int-VM1" cloud service which must have created before failing to create the vm on a previous run.

Terraform refresh, plan and apply now work as expected.

So it looks like perhaps a bug if one of the VMs is stopped in Azure that terraform tried to contact

@jen20
Copy link
Contributor

jen20 commented Dec 2, 2015

The relevant part of the crash log is here:

2015/12/02 13:59:28 [DEBUG] terraform-provider-azure.exe: panic: runtime error: index out of range
2015/12/02 13:59:28 [DEBUG] terraform-provider-azure.exe: 
2015/12/02 13:59:28 [DEBUG] terraform-provider-azure.exe: goroutine 270 [running]:
2015/12/02 13:59:28 [DEBUG] terraform-provider-azure.exe: github.com/hashicorp/terraform/builtin/providers/azure.resourceAzureInstanceRead(0xc082a7e420, 0x97c180, 0xc0820e09c0, 0x0, 0x0)
2015/12/02 13:59:28 [DEBUG] terraform-provider-azure.exe:   /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azure/resource_azure_instance.go:468 +0x1a5e

@davehodgson davehodgson changed the title [crash-log] Running terraform plan, apply or destroy [crash-log] Azure - if instance stopped results in an error with plan or refresh Dec 7, 2015
@ghost
Copy link

ghost commented Apr 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants