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

TERRA-57 ⁃ Astra api errors are not properly deserialized by the the astra provider #96

Closed
AlexKaiserTK opened this issue Apr 21, 2022 · 3 comments

Comments

@AlexKaiserTK
Copy link

AlexKaiserTK commented Apr 21, 2022

Hi there,

Please provide the following details with your issue report.

Terraform Version

v1.1.3

Affected Resource(s)

  • all

Debug Output

The original astra api error message is not even printed in the TRACE log:

...
2022-04-21T12:53:39.601+0200 [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for astra_role.appdb_cgw_user
2022-04-21T12:53:39.601+0200 [ERROR] vertex "astra_role.my_role" error: json: cannot unmarshal string into Go value of type astra.Errors
///

Expected Behavior

Error message from astra api should have been printed in the terraform error log and to the terraform console

Actual Behavior

If an error is received from the datastax api, the following generic error is displayed:

astra_keyspace.my_keyspace: Creation complete after 9s [id=96e30bc5-c1b1-4c38-84eb-7d7d494e624b/keyspace/cgw_accounts]
╷
│ Error: json: cannot unmarshal string into Go value of type astra.Errors
│
│   with astra_role.my_role,
│   on astra-db.tf line 79, in resource "astra_role" "my_role":
│   79: resource "astra_role" "ny_role" {
│
╵
ERRO[0247] 1 error occurred:
	* exit status 1

It looks like the deserializion of error message received from the astra api is not properly implemented in the astra TF provider

Steps to Reproduce

to create an error, do e.g.:

  1. manually create a organization role through astra web console
  2. try to create the same role with TF

Important Factoids

References

┆Issue is synchronized with this Jira Task by Unito
┆friendlyId: TERRA-57
┆priority: Major

@sync-by-unito sync-by-unito bot changed the title Astra api errors are not properly deserialized by the the astra provider TERRA-57 ⁃ Astra api errors are not properly deserialized by the the astra provider Apr 21, 2022
@emerkle826
Copy link
Contributor

@AlexKaiserTK Could you please let me know which version of the provider you were using? Also, are you using an Admin with the provider? Currently, role operation through the provider require the token being used to have Admin permissions (see #101 for a bit more discussion)

@emerkle826
Copy link
Contributor

It is also possible that this was fixed in version 2.0.3 of the provider. Closing for now. If the issue is still present, please re-open.

@AlexKaiserTK
Copy link
Author

We are using 2.0.2 indeed, will check 2.0.3

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

No branches or pull requests

2 participants