pulumi-azure: Panic when updating stack
Using pulumi cli 1.2 and the azure plugin 1.0.0 I can’t update my stacks anymore.
Here is the error I have.
Updating (my-stack):
Type Name Status Info
pulumi:pulumi:Stack my-project-my-stack **failed** 1 error; 26 messages
├─ azure:storage:Container zipdeploy 1 warning
~ └─ azure:appservice:AppService my-stack-web **updating failed** [diff: ~appSettings]; 1 error
Diagnostics:
azure:storage:Container (zipdeploy):
warning: urn:pulumi:my-stack::my-project::azure:storage/container:Container::zipdeploy verification warning: "resource_group_name": [DEPRECATED] This field has been deprecate
d and is no longer used - will be removed in 2.0 of the Azure Provider
azure:appservice:AppService (my-stack-web):
error: Plan apply failed: transport is closing
pulumi:pulumi:Stack (my-project-my-stack):
error: update failed
panic: interface conversion: interface {} is nil, not map[string]interface {}
goroutine 67 [running]:
github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure.ExpandAppServiceLogs(0x33f20a0, 0xc0000055c0, 0x4, 0x33f20a0, 0xc0000055c0, 0xc000005501)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure/app_service.go:1258 +0xcb0 github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm.resourceArmAppServiceUpdate(0xc000525b20, 0x33b1960, 0xc000316480, 0x24, 0x74ed780)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/terraform-providers/terraform-provider-azurerm/azurerm/resource_arm_app_service.go:435 +0x18b5
github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc0001ed680, 0xc000935450, 0xc000f1c160, 0x33b1960, 0xc000316480, 0x1, 0x0, 0x0)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:311 +0x26b
github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc0007a7980, 0xc000ef5840, 0xc000935450, 0xc000f1c160, 0x0, 0x0, 0x0)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:289 +0x196
github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge.(*Provider).Update(0xc000528000, 0x4183e60, 0xc00081b800, 0xc0005251f0, 0xc000528000, 0x3571101, 0xc000e74340)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi-terraform/pkg/tfbridge/provider.go:818 +0xa2b
github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_Update_Handler.func1(0x4183e60, 0xc00081b800, 0x384e6e0, 0xc0005251f0, 0x384bb20,0x74ebf68, 0x4183e60, 0xc00081b800)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go/provider.pb.go:1592 +0x8d
github.com/pulumi/pulumi-azure/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x4183e60, 0xc000633ef0, 0x384e6e0, 0xc0005251f0,0xc000e68140, 0xc000e68160, 0x0, 0x0, 0x410b120, 0xc000438920)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/server.go:57 +0x2eb
github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go._ResourceProvider_Update_Handler(0x38a8d40, 0xc000528000, 0x4183e60, 0xc000633ef0, 0xc000934e60, 0xc0006062a0, 0x4183e60, 0xc000633ef0, 0xc000e72000, 0xf5c)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/github.com/pulumi/pulumi/sdk/proto/go/provider.pb.go:1594 +0x15f
github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc000053500, 0x41d1c40, 0xc000053e00, 0xc000ee4300, 0xc0005db4d0, 0x74c0b00, 0x0, 0x0, 0x0)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:998 +0x477
github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).handleStream(0xc000053500, 0x41d1c40, 0xc000053e00, 0xc000ee4300, 0x0)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:1278 +0xdad
github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000427c50, 0xc000053500, 0x41d1c40, 0xc000053e00, 0xc000ee4300)
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:717 +0xa6
created by github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
/home/travis/gopath/src/github.com/pulumi/pulumi-azure/vendor/google.golang.org/grpc/server.go:715 +0xa8
Resources:
4 unchanged
Duration: 12s
Let me know if you need more information in order to troubleshoot this issue.
Thanks
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 47 (22 by maintainers)
Commits related to this issue
- Serialize null property values. Eliding these values prevents us from properly round-tripping resource states that include null property values. This is part of the fix for https://github.com/pulumi... — committed to pulumi/pulumi by pgavlin 5 years ago
- Serialize null property values. Eliding these values prevents us from properly round-tripping resource states that include null property values. This is part of the fix for https://github.com/pulumi... — committed to pulumi/pulumi by pgavlin 5 years ago
- Serialize null property values. (#3561) Eliding these values prevents us from properly round-tripping resource states that include null property values. This is part of the fix for https://githu... — committed to pulumi/pulumi by pgavlin 5 years ago
- Support null values in state. This allows us to be more faithful to the state generated by Terraform, and properly deserialize empty MaxItemsOne arrays. This is part of the fix for https://github.co... — committed to pulumi/pulumi-terraform-bridge by pgavlin 5 years ago
- Support null values in state. (#81) This allows us to be more faithful to the state generated by Terraform, and properly deserialize empty MaxItemsOne arrays. This is part of the fix for https:/... — committed to pulumi/pulumi-terraform-bridge by pgavlin 5 years ago
@ustun Thanks, I reproduced the panic. I think it’s different enough to warrant a new issue, so I created #454
@pgavlin Thanks for the swift reply Pat.
My pulumi version is: v1.9.1 My @pulumi/azure version is: @pulumi/azure@1.12.0
Good news is, I have been able to circumvent the issue by specifying the following (based on similar suggestions above):
Edit: Looks like I had the following in my script from a few month’s back when I got stuck on this issue that I had inserted at the top in order to solve the issue, that was causing issues for me now. The offending lines are:
Changing that to
or
fixes the issues.
So that solves the issue on my end, I hope. I’ll report if I receive any errors during further updates.
Does this mean it is a pulumi issue or user issue though? I believe this issue happens when Pulumi expects either a non-empty object or undefined (similar to what @mikhailshilkov explained here: https://github.com/pulumi/pulumi-azure/issues/383#issuecomment-539086403 )
Also note that in this case, because it actually creates the app service, but did not update the pulumi stack info, I had to manually delete the resource from Azure to be able to retry (the other choice would be to import the created resource), so I believe there are still some things pulumi could improve here.
@baoduy My attempt to apply that to the C# sample didn’t work, alas (new errors occurred). But thanks for the suggestion. I’ll need to wait until it is fixed…
Yep, same issue that @mikhailshilkov has linked to.
A thankyou for an amazing product, regardless. I have been teaching my son C# this week, and it is exciting for him to be able to work through the Pulumi samples and deploy Azure functions and .NET Core websites so easily. Super impressive. And even more so when these small issues are fixed. 😄
@baoduy I can confirm - this workaround works as expected. Previously I did not add “applicationLogs” just httpLogs. Thx again 😃
@pgavlin @lukehoban Please help me diagnose the root cause here.
The error is thrown from the TF provider when they try to convert nil to map.
The
input
parameter of that call is[map[application_logs:[<nil>] http_logs:[<nil>]]]
, sologs
map has two properties, both withnil
valuesThe Pulumi end-program never actually sets
logs
orapplicationLogs
property, so I would expect it to be missing completely.Here is the TF schema definition.
Our state file shows those log propertiese to be empty maps, not nulls:
"logs": { "applicationLogs": {},"httpLogs": {}},
Same is true for
olds
value intfbridge
provider:logs:{map[applicationLogs:{map[]} httpLogs:{map[]}]}
TF itself doesn’t seem to have this bug: probably, it never passes nils in those maps.
Pulumi works on the initial
up
but not onsubsequent
up (after the App Service is changed).Can you tell what goes wrong here?
Thanks, I can reproduce it with 1.2 (but not 1.0). Working on a solution…