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

Error for astra_access_list is not descriptive enough #361

Closed
Joro97 opened this issue Feb 20, 2024 · 0 comments · Fixed by #364
Closed

Error for astra_access_list is not descriptive enough #361

Joro97 opened this issue Feb 20, 2024 · 0 comments · Fixed by #364

Comments

@Joro97
Copy link

Joro97 commented Feb 20, 2024

Hi there,

Please provide the following details with your issue report.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Error not related to TF version.

Affected Resource(s)

Please list the resources as a list, for example:

  • "astra_access_list"

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

terraform {
  required_providers {
    astra = {
      source = "datastax/astra"
      version = ">= 2.2.8"
    }
  }
}

resource "astra_database" "astra" {
  name = "test-tf"
  keyspace = "test_error"
  cloud_provider = "aws"
  regions = ["us-east-1", "eu-central-1"]
  deletion_protection = false

  timeouts {
    create = "30m"
    update = "30m"
    delete = "30m"
  }
}

resource "astra_access_list" "test_access_list" {
  database_id = astra_database.astra.id
  enabled = true
  addresses {
    address = "$YOUR_IP"
    description = "personal-ip"
    enabled = true
  }
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
astra_access_list.test_access_list: Creating...

│ Error: json: cannot unmarshal string into Go value of type astra.Errors

│ with astra_access_list.test_access_list,
│ on main.tf line 24, in resource "astra_access_list" "test_access_list":
│ 24: resource "astra_access_list" "test_access_list" {

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?
The error message could be much more descriptive, explaining what is the actual problem with the provided IP address.

Actual Behavior

What actually happened?
The error returned does not contain any meaningful info: "Error: json: cannot unmarshal string into Go value of type astra.Errors"

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Add some auth for the Astra provider, for example by adding your token to the TF provider.
  2. terraform init
  3. terraform apply
  4. wait for db to get created, you will get the error on the second step that tried to create the Acess List.

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
None that Im aware of.

pgier added a commit that referenced this issue Feb 20, 2024
Propagate error to the user when there is a problem creating an access
list.
Fixes #361 

This is caused by the Astra client library swallowing parse errors, so
that the user doesn't see the actual error message. This should be fixed
in the client library at some point.
datastax/astra-client-go#32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant