Skip to content

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

Closed

Description

@Amanibhavam

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

Activity

  1. mtojek commented on Aug 23, 2023

    @mtojek
    Member

    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.

  2. mtojek commented on Aug 23, 2023

    @mtojek
    Member

    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?

  3. Amanibhavam commented on Aug 23, 2023

    @Amanibhavam
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions