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

Failures when creating ibm_database because of bad values for allocations should be more clear #3294

Closed
bstoutenburgh opened this issue Nov 4, 2021 · 2 comments
Labels
service/Cloud Databases Issues related to Cloud Databases

Comments

@bstoutenburgh
Copy link

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 -v
Terraform v1.0.10
on linux_amd64
+ provider registry.terraform.io/hashicorp/helm v2.3.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.6.1
+ provider registry.terraform.io/ibm-cloud/ibm v1.35.0

Affected Resource(s)

  • ibm_database

Terraform Configuration Files

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

resource "ibm_database" "example" {
  name     = "example-redis"
  service  = "databases-for-redis"
  location = "us-east"
  plan     = "standard"

  resource_group_id = ibm_resource_group.default.id

  # if cpu > 0 it needs to be >= 6
  members_cpu_allocation_count = 2
  members_memory_allocation_mb = 2048
  members_disk_allocation_mb   = 2048
}

resource "ibm_resource_group" "default" {
  name = "Default"
}

Debug Output

https://gist.github.com/maristgeek/5b547c475401a0ec7e52c3a1ec32f391

Panic Output

Expected Behavior

Ideally it would be great if there were validation against values for creation rather than just updates, but an error message more helpful would help greatly.

Actual Behavior

ibm_database.example: Still creating... [1m0s elapsed]
╷
│ Error: [ERROR] Error creating database instance: Unexpected HTTP status code 502 (502 Bad Gateway) null
│ 
│ 
│   with ibm_database.example,
│   on redis.tf line 1, in resource "ibm_database" "example":
│    1: resource "ibm_database" "example" {

Steps to Reproduce

  1. terraform apply

Important Factoids

In the example members_cpu_allocation_count cannot be 2, it has to be 0 or 6 (or greater following stepping). I will not test more but I bet the same failures happen when memory/disk have bad values.

References

  • #0000
@hkantare
Copy link
Collaborator

hkantare commented Nov 5, 2021

There is known issue because of the SDK's not populating the complete error message .. The SDK is fixed and will be available in upcoming release

@kavya498 kavya498 added the service/Cloud Databases Issues related to Cloud Databases label Nov 8, 2021
kavya498 added a commit to kavya498/terraform-provider-ibm that referenced this issue Nov 8, 2021
@kavya498
Copy link
Collaborator

closing this issue, thanks..

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

No branches or pull requests

3 participants