Skip to content

bug: Parameters hidden by default have their values reset to default when unrelated parameter value modified on existing workspace #20257

@rowansmithau

Description

@rowansmithau

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Reported by customer on ticket 4452.

If a workspace is built from a template which contains a parameter like volume_size which is hidden by default and the user chooses a non default value for the volume_size value (note that mutable = true), then once the workspace is built they attempt to change an unrelated parameter such as instance_type_amd or user_shell the value for volume_size will be reset to the default 300GB value. This results in the workspace then entering a failed state as it cannot shrink the volume. If the volume_size parameter is NOT hidden by default, i.e. count is removed, then the issue does not occur.

Reported by customer running 2.25.3, confirmed still present on 2.26.1 and 2.27.0.

data "coder_parameter" "advanced_opts" {
  name         = "advanced_opts"
  display_name = "Show Advanced Options"
  order        = 100
  form_type    = "checkbox"
  type         = "bool"
  mutable      = true
  default      = false
}

data "coder_parameter" "volume_size" {
  count = data.coder_parameter.advanced_opts.value == "true" ? 1 : 0
  name = "volume_size"
  display_name = "Volume Size (GiB)"
  description  = "Size of the home volume in GiB"
  type         = "string"
  mutable      = true
  order        = 100
  form_type    = "dropdown"
  default      = "300"
  
  option {
    name  = "300 GiB"
    value = "300"
  }
  option {
    name  = "400 GiB"
    value = "400"
  }
  option {
    name  = "500 GiB"
    value = "500"
  }
}

data "coder_parameter" "instance_arch" {
  name = "instance_arch"
  display_name = "Arch"
  description  = "Which chip architecture?"
  type         = "string"
  mutable      = false
  order        = 1
  form_type    = "dropdown"
  default      = "amd64"
  
  option {
    name  = "64-bit (x86)"
    value = "amd64"
  }
  option {
    name  = "64-bit (Arm)"
    value = "arm64"
  }
}

data "coder_parameter" "instance_type_amd" {
  count = data.coder_parameter.instance_arch.value == "amd64" ? 1 : 0
  name = "instance_type_amd"
  display_name = "Instance Type"
  description  = "What instance type should your workspace use?"
  type         = "string"
  mutable      = true
  order        = 2
  form_type    = "dropdown"
  default      = "c6a.4xlarge"
  
  option {
    name  = "x86_64 - 8 vCPU, 16 GiB RAM"
    value = "c6a.2xlarge"
  }
  option {
    name  = "x86_64 - 16 vCPU, 32 GiB RAM"
    value = "c6a.4xlarge"
  }
  option {
    name  = "x86_64 - 32 vCPU, 64 GiB RAM"
    value = "c6a.8xlarge"
  }
  option {
    name  = "x86_64 - 32 vCPU, 72 GiB RAM"
    value = "c5.9xlarge"
  }
}
Image
Screen.Recording.2025-10-10.at.10.23.36.am.mov

Reproduced on MacOS with Chrome and Firefox. No network calls or console errors are observed.

Relevant Log Output

Expected Behavior

Any parameter which is hidden by default is not reset to the default value when an unrelated parameter value is changed.

Steps to Reproduce

  1. Build a workspace with the template contents shared above, ensuring volume_size is set to a non default value.
  2. Open the workspace settings screen
  3. Modify the value of an unrelated setting
  4. Observe the value for volume_size is reset to default value of 300GB

Environment

  • Host OS: Kubernetes
  • Coder version: 2.25.3, 2.26.1, 2.27.0

Additional Context

The issue occurs consistently, I have tested this on the latest version, The issue happens on multiple deployments

Metadata

Metadata

Assignees

Labels

parametersbugs & feature requests related to Dynamic Parameterss2Broken use cases or features (with a workaround). Only humans may set this.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions