Skip to content

fix(enterprise/coderd/prebuilds): hard-limit preset if all create attempts failed - #18551

Closed
johnstcn wants to merge 1 commit into
mainfrom
cj/bail-multiple-failed-prebuilds
Closed

johnstcn wants to merge 1 commit into
mainfrom
cj/bail-multiple-failed-prebuilds

Conversation

@johnstcn

Copy link
Copy Markdown
Member

A template was improperly configured for prebuilds, resulting in multiple logs spam.

The error was an unrecoverable one:

2025-06-24 18:06:22.492 | 2025-06-24 18:06:22.492 [erro]  coderd.prebuilds: failed to create prebuild  template_id=3e08934c-5661-4762-bfea-8efc0385002f  template_name=coder-with-amazon-q  template_version_id=e87ba734-afa1-45a3-96c7-9447a98c59db  template_version_name=epic_ishizaka8  preset_id=73912bb9-8fee-4833-bd8e-b8664db82edc  preset_name="GoLand ZA" ...
     error= execute transaction:
                github.com/coder/coder/v2/coderd/database.(*sqlQuerier).runTx
                    /home/runner/work/coder/coder/coderd/database/db.go:213
              - provision workspace:
                github.com/coder/coder/v2/enterprise/coderd/prebuilds.(*StoreReconciler).provision
                    /home/runner/work/coder/coder/enterprise/coderd/prebuilds/reconcile.go:745
              - build tx:
                github.com/coder/coder/v2/coderd/wsbuilder.(*Builder).Build
                    /home/runner/work/coder/coder/coderd/wsbuilder/wsbuilder.go:285
              - execute transaction:
                github.com/coder/coder/v2/coderd/database.(*sqlQuerier).runTx
                   /home/runner/work/coder/coder/coderd/database/db.go:193
              - get parameters:
                github.com/coder/coder/v2/coderd/wsbuilder.(*Builder).getParameters
                    /home/runner/work/coder/coder/coderd/wsbuilder/wsbuilder.go:720
              - Parameter "AI Prompt" is required but not provided

As far as I can tell, if createPrebuiltWorkspace() fails all of the times it attempted to create a prebuild, it is unlikely to ever succeed for that preset.

Still TODO: figure out how to write a test for this.

@johnstcn johnstcn self-assigned this Jun 24, 2025
@johnstcn johnstcn closed this Jun 25, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 25, 2025
@johnstcn
johnstcn deleted the cj/bail-multiple-failed-prebuilds branch August 29, 2025 16:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant