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

Upgrade from 4.x to 5.x causes Unknown kind bool error on applications #1338

Closed
gpduck opened this issue Sep 18, 2024 · 3 comments
Closed

Upgrade from 4.x to 5.x causes Unknown kind bool error on applications #1338

gpduck opened this issue Sep 18, 2024 · 3 comments
Labels
customer/feedback Feedback from customers kind/bug Some behavior is incorrect or out of spec

Comments

@gpduck
Copy link

gpduck commented Sep 18, 2024

Describe what happened

'application' resources cause pulumi to crash when upgrading from the 4.x to 5.x @pulumi/azuread provider. There are several properties in state that changed types and the provider is not correctly migrating state. This does not happen in the corresponding terraform provider.

Sample program

npm i @pulumi/[email protected]
import { Application } from '@pulumi/azuread';

new Application('app', {
    displayName: 'DuckTestPulumi',
});
npm i @pulumi/[email protected]

terraform going from 1.6.0 to 2.53.0 correctly migrates the state and does not produce an error

terraform {
  required_providers {
    azuread = {
      source = "hashicorp/azuread"
      version = "1.6.0"
    }
  }
}

provider "azuread" {
  # Configuration options
  tenant_id = "#####"
}

resource "azuread_application" "ducktest" {
  display_name = "DuckTestTerraform"
}

Log output

No response

Affected Resource(s)

application

Output of pulumi about

CLI
Version      3.119.0
Go Version   go1.22.3
Go Compiler  gc

Plugins
KIND      NAME     VERSION
resource  azuread  5.53.3
language  nodejs   unknown

Host
OS       Microsoft Windows 10 Enterprise
Version  10.0.19045 Build 19045
Arch     x86_64

This project is written in nodejs: executable='C:\Program Files\nodejs\node.exe' version='v22.4.1'

Current Stack: aad/dev

TYPE                                   URN
pulumi:pulumi:Stack                    urn:pulumi:dev::aad::pulumi:pulumi:Stack::aad-dev
pulumi:providers:azuread               urn:pulumi:dev::aad::pulumi:providers:azuread::default_4_3_0
azuread:index/application:Application  urn:pulumi:dev::aad::azuread:index/application:Application::app


Found no pending operations associated with dev

Backend
Name           pulumi.com
Token type     personal

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@gpduck gpduck added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 18, 2024
@mikhailshilkov mikhailshilkov added the customer/feedback Feedback from customers label Sep 20, 2024
@thomas11
Copy link
Contributor

Thank you for reporting this, @gpduck. I can reproduce it, even when upgrading to v5.0.x first.

    I0923 12:51:20.463309   84468 schema.go:324] Terraform input required_resource_access = []interface {}(nil)
    I0923 12:51:20.463311   84468 schema.go:324] Terraform input type = "webapp/api"
    I0923 12:51:20.463313   84468 schema.go:324] Terraform input public_client = []interface {}{false}
    panic: Unknown kind: bool
    goroutine 52 [running]:
    github.com/hashicorp/terraform-plugin-sdk/v2/terraform.(*ResourceConfig).get(0x1400035d4a0, 0x1400060cd40, 0x1f, 0x1400035d0e0, 0x1f, 0x104588a68, 0x20)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/terraform/resource.go:313 +0x88c
    github.com/hashicorp/terraform-plugin-sdk/v2/terraform.(*ResourceConfig).IsComputed(0x1400035d4a0, 0x1400060cd40, 0x1f, 0x103669ee0)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/terraform/resource.go:226 +0x40
    github.com/hashicorp/terraform-plugin-sdk/v2/terraform.(*ResourceConfig).Get(0x1400035d4a0, 0x1400060cd40, 0x1f, 0xd, 0x14000277b58, 0x1027bc601)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/terraform/resource.go:206 +0x40
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readPrimitive(0x1400035d500, 0x1400060cd40, 0x1f, 0x140009a7540, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1026e23bc, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:223 +0x48
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readField(0x1400035d500, 0x1400069ff40, 0x4, 0x4, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:101 +0x4c8
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*nestedConfigFieldReader).ReadField(0x1400071a3d8, 0x1400069ff40, 0x4, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x103726b00, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:327 +0x64
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.readListField(0x1038b5de8, 0x1400071a3d8, 0x1400035dd40, 0x3, 0x3, 0x14000287180, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader.go:180 +0xd4
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readSet(0x1400035d500, 0x1400035dd40, 0x3, 0x3, 0x14000287180, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:261 +0xd0
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readField(0x1400035d500, 0x1400035dd40, 0x3, 0x3, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:107 +0x688
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*nestedConfigFieldReader).ReadField(0x1400071a3d0, 0x1400035dd40, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x14000996a50, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:327 +0x64
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.readObjectField(0x1038b5de8, 0x1400071a3d0, 0x14000373100, 0x2, 0x2, 0x1400059a690, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader.go:236 +0x170
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readField(0x1400035d500, 0x14000373100, 0x2, 0x2, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:109 +0x5d8
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*nestedConfigFieldReader).ReadField(0x1400071a3c0, 0x14000373100, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:327 +0x64
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.readListField(0x1038b5de8, 0x1400071a3c0, 0x14000679408, 0x1, 0x1, 0x140002872c0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader.go:203 +0x270
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).readField(0x1400035d500, 0x14000679408, 0x1, 0x1, 0x1400004a900, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:103 +0x428
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ConfigFieldReader).ReadField(0x1400035d500, 0x14000679408, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/[email protected]/helper/schema/field_reader_config.go:29 +0x80
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Resource.InstanceState(0x140000d3b00, 0x1400004a990, 0x24, 0x1400035d0e0, 0x1400035d080, 0x0, 0x0, 0x1400035d0e0, 0x0)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfshim/sdk-v2/resource.go:97 +0x178
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.MakeTerraformState(0x140000e5c80, 0x1038df7d8, 0x140000d3b00, 0x10333b235, 0x13, 0x1400004a990, 0x24, 0x1400035cc90, 0x10026cc01, 0x1, ...)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/schema.go:847 +0x1a0
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Diff(0x140003605a0, 0x1038d4628, 0x1400035cc00, 0x1400037a4d0, 0x140003605a0, 0x103670be0, 0x14000679898)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/pkg/tfbridge/provider.go:730 +0x358
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Diff_Handler.func1(0x1038d4628, 0x1400035cc00, 0x103808c40, 0x1400037a4d0, 0x103816e60, 0x10412e808, 0x1038d4628, 0x1400035cc00)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider.pb.go:2576 +0x7c
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x1038d4628, 0x1400035c930, 0x103808c40, 0x1400037a4d0, 0x140003721a0, 0x14000554438, 0x0, 0x0, 0x1038b5028, 0x140007197b0)
    	/home/runner/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/go/otgrpc/server.go:57 +0x260
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Diff_Handler(0x10385c6a0, 0x140003605a0, 0x1038d4628, 0x1400035c930, 0x14000378600, 0x14000515580, 0x1038d4628, 0x1400035c930, 0x140001e7b00, 0x8a1)

@thomas11 thomas11 removed the needs-triage Needs attention from the triage team label Sep 23, 2024
@thomas11
Copy link
Contributor

Hi @gpduck, I believe this issue is already fixed in the latest v5.53.4 of pulumi-azuread. You missed by just one patch version.

Your example fails for me as described on 5.53.3 but succeeds on 5.53.4.

@gpduck
Copy link
Author

gpduck commented Sep 25, 2024

Yes it does appear to be fixed in 5.53.4. Thanks for looking in to it and getting the issue fixed!

@gpduck gpduck closed this as completed Sep 25, 2024
@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Sep 25, 2024
@mikhailshilkov mikhailshilkov removed the needs-triage Needs attention from the triage team label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer/feedback Feedback from customers kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

4 participants