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

ibm_schematics_workspace: provider crash during terraform plan #4907

Closed
Aashiq-J opened this issue Nov 9, 2023 · 8 comments
Closed

ibm_schematics_workspace: provider crash during terraform plan #4907

Aashiq-J opened this issue Nov 9, 2023 · 8 comments
Assignees
Labels
bug service/Schematics Issues related to Schematics

Comments

@Aashiq-J
Copy link
Contributor

Aashiq-J commented Nov 9, 2023

Affected Resource(s)

  • ibm_schematics_workspace - data source (provider version 1.59.0)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "ibm" {
  ibmcloud_api_key = var.ibmcloud_api_key
  region           = var.region
}


##############################################################################
# Terraform Providers
##############################################################################

terraform {
  required_version = ">= 1.3, < 1.6"
  # Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works
  required_providers {
    ibm = {
      source  = "IBM-Cloud/ibm"
      version = "1.59.0"
    }
  }
}

##############################################################################

variable "prerequisite_workspace_id" {
  type    = string
  default = "us-south.workspace.projects-service.<sample>"
}

variable "ibmcloud_api_key" {
  description = "The API key that's associated with the account to provision resources to"
  type        = string
  sensitive   = true
}

variable "region" {
  description = "The region of the landing zone VPC."
  type        = string
  default     = "us-south"
}
data "ibm_schematics_workspace" "schematics_workspace" {
  workspace_id = var.prerequisite_workspace_id
  location     = "us-south"
}

output "sample" {
  value = data.ibm_schematics_workspace.schematics_workspace
}

Debug Output

$terraform plan
data.ibm_schematics_workspace.schematics_workspace: Reading...

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: [ERROR] Error reading values_metadata: Invalid address to set: []string{"template_values_metadata", "0", "default"}
│ 
│   with data.ibm_schematics_workspace.schematics_workspace,
│   on main.tf line 40, in data "ibm_schematics_workspace" "schematics_workspace":
│   40: data "ibm_schematics_workspace" "schematics_workspace" {
│ 
╵

Panic Output

Expected Behavior

This issue only seen in provider version 1.59.0, while using the version 1.58.1 terraform plan works fine.

Actual Behavior

Steps to Reproduce

  1. terraform init
  2. terraform plan

Important Factoids

References

  • #0000
@github-actions github-actions bot added bug service/Schematics Issues related to Schematics labels Nov 9, 2023
@evtimokn
Copy link

Seems to be related to the contents of this commit, but I guess the devs can say exactly ibm/service/schematics/data_source_ibm_schematics_workspace.go

@ocofaigh
Copy link
Contributor

Looks like this was reported as fixed in https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v1.59.1
@Aashiq-J Do you want to verify the fix and close if we are good?

@Aashiq-J
Copy link
Contributor Author

Hi @VaishnaviGopal ,

When using the provider version 1.59.1, I'm getting the following error. I guess it is able to fetch the details but its some formatting error.

data.ibm_schematics_workspace.schematics_workspace: Reading...

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: GetWorkspaceWithContext failed error unmarshalling schematicsv1.WorkspaceResponse: error unmarshalling property 'catalog_ref' as schematicsv1.CatalogRef: error unmarshalling property 'service_extensions' as []schematicsv1.ServiceExtensions: error unmarshalling property 'value': json: cannot unmarshal object into Go value of type string
│ {
│     "StatusCode": 200,
│     "Headers": {
│         "Cache-Control": [
│             "no-store, no-cache='Set-Cookie, Set-Cookie2', must-revalidate, proxy-revalidate, post-check=0, pre-check=0"
│         ],
│         "Cf-Cache-Status": [
│             "DYNAMIC"
│         ],
│         "Cf-Ray": [
│             "82966911da32858d-BOM"
│         ],
│         "Content-Security-Policy": [
│             "default-src 'self'; frame-ancestors 'self';"
│         ],
│         "Content-Type": [
│             "application/json; charset=utf-8"
│         ],
│         "Date": [
│             "Tue, 21 Nov 2023 05:07:43 GMT"
│         ],
│         "Expires": [
│             "0"
│         ],
│         "Ibm-Schematics-Requestid": [
│             "26745579-d23b-4c64-bb58-c6721e846e0c"
│         ],
│         "Pragma": [
│             "no-cache"
│         ],
│         "Server": [
│             "cloudflare"
│         ],
│         "Strict-Transport-Security": [
│             "max-age=15552000; includeSubDomains"
│         ],
│         "X-Content-Type-Options": [
│             "nosniff"
│         ],
│         "X-Tf11-Deprecation": [
│             "false"
│         ],
│         "X-Xss-Protection": [
│             "1; mode=block"
│         ]
│     },
│     "Result": {...},
│     "RawResult": null
│ }
│ 
│ 
│   with data.ibm_schematics_workspace.schematics_workspace,
│   on main.tf line 40, in data "ibm_schematics_workspace" "schematics_workspace":
│   40: data "ibm_schematics_workspace" "schematics_workspace" {
│ 
╵
a

@VaishnaviGopal
Copy link
Collaborator

@Aashiq-J We will look into this and update

@VaishnaviGopal
Copy link
Collaborator

Hi @Aashiq-J
Can you test now with 1.60.0 version and check

@surajsbharadwaj
Copy link

#4990

@VaishnaviGopal
Copy link
Collaborator

Fix has been added in 1.61.0 version of provider.

@surajsbharadwaj
Copy link

Thank you @VaishnaviGopal . I can confirm it is now working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug service/Schematics Issues related to Schematics
Projects
None yet
Development

No branches or pull requests

5 participants