cockroachdb / terraform-provider-cockroach

Terraform provider for CockroachDB Cloud
Apache License 2.0
56 stars 10 forks source link

Dedicated example throws an "unsupported version" error #65

Closed ianjevans closed 1 year ago

ianjevans commented 1 year ago

I got an "unsupported version" error when running terraform apply using the dedicated workflow example: https://github.com/cockroachdb/terraform-provider-cockroach/blob/main/examples/workflows/cockroach_dedicated_cluster/main.tf

cockroach_cluster.example: Creating...
╷
│ Error: Error creating cluster
│
│   with cockroach_cluster.example,
│   on main.tf line 89, in resource "cockroach_cluster" "example":
│   89: resource "cockroach_cluster" "example" {
│
│ Could not create cluster: invalid argument: unsupported version: v22.1.10

I used the following terraform.tfvars file:

cluster_name = "ian-dim-dog"
sql_user_name = "maxroach"
sql_user_password = "NotAGoodPassword"
cloud_provider = "GCP"
cloud_provider_regions = ["us-west2"]
cluster_node_count = 3
storage_gib = 15
machine_type = "n1-standard-2"
allow_list_name = "Ian's home network"
cidr_ip = "x.x.x.x"
cidr_mask = 32

The example main.tf specifies the default version as v22.1. Changing it to v22.2 allowed the plan to successfully apply.

marksoper commented 1 year ago

I'm working on repro'ing this ...

marksoper commented 1 year ago
image

I got the above error message when using this main.tfvars file with the examples/workflows/cockroach_dedicated_cluster/main.tf file. Terraform provider version 0.3.2, Terraform version 1.3.4

cluster_name = "soper-version-test"
cloud_provider = "AWS"
cloud_provider_regions = [
    "us-east-1",
    "us-east-2",
    "us-west-2"
]
machine_type = "m5.large"
erademacher commented 1 year ago

I can't repro Ian's issue. When I use "v22.1", it sends the correct API request with that version string. I am seeing the same behavior as Mark, though, which suggests that the cluster might be auto-updating before marking itself as ready, or something like that. Digging in now.

erademacher commented 1 year ago

Now it's working fine. Very strange.

ianjevans commented 1 year ago

Closing as a "can't reproduce."

erademacher commented 1 year ago

I actually ended up hitting the "inconsistent results" error while trying to run acceptance tests. Turns out there's a version selection feature flag that's disabled by default. I'd expect a helpful error pointing the user toward their account rep to enable the flag if there's a version in the request, so I'll put something in JIRA.