-
Notifications
You must be signed in to change notification settings - Fork 23
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-81 ⁃ json: cannot unmarshal string into Go value of type astra.Errors #174
Comments
@alex4423 Thanks for filing an issue. However, I may need a little more info. The example terraform file you provided doesn't really do anything, and if I try to reproduce the issue with just that, I am unable to. Using the provided config, the plugin would simply be downloaded and terraform would initialize its state, and that works with just about any version of the provider. Do you have more details on what was in your config when you started seeing the error? There may be something in your tfstate file locally that needs to be updated, but I can't tell what that might be. |
sure, here my full Astra config (there are son GCP parts for private links as well but following the message error, I will avoid it)
NOTE: |
@alex4423 Thanks again. Few more questions.
|
I have an Admin User Token per Organization (all different...15 in total...I tried to create a new one but same issue) |
Can you try to generate a new Admin token for one of the orgs that is broken and use that to see if it fixes things with Terraform? |
I already tried and have the same issue I run a "plan" and grep astra I am thinking to delete states and reimport but that would be a huge work for me |
Can you capture the DEBUG logs for a command that fails? TF_LOG=DEBUG terraform apply should produce enough. I just need to see the calls it's making when it gets an error. Then I can figure out what to fix so the error isn't generic, and then we can figure out what's really wrong and how to fix it. |
sure Here logs:
|
This is very strange. So locally, I tried the same and I see this: 2022-10-26T15:46:14.097-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-26T15:46:14.098-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/datastax/astra/2.1.6/linux_amd64/terraform-provider-astra_v2.1.6 pid=2821592
2022-10-26T15:46:14.098-0500 [DEBUG] provider: plugin exited
2022-10-26T15:46:14.098-0500 [DEBUG] Building and walking validate graph then a little later in the logs: 2022-10-26T15:46:14.661-0500 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2022-10-26T15:46:14.663-0500 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/datastax/astra/2.1.6/linux_amd64/terraform-provider-astra_v2.1.6 pid=2821605
2022-10-26T15:46:14.664-0500 [DEBUG] provider: plugin exited
2022-10-26T15:46:14.664-0500 [DEBUG] building apply graph to check for errors
2022-10-26T15:46:14.664-0500 [DEBUG] ProviderTransformer: "astra_database.terra81 (destroy)" (*terraform.NodeDestroyResourceInstance) needs provider["registry.terraform.io/datastax/astra"]
2022-10-26T15:46:14.665-0500 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/datastax/astra\"]" references: []
2022-10-26T15:46:14.665-0500 [INFO] backend/local: plan operation completed Are there any 2022-10-26T15:46:14.157-0500 [DEBUG] provider.terraform-provider-astra_v2.1.6: 2022/10/26 15:46:14 [DEBUG] GET https://api.astra.datastax.com/v2/databases/c23921de-5f19-484e-886a-be09c5dfef29 The astra.Errors thing only comes into play when the provider tries to make a REST call to the Astra DevOps API. I'm not seeing any endpoints called, so I don't know which one is failing. I assume it's the |
that will be hard to say. I am managing almost everything with Terraform so I have a lot of modules running...the DEBUG output is huge. |
Can you run a plan with just |
still huge but I run with
|
I finally found how to push that to a log file, here output with more details with GET:
|
Good news |
@alex4423 Thanks for the updates. I can look into the |
I put back the module |
Thanks again for the update @alex4423 . That's the kind of information you should see if something goes wrong as you can at least tell what is wrong. But what I'm still not sure of is what caused the I'll take a look at the access_list operations and see if I can find one that is broken on errors. |
I understand. At one point, I will have to put back this module. If you didn't find the issue, hopefully, I'll be able to help |
I am glad you are unblocked. I'll keep digging, so I'll leave this ticket open for now.
From the error you posted about trying to add the access_list back, it seems the token in use does not have enough permissions: Are you using a token associated with a custom Role that you created, or one associated with the preset Administrator Roles? There is a bug with some Admin operations when using a custom role, even if the role has all admin permissions. (See this comment here and the discussion in that ticket). If this ends up being a DevOps API issue, I'll have to get back to the team that manages that and escalate this. |
no, not custom. the token is for Admin User |
@alex4423 Small update. I can only seem to produce the error you are getting: Error: error adding access list to database: (403) "user hPCrurTuPtEBJkjYdtZClepA is missing admin role for organization bf2ba0d8-c9a0-4332-ac51-d6292daee7f5" when I use a token that is associated with a role that doesn't have access list write permissions. I created a custom role that simply had these permissions:
and I am able to add access lists to my Astra DB. When I remove
I get the 403 error. Can you double check that Terraform is using a token with sufficient privileges? |
hello. |
Unless the permissions were changed for the role, they should still be good. Can you try creating a new token with the |
with with |
@alex4423 The The 409 you are getting when you use an Organization Administrator token is likely because the access list has already been created. In this case, you can either delete the access list entries from the UI and try again with terraform, or you can try to do a |
I still have 409 when I removed the Access list and run terraform afterwards |
This should be fixed by #298, at least the error should now be displayed appropriately back to the user. |
Hi there,
I have the following error message for 2 days (was working fine before)
json: cannot unmarshal string into Go value of type astra.Errors
Version:
Terraform v1.3.3
datastax/astra v2.1.6 (i tried older versions)
I removed every resources, just kept the provider and still have the issue:
It is a blocker to manage multiple DB's
┆Issue is synchronized with this Jira Task by Unito
┆friendlyId: TERRA-81
┆priority: Major
The text was updated successfully, but these errors were encountered: