Skip to content

bug: workspace deadlock with invalid parameter & automatic updates set #19676

Description

@ericpaulsen

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

a customer reported this bug, & i asked Blink to write up the below report:

I've identified the bug location! This is a critical UX deadlock in the workspace parameters flow.
Root Cause:
The bug is in /site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersForm.tsx at lines 75-78:

const disabled =
    workspace.outdated &&
    workspace.template_require_active_version &&
    !canChangeVersions;

The Problem:

  1. When template_require_active_version is enabled and the workspace is outdated
  2. Users without canChangeVersions permission get the parameters form disabled
  3. But they need to fix invalid parameters to update the template version
  4. This creates an impossible catch-22 situation

Where it manifests:

  • The form shows: "The template for this workspace requires automatic updates. Update the workspace to edit parameters."
  • But users can't update because invalid parameters block the template version update
  • Same logic exists in the experimental version at line 75-78 of WorkspaceParametersPageViewExperimental.tsx
    Related files:
  • /site/src/modules/workspaces/actions.ts - handles the update actions
  • /site/src/utils/workspace.tsx - contains automatic update policy logic
  • /site/src/pages/WorkspacePage/WorkspaceNotifications/WorkspaceNotifications.tsx - shows update notifications

The fix would need to allow parameter editing even when outdated && template_require_active_version if there are validation errors preventing the update.

Relevant Log Output

Expected Behavior

users should be able to update their workspaces with a new parameter

Steps to Reproduce

  1. Set template_require_active_version with an outdated workspace
  2. Attempt to update the workspace
  3. Attempt to update parameters

Environment

  • Host OS:
  • Coder version:

Additional Context

No response

Activity

  1. added
    s1Bugs that break core workflows. Only humans may set this.
    needs-triageIssue that require triage
    on Sep 2, 2025
  2. added theissue type on Sep 2, 2025
  3. added
    parametersbugs & feature requests related to Dynamic Parameters
    and removed
    needs-triageIssue that require triage
    on Sep 2, 2025
  4. removed
    s1Bugs that break core workflows. Only humans may set this.
    parametersbugs & feature requests related to Dynamic Parameters
    on Feb 13, 2026
  5. blinkagent commented on Sep 23, 2026

    @blinkagent
    Contributor

    Retested on v2.36.5 — still reproduces

    Retested by adding a validation to one of the template's parameters and pushing a new version while the template has require_active_version enabled.

    Observed behaviour

    A user with only the Member role cannot edit any template parameter values for their workspace while Coder is forcing an update and restart. This happens on both entry paths:

    1. Clicking Update and restart first — the build fails parameter validation, the dialog offers "Go to workspace parameters", and the resulting form is fully read-only.
    2. Navigating to the parameters page first — same result.

    Notably, parameters that were not modified by the new template version are locked as well, not just the one with the new validation. The user has no way to supply a valid value, so the workspace cannot be started.

    Confirmed still present in main and release/2.36

    The guard is unchanged, it has just moved files since this issue was filed. It now lives in site/src/pages/WorkspaceSettingsPage/WorkspaceParametersPage/WorkspaceParametersPageView.tsx#L71-L74:

    const disabled =
    	workspace.outdated &&
    	workspace.template_require_active_version &&
    	!canChangeVersions;

    Two details explain the symptoms above:

    • canChangeVersions resolves to permissions.updateWorkspaceVersion, which is an authz check for action: "update" on the template (site/src/modules/workspaces/permissions.ts#L29-L35). A Member never satisfies this, only template admins and owners.
    • disabled is OR'd into the isDisabled of every field and into the submit button (lines 254-258 and 283-295), which is why untouched parameters are locked too.

    Why the guard misfires here

    The condition does not consider the ?templateVersionId= query param. Both entry paths above land on the page with workspace.outdated === true, and the "Update and restart" path arrives with templateVersionId already set to the active version by WorkspaceUpdateDialogs.tsx#L181.

    In other words, the user is already targeting the active version, so the original intent of the guard from #11117 (prevent pinning parameter values onto a stale version) does not apply. The backend would accept the build; only the UI blocks it.

    A fix likely needs to scope disabled so it does not apply when the form is already targeting the template's active version.

  6. self-assigned this
    on Oct 16, 2026
  7. added a commit that references this issue on Oct 16, 2026
    c4fc390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions