hashicorp / terraform-provider-azure-classic

Terraform Azure Classic (Service Management) provider
https://www.terraform.io/docs/providers/azure/
Mozilla Public License 2.0
3 stars 11 forks source link

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

Closed hashibot closed 6 years ago

hashibot commented 7 years ago

This issue was originally opened by @davehodgson as hashicorp/terraform#4143. It was migrated here as part of the provider split. The original body of the issue is below.


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

hashibot commented 7 years ago

This comment was originally opened by @davehodgson as https://github.com/hashicorp/terraform/issues/4143#issuecomment-161420392. It was migrated here as part of the provider split. The original comment is below.


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

hashibot commented 7 years ago

This comment was originally opened by @jen20 as https://github.com/hashicorp/terraform/issues/4143#issuecomment-161421404. It was migrated here as part of the provider split. The original comment is below.


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
vancluever commented 6 years ago

Hello!

Thank you for opening this issue and participating in the discussion. Today (December 19, 2017) we’ve announced the deprecation and archival of the Azure Classic Provider. Matching Microsoft’s commitment to gradually remove access to Azure Classic (or Service Management) which is outlined in this blog post, we are closing all open PR's and Issues here. This repository will remain available here on GitHub, but in an archived state, and no longer receiving support or new releases.

The Azure (Resource Manager) Provider remains fully supported and is our recommended approach for managing Azure with Terraform. More information about this process is available in the blog post linked above.

Thanks! The Terraform Team