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

AppsListPublishingCredentialsFuture.Result() panics after 16.2.1 -> 17.x.x upgrade #2090

Closed
katbyte opened this issue Jun 20, 2018 · 5 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization.

Comments

@katbyte
Copy link

katbyte commented Jun 20, 2018

Hello,

Looking to update to v17 of the SDK but it appears AppsListPublishingCredentialsFuture.Result() now panics. Switching back to 16.2.1 causes the code runs just fine.

I have now tried versions 17.0.0, 17.1.0, 17.2.0, 17.3.0, 17.4.0 and they all panic.

The Panic:

[13:02:53] kt@snowbook:~/hashi/..3../terraform-providers/terraform-provider-azurerm$ make fmt; make testacc TEST=./azurerm TESTARGS=-test.run=TestAccDataSourceAzureRMAppService_basic
gofmt -w $(find . -name '*.go' |grep -v vendor)
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./azurerm -v -test.run=TestAccDataSourceAzureRMAppService_basic -timeout 180m
=== RUN   TestAccDataSourceAzureRMAppService_basic
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1bf8bf1]

goroutine 238 [running]:
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web.(*AppsListPublishingCredentialsFuture).Result(0xc420dbc190, 0x2b55060, 0xc42064a460, 0x2b58220, 0xc420d427a0, 0x0, 0x0, 0xdf8475800, 0x34630b8a000, 0x3, ...)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/Azure/azure-sdk-for-go/services/web/mgmt/2016-09-01/web/models.go:4070 +0x251
github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmAppServiceRead(0xc4202171f0, 0x28ce2e0, 0xc420d3c000, 0x2b62f00, 0xc4200438c0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_app_service.go:427 +0xedb
github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmAppServiceUpdate(0xc4202171f0, 0x28ce2e0, 0xc420d3c000, 0xc420d427a0, 0x0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_app_service.go:374 +0x807
github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmAppServiceCreate(0xc4202171f0, 0x28ce2e0, 0xc420d3c000, 0xc4202171f0, 0x0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_app_service.go:254 +0xbc2
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc4203082a0, 0xc420530d20, 0xc42031f360, 0x28ce2e0, 0xc420d3c000, 0xc420640501, 0x38, 0x0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:227 +0x35a
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc420424e00, 0xc420530780, 0xc420530d20, 0xc42031f360, 0x1, 0x1af35659, 0x0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0xa4
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform.(*EvalApply).Eval(0xc420d058c0, 0x2b85180, 0xc420c92b60, 0x2, 0x2, 0x29096f6, 0x4)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval_apply.go:57 +0x22c
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform.EvalRaw(0x2b559c0, 0xc420d058c0, 0x2b85180, 0xc420c92b60, 0x0, 0x0, 0x0, 0x0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval.go:53 +0x156
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc42031e540, 0x2b85180, 0xc420c92b60, 0x2, 0x2, 0x29096f6, 0x4)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval_sequence.go:14 +0x7a
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform.EvalRaw(0x2b55f20, 0xc42031e540, 0x2b85180, 0xc420c92b60, 0x26b8420, 0x38ef722, 0x2651600, 0xc42054cdd0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval.go:53 +0x156
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform.Eval(0x2b55f20, 0xc42031e540, 0x2b85180, 0xc420c92b60, 0xc42031e540, 0x2b55f20, 0xc42031e540, 0xc4206aebe0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/eval.go:34 +0x4d
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x2898300, 0xc420516060, 0x0, 0x0)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/terraform/graph.go:126 +0xc26
github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc4203f1f10, 0x2898300, 0xc420516060, 0xc420d22940)
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/dag/walk.go:387 +0x3a0
created by github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/dag.(*Walker).Update
	/Users/kt/hashi/go/src/github.com/terraform-providers/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform/dag/walk.go:310 +0x1248
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm	36.682s
make: *** [testacc] Error 1
[13:04:30] kt@snowbook:~/hashi/..3../terraform-providers/terraform-provider-azurerm$

Calling code:

    siteCredFuture, err := client.ListPublishingCredentials(ctx, resGroup, name)
	if err != nil {
		return err
	}
	err = siteCredFuture.WaitForCompletion(ctx, client.Client)
	if err != nil {
		return err
	}
	siteCredResp, err := siteCredFuture.Result(client)
	if err != nil {
		return fmt.Errorf("Error making Read request on AzureRM App Service Site Credential %q: %+v", name, err)
	}

(changing to WaitForCompletionRef does not put a pause to the panic)

@jhendrixMSFT
Copy link
Member

@katbyte what version of go-autorest are you using? There were some changes to the futures implementation in v17 that requires an updated go-autorest as well (v10.9+).

@katbyte
Copy link
Author

katbyte commented Jun 20, 2018

Oh sorry @jhendrixMSFT, I should have thought to include that. Here is what we are using:

[14:59:22] kt@snowbook:~/hashi/..3../terraform-providers/terraform-provider-azurerm$ govendor list | egrep autorest
 v  github.com/Azure/go-autorest/autorest                                                                                 =v10.11.2  v10.11.2
 v  github.com/Azure/go-autorest/autorest/adal                                                                            =v10.11.2  v10.11.2
 v  github.com/Azure/go-autorest/autorest/azure                                                                           =v10.11.2  v10.11.2
 v  github.com/Azure/go-autorest/autorest/azure/cli                                                                       =v10.11.2  v10.11.2
 v  github.com/Azure/go-autorest/autorest/date                                                                            =v10.11.2  v10.11.2
 v  github.com/Azure/go-autorest/autorest/to                                                                              =v10.11.2  v10.11.2
 v  github.com/Azure/go-autorest/autorest/validation                                                                      =v10.11.2  v10.11.2
[14:59:30] kt@snowbook:~/hashi/..3../terraform-providers/terraform-provider-azurerm$

@jhendrixMSFT
Copy link
Member

Thanks I can repro this. The HTTP response is a 200 and there are no async operation headers which leads me to believe this operation isn't really a LRO. Still investigating.

@jhendrixMSFT
Copy link
Member

@katbyte I have a fix for this in go-autorest, should be merged later today.

@jhendrixMSFT
Copy link
Member

Fix is now available in https://github.com/Azure/go-autorest/releases/tag/v10.11.4

@RickWinter RickWinter added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jul 12, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

No branches or pull requests

3 participants