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

provider/azurerm: arm_virtual_machine diagnostics_profile was causing a panic on the Read func #9122

Merged
merged 1 commit into from Oct 7, 2016

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 29, 2016

Fixes #8995

The Diagnostics profile was a badly laid out resource. All we needed to
set was whether it was enabled and the storage account to save the logs
to. The old schema parameter was deprecated and replaced with a much
simplier structure

% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_diagnosticsProfile'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/29 12:21:04 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_diagnosticsProfile -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_diagnosticsProfile
--- PASS: TestAccAzureRMVirtualMachine_diagnosticsProfile (1066.76s)
PASS
ok
github.com/hashicorp/terraform/builtin/providers/azurerm1066.776s

@rrudduck
Copy link
Contributor

I pulled this locally, merged it, and tested it. Unfortunately I still had the same null-reference issue. I should be able to get you some logs if needed.

2016-09-30T16:41:07.0902574Z ##[error]panic: runtime error: invalid memory address or nil pointer dereference
2016-09-30T16:41:07.0902574Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: [signal 0xc0000005 code=0x0 addr=0x0 pc=0xa8af53]
2016-09-30T16:41:07.0902574Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe:
2016-09-30T16:41:07.0902574Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: goroutine 2161 [running]:
2016-09-30T16:41:07.0902574Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: panic(0x28f7540, 0xc042008080)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /usr/local/go/src/runtime/panic.go:500 +0x1af
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineRead(0xc042396180, 0x2a9b860, 0xc042081000, 0x0, 0x17)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /vagrant/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine.go:605 +0xd43
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: github.com/hashicorp/terraform/helper/schema.(_Resource).Refresh(0xc042305560, 0xc0421e0cd0, 0x2a9b860, 0xc042081000, 0xc04215e318, 0x1, 0x18)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /vagrant/src/github.com/hashicorp/terraform/helper/schema/resource.go:259 +0x138
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: github.com/hashicorp/terraform/helper/schema.(_Provider).Refresh(0xc0423bd800, 0xc0420b5980, 0xc0421e0cd0, 0x0, 0x0, 0x0)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /vagrant/src/github.com/hashicorp/terraform/helper/schema/provider.go:203 +0x98
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: github.com/hashicorp/terraform/plugin.(_ResourceProviderServer).Refresh(0xc0423baba0, 0xc042680d80, 0xc042681320, 0x0, 0x0)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /vagrant/src/github.com/hashicorp/terraform/plugin/resource_provider.go:482 +0x55
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: reflect.Value.call(0xc042304de0, 0xc0423ef5f8, 0x13, 0x2eb4547, 0x4, 0xc04256ded0, 0x3, 0x3, 0xc042138420, 0x0, ...)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /usr/local/go/src/reflect/value.go:434 +0x5cf
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: reflect.Value.Call(0xc042304de0, 0xc0423ef5f8, 0x13, 0xc04256ded0, 0x3, 0x3, 0xc042569f70, 0xc042569f68, 0xc042569b9e)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /usr/local/go/src/reflect/value.go:302 +0xab
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: net/rpc.(_service).call(0xc0423bf5c0, 0xc0423bf580, 0xc0424ca8d8, 0xc04226a980, 0xc0423bb3a0, 0x2659140, 0xc042680d80, 0x16, 0x2659180, 0xc042681320, ...)
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /usr/local/go/src/net/rpc/server.go:383 +0x14f
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: created by net/rpc.(*Server).ServeCodec
2016-09-30T16:41:07.1055218Z ##[error]2016/09/30 16:41:05 [DEBUG] plugin: terraform.exe: /usr/local/go/src/net/rpc/server.go:477 +0x428

@stack72 stack72 changed the title provider/azurerm: arm_virtual_machine diagnostics_profile was causing a panic on the Read func [WIP] provider/azurerm: arm_virtual_machine diagnostics_profile was causing a panic on the Read func Oct 3, 2016
@stack72
Copy link
Contributor Author

stack72 commented Oct 3, 2016

Hi @rrudduck

I have deprecated the use of diagnostics_profile in-favour of boot_diagnostics as the top level parameter. This is now allowing this to work as expected:

% TF_LOG=1 make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_diagnosticsProfile' 2>~/tf.log                                                                   2 ↵ ✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v -run=TestAccAzureRMVirtualMachine_diagnosticsProfile -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_diagnosticsProfile
--- PASS: TestAccAzureRMVirtualMachine_diagnosticsProfile (1191.21s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    1191.229s

The documentation has been updated to reflect this

Paul

@stack72 stack72 changed the title [WIP] provider/azurerm: arm_virtual_machine diagnostics_profile was causing a panic on the Read func provider/azurerm: arm_virtual_machine diagnostics_profile was causing a panic on the Read func Oct 3, 2016
panic on the Read func

Fixes #8995

The Diagnostics profile was a badly laid out resource. All we needed to
set was whether it was enabled and the storage account to save the logs
to. The old schema parameter was deprecated and replaced with a much
simplier structure

```
% make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_diagnosticsProfile'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/29 12:21:04 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_diagnosticsProfile -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_diagnosticsProfile
--- PASS: TestAccAzureRMVirtualMachine_diagnosticsProfile (1066.76s)
PASS
ok
github.com/hashicorp/terraform/builtin/providers/azurerm1066.776s
```
Copy link
Contributor

@jen20 jen20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ghost
Copy link

ghost commented Apr 21, 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.

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

Successfully merging this pull request may close these issues.

Terraform 0.7.4 crash during planning with azurerm provider
3 participants