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

json unmarshal error in identitynow_source data source #12

Open
1 task done
thtonon opened this issue Mar 20, 2023 · 0 comments
Open
1 task done

json unmarshal error in identitynow_source data source #12

thtonon opened this issue Mar 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@thtonon
Copy link

thtonon commented Mar 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

When using identitynow_source to a source that already exists, terraform plan command returns the following error

 Error: json: cannot unmarshal bool into Go struct field ConnectorAttributes.connectorAttributes.deltaAggregationEnabled of type string
 
   with data.identitynow_source.authx,
   on data.tf line 1, in data "identitynow_source" "authx":
    1: data "identitynow_source" "authx" {
 

I believe that the reason is deltaAggregationEnabled is a string in the structure (https://github.com/OpenAxon/terraform-provider-identitynow/blob/master/type_source.go#L61) and the type that returns from IdN API is a bool

Terraform Version

1.3.9

IdentityNow Provider Version

0.3.2

Affected Resource(s)/Data Source(s)

identitynow_source

Terraform Configuration Files

terraform {
  required_providers {
    identitynow = {
      source  = "OpenAxon/identitynow"
      version = "=0.3.2"
    }
  }
}

provider "identitynow" {
    api_url       = "https://quintoandar-sb.api.identitynow.com"
    client_id     = var.api_client_id
    client_secret = var.api_client_secret
}
data "identitynow_source" "authx" {
    id = "2c91808580d899160180dcc9b68a71c2" # https://quintoandar-sb.api.identitynow.com/v3/sources
}

data "identitynow_source_entitlement" "brokers_supply_processor_internal_write" {
    source_id = data.identitynow_source.authx.id
    name      = "brokers-supply-processor.internal:write - APP:brokers-supply-processor-api"
}

data "identitynow_identity" "authx_owner" {
  alias    = "44434127861"
}

Debug Output/Panic Output

2023-03-20T16:36:45.227-0300 [INFO]  Terraform version: 1.3.9
2023-03-20T16:36:45.227-0300 [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2023-03-20T16:36:45.227-0300 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.0
2023-03-20T16:36:45.227-0300 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2023-03-20T16:36:45.227-0300 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2023-03-20T16:36:45.227-0300 [DEBUG] using github.com/zclconf/go-cty v1.12.1
2023-03-20T16:36:45.227-0300 [INFO]  Go runtime version: go1.19.6
2023-03-20T16:36:45.227-0300 [INFO]  CLI args: []string{"/usr/local/Cellar/tfenv/3.0.0/versions/1.3.9/terraform", "plan"}
2023-03-20T16:36:45.227-0300 [DEBUG] Attempting to open CLI config file: /Users/thiagotonon/.terraformrc
2023-03-20T16:36:45.227-0300 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2023-03-20T16:36:45.228-0300 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-03-20T16:36:45.228-0300 [DEBUG] ignoring non-existing provider search directory /Users/thiagotonon/.terraform.d/plugins
2023-03-20T16:36:45.228-0300 [DEBUG] ignoring non-existing provider search directory /Users/thiagotonon/Library/Application Support/io.terraform/plugins
2023-03-20T16:36:45.228-0300 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2023-03-20T16:36:45.228-0300 [INFO]  CLI command args: []string{"plan"}
2023-03-20T16:36:45.232-0300 [DEBUG] New state was assigned lineage "1e4ea501-19c2-03bd-862e-717e9daa7303"
2023-03-20T16:36:45.299-0300 [DEBUG] checking for provisioner in "."
2023-03-20T16:36:45.299-0300 [DEBUG] checking for provisioner in "/usr/local/Cellar/tfenv/3.0.0/versions/1.3.9"
2023-03-20T16:36:45.300-0300 [INFO]  backend/local: starting Plan operation
2023-03-20T16:36:45.304-0300 [DEBUG] created provider logger: level=debug
2023-03-20T16:36:45.306-0300 [INFO]  provider: configuring client automatic mTLS
2023-03-20T16:36:45.330-0300 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 args=[.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2]
2023-03-20T16:36:45.334-0300 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 pid=60336
2023-03-20T16:36:45.334-0300 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2
2023-03-20T16:36:46.419-0300 [INFO]  provider.terraform-provider-identitynow_v0.3.2: configuring server automatic mTLS: timestamp=2023-03-20T16:36:46.418-0300
2023-03-20T16:36:46.442-0300 [DEBUG] provider: using plugin: version=5
2023-03-20T16:36:46.443-0300 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: plugin address: address=/var/folders/75/x6h5dsrd3bx0xmmgcbdxfg2m0000gq/T/plugin672392543 network=unix timestamp=2023-03-20T16:36:46.442-0300
2023-03-20T16:36:46.496-0300 [DEBUG] No provider meta schema returned
2023-03-20T16:36:46.501-0300 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-03-20T16:36:46.502-0300 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 pid=60336
2023-03-20T16:36:46.502-0300 [DEBUG] provider: plugin exited
2023-03-20T16:36:46.503-0300 [DEBUG] Building and walking validate graph
2023-03-20T16:36:46.507-0300 [DEBUG] ProviderTransformer: "data.identitynow_identity.authx_owner" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.507-0300 [DEBUG] ProviderTransformer: "identitynow_access_profile.teste_tonon" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.507-0300 [DEBUG] ProviderTransformer: "data.identitynow_source.authx" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.507-0300 [DEBUG] ProviderTransformer: "data.identitynow_source_entitlement.brokers_supply_processor_internal_write" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.507-0300 [DEBUG] ReferenceTransformer: "var.api_client_secret" references: []
2023-03-20T16:36:46.508-0300 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/openaxon/identitynow\"]" references: [var.api_client_id var.api_client_secret]
2023-03-20T16:36:46.509-0300 [DEBUG] ReferenceTransformer: "identitynow_access_profile.teste_tonon" references: [data.identitynow_identity.authx_owner data.identitynow_source.authx data.identitynow_source_entitlement.brokers_supply_processor_internal_write]
2023-03-20T16:36:46.509-0300 [DEBUG] ReferenceTransformer: "data.identitynow_source.authx" references: []
2023-03-20T16:36:46.509-0300 [DEBUG] ReferenceTransformer: "data.identitynow_source_entitlement.brokers_supply_processor_internal_write" references: [data.identitynow_source.authx]
2023-03-20T16:36:46.509-0300 [DEBUG] ReferenceTransformer: "data.identitynow_identity.authx_owner" references: []
2023-03-20T16:36:46.509-0300 [DEBUG] ReferenceTransformer: "var.api_client_id" references: []
2023-03-20T16:36:46.511-0300 [DEBUG] Starting graph walk: walkValidate
2023-03-20T16:36:46.516-0300 [DEBUG] created provider logger: level=debug
2023-03-20T16:36:46.516-0300 [INFO]  provider: configuring client automatic mTLS
2023-03-20T16:36:46.523-0300 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 args=[.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2]
2023-03-20T16:36:46.528-0300 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 pid=60339
2023-03-20T16:36:46.528-0300 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2
2023-03-20T16:36:46.564-0300 [INFO]  provider.terraform-provider-identitynow_v0.3.2: configuring server automatic mTLS: timestamp=2023-03-20T16:36:46.563-0300
2023-03-20T16:36:46.592-0300 [DEBUG] provider: using plugin: version=5
2023-03-20T16:36:46.592-0300 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: plugin address: address=/var/folders/75/x6h5dsrd3bx0xmmgcbdxfg2m0000gq/T/plugin179624598 network=unix timestamp=2023-03-20T16:36:46.592-0300
2023-03-20T16:36:46.623-0300 [DEBUG] No provider meta schema returned
2023-03-20T16:36:46.635-0300 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-03-20T16:36:46.636-0300 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 pid=60339
2023-03-20T16:36:46.636-0300 [DEBUG] provider: plugin exited
2023-03-20T16:36:46.636-0300 [INFO]  backend/local: plan calling Plan
2023-03-20T16:36:46.637-0300 [DEBUG] Building and walking plan graph for NormalMode
2023-03-20T16:36:46.638-0300 [DEBUG] ProviderTransformer: "identitynow_access_profile.teste_tonon (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.638-0300 [DEBUG] ProviderTransformer: "data.identitynow_identity.authx_owner (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.639-0300 [DEBUG] ProviderTransformer: "data.identitynow_source.authx (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.639-0300 [DEBUG] ProviderTransformer: "data.identitynow_source_entitlement.brokers_supply_processor_internal_write (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/openaxon/identitynow"]
2023-03-20T16:36:46.639-0300 [DEBUG] ReferenceTransformer: "data.identitynow_identity.authx_owner (expand)" references: []
2023-03-20T16:36:46.639-0300 [DEBUG] ReferenceTransformer: "data.identitynow_source.authx (expand)" references: []
2023-03-20T16:36:46.639-0300 [DEBUG] ReferenceTransformer: "data.identitynow_source_entitlement.brokers_supply_processor_internal_write (expand)" references: [data.identitynow_source.authx (expand)]
2023-03-20T16:36:46.639-0300 [DEBUG] ReferenceTransformer: "var.api_client_id" references: []
2023-03-20T16:36:46.639-0300 [DEBUG] ReferenceTransformer: "var.api_client_secret" references: []
2023-03-20T16:36:46.639-0300 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/openaxon/identitynow\"]" references: [var.api_client_id var.api_client_secret]
2023-03-20T16:36:46.639-0300 [DEBUG] ReferenceTransformer: "identitynow_access_profile.teste_tonon (expand)" references: [data.identitynow_identity.authx_owner (expand) data.identitynow_source.authx (expand) data.identitynow_source_entitlement.brokers_supply_processor_internal_write (expand)]
2023-03-20T16:36:46.639-0300 [DEBUG] Starting graph walk: walkPlan
2023-03-20T16:36:46.640-0300 [DEBUG] created provider logger: level=debug
2023-03-20T16:36:46.640-0300 [INFO]  provider: configuring client automatic mTLS
2023-03-20T16:36:46.646-0300 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 args=[.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2]
2023-03-20T16:36:46.650-0300 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 pid=60340
2023-03-20T16:36:46.650-0300 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2
2023-03-20T16:36:46.671-0300 [INFO]  provider.terraform-provider-identitynow_v0.3.2: configuring server automatic mTLS: timestamp=2023-03-20T16:36:46.671-0300
2023-03-20T16:36:46.700-0300 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: plugin address: address=/var/folders/75/x6h5dsrd3bx0xmmgcbdxfg2m0000gq/T/plugin321664627 network=unix timestamp=2023-03-20T16:36:46.700-0300
2023-03-20T16:36:46.700-0300 [DEBUG] provider: using plugin: version=5
2023-03-20T16:36:46.734-0300 [DEBUG] No provider meta schema returned
2023-03-20T16:36:46.740-0300 [DEBUG] Resource instance state not found for node "data.identitynow_source.authx", instance data.identitynow_source.authx
2023-03-20T16:36:46.740-0300 [DEBUG] ReferenceTransformer: "data.identitynow_source.authx" references: []
2023-03-20T16:36:46.740-0300 [DEBUG] Resource instance state not found for node "data.identitynow_identity.authx_owner", instance data.identitynow_identity.authx_owner
2023-03-20T16:36:46.740-0300 [DEBUG] ReferenceTransformer: "data.identitynow_identity.authx_owner" references: []
data.identitynow_source.authx: Reading...
data.identitynow_identity.authx_owner: Reading...
2023-03-20T16:36:46.744-0300 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: 2023/03/20 16:36:46 [INFO] Getting Data source for Identity. Identity alias 44434127861
2023-03-20T16:36:46.744-0300 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: 2023/03/20 16:36:46 [INFO] Data source for Source ID 2c91808580d899160180dcc9b68a71c2
2023-03-20T16:36:48.444-0300 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: 2023/03/20 16:36:48 Decoder error:json: cannot unmarshal bool into Go struct field ConnectorAttributes.connectorAttributes.deltaAggregationEnabled of type string
2023-03-20T16:36:48.445-0300 [ERROR] vertex "data.identitynow_source.authx" error: json: cannot unmarshal bool into Go struct field ConnectorAttributes.connectorAttributes.deltaAggregationEnabled of type string
2023-03-20T16:36:48.445-0300 [ERROR] vertex "data.identitynow_source.authx (expand)" error: json: cannot unmarshal bool into Go struct field ConnectorAttributes.connectorAttributes.deltaAggregationEnabled of type string
data.identitynow_identity.authx_owner: Read complete after 2s [id=1841974]
2023-03-20T16:36:48.626-0300 [INFO]  backend/local: plan operation completed
╷
│ Error: json: cannot unmarshal bool into Go struct field ConnectorAttributes.connectorAttributes.deltaAggregationEnabled of type string
│ 
│   with data.identitynow_source.authx,
│   on data.tf line 1, in data "identitynow_source" "authx":
│    1: data "identitynow_source" "authx" {
│ 
╵
2023-03-20T16:36:48.630-0300 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-03-20T16:36:48.632-0300 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/openaxon/identitynow/0.3.2/darwin_amd64/terraform-provider-identitynow_v0.3.2 pid=60340
2023-03-20T16:36:48.632-0300 [DEBUG] provider: plugin exited

Expected Behaviour

No response

Actual Behaviour

No response

Steps to Reproduce

terraform plan

References

No response

@thtonon thtonon added the bug Something isn't working label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant