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 Cloud Shell data resource #3275

Closed
rjminsha opened this issue Oct 28, 2021 · 2 comments · Fixed by #3276
Closed

IBM Cloud Shell data resource #3275

rjminsha opened this issue Oct 28, 2021 · 2 comments · Fixed by #3276
Labels
service/IBM Cloud Shell Issues related to Cloud Shell

Comments

@rjminsha
Copy link

rjminsha commented Oct 28, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

Terraform v1.0.10
on darwin_amd64
+ provider registry.terraform.io/eiqops/restapi v1.15.1
+ provider registry.terraform.io/ibm-cloud/ibm v1.34.0

Affected Resource(s)

  • ibm_cloud_shell_account_settings

Terraform Configuration Files

terraform {
  required_version = ">= 1.0.7"
  required_providers {
    ibm = {
      source  = "IBM-Cloud/ibm"
      version = ">= 1.34.0"
      # version = "= 1.26.2"

    }
  }
}

provider "ibm" {
  ibmcloud_api_key = var.ibmcloud_api_key
  region           = "us-south"
}

// Data source to get account settings
data "ibm_iam_account_settings" "iam_account_settings" {
}

data "ibm_cloud_shell_account_settings" "cloud_shell_account_settings" {
  account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
}

output "account_id" {
  value = data.ibm_iam_account_settings.iam_account_settings.account_id
}

Debug Output

https://gist.github.com/rjminsha/66364a4d7b14821b04cb049a37b6ca60

Panic Output

Expected Behavior

expected to get the shell resource

Actual Behavior

2021-10-29T11:37:58.248+1300 [ERROR] plugin.(*GRPCProvider).ReadDataSource: error="rpc error: code = Unavailable desc = transport is closing"
╷
│ Error: Plugin did not respond
│ 
│   with data.ibm_cloud_shell_account_settings.cloud_shell_account_settings,
│   on main.tf line 23, in data "ibm_cloud_shell_account_settings" "cloud_shell_account_settings":
│   23: data "ibm_cloud_shell_account_settings" "cloud_shell_account_settings" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more
│ details.
╵

Stack trace from the terraform-provider-ibm_v1.34.0 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2862217]

goroutine 82 [running]:
github.com/IBM-Cloud/terraform-provider-ibm/ibm.dataSourceIBMCloudShellAccountSettingsRead(0x3bf8118, 0xc0013c08a0, 0xc000056e80, 0x36b3a00, 0xc000612800, 0xc0006a2dd0, 0xc000791948, 0x100dfd8)

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@kavya498
Copy link
Collaborator

@rjminsha ,
This looks like an error form SDK.. looks like the value of Id is nil in SDK..
Since ID and AccountId of this GET call, we have updated code to use accountID instead if ID

Meanwhile we ll raise an issue on SDK to check why Id is nil..

Thanks

@kavya498
Copy link
Collaborator

SDK issue IBM/platform-services-go-sdk#159

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

Successfully merging a pull request may close this issue.

2 participants