Skip to content

Error with 2.1.1 when planning workspace: coder_parameter names must be unique #9260

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

Closed
Amanibhavam opened this issue Aug 23, 2023 · 3 comments · Fixed by #9263
Closed

Error with 2.1.1 when planning workspace: coder_parameter names must be unique #9260

Amanibhavam opened this issue Aug 23, 2023 · 3 comments · Fixed by #9263

Comments

@Amanibhavam
Copy link

Coder 2.1.1 complains about non-unique coder_parameter names when Terraforming a workspace, preventing the workspace from stopping or starting.

Downgrading to 2.1.0 removes this problem.

This is the Coder template: https://github.com/defn/dev/tree/main/m/coder/dfd

Error:

"recv workspace provision: plan terraform: coder_parameter names must be unique but "cpu", "docker_image", "memory", "nix_volume_size" and "provider" appear multiple times"
image
@cdr-bot cdr-bot bot added the bug label Aug 23, 2023
@mtojek
Copy link
Member

mtojek commented Aug 23, 2023

I don't think that we introduced any major changes between 2.1.0 and 2.1.1, see changelog, unless it is #9201.

Could you please prepare a small sample template without extra providers/resources to present the problem? Right now if it complains about lack of credentials for AWS and Fly.io.

@mtojek
Copy link
Member

mtojek commented Aug 23, 2023

Ok, I looked around and managed to reproduce it. Unfortunately, it is the outcome of #9201.

Terraform provider fails the use case with a module. For instance:

main.tf:

module "workspace" {
  source = "./mod/terraform-coder-defn-dev"
}

./mod/terraform-coder-defn-dev/coder.tf
...

./mod/terraform-coder-defn-dev/params.tf

data "coder_parameter" "cpu" {
  name         = "cpu"
  display_name = "CPU"
  description  = "The number of CPUs to allocate to the workspace"
  type         = "number"
  default      = "4"
  icon         = "https://raw.githubusercontent.com/matifali/logos/main/cpu-3.svg"
  mutable      = true
  validation {
    min = 4
    max = 16
  }
}

data "coder_parameter" "memory" {
  name         = "memory"
  display_name = "Memory"
  description  = "The amount of memory to allocate to the workspace in GB"
  type         = "number"
  default      = "8"
  icon         = "/icon/memory.svg"
  mutable      = true
  validation {
    min = 8
    max = 64
  }
}

@ammario should we revert #9201 temporarily?

@Amanibhavam
Copy link
Author

@mtojek Thanks for the fix! Next time I'll make smaller repros without creds.

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.

2 participants