-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Labels
Area: rbacregressionSomething that used to work but no longer worksSomething that used to work but no longer workss2Broken use cases or features (with a workaround). Only humans may set this.Broken use cases or features (with a workaround). Only humans may set this.
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Autostop builds of dormant workspaces fail if the workspace template includes agents without a
count = data.coder_workspace.me.start_count
field.
This occurs because workspace_dormant is a separate RBAC resource than regular workspaces, and the Provisioner Daemon subject doesn't have permission to create agents on dormant workspaces. It seems that we (incorrectly) assumed that since dormant workspaces can only be stopped, not started, that we would not need to create agents. However, there is nothing in the data model actually preventing the creation of agents on stop builds, so autostops of dormant workspaces can get into a failure loop.
Relevant Log Output
error: complete job: execute transaction: insert provisioner job: insert agent: unauthorized: rbac: forbiddenExpected Behavior
Autostop builds of dormant workspaces should succeed, even with coder_agent resources.
Steps to Reproduce
- Create a template with a
coder_agentand nocount. - Start the workspace with an autostop
- Mark the workspace dormant while still started
- Allow an automatic stop build
Environment
- Coder version: 2.28, likely introduced by 3e7ff9d
Additional Context
No response
nikr-canva
Metadata
Metadata
Assignees
Labels
Area: rbacregressionSomething that used to work but no longer worksSomething that used to work but no longer workss2Broken use cases or features (with a workaround). Only humans may set this.Broken use cases or features (with a workaround). Only humans may set this.