Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EnterpriseTemplateScheduleStore removes provisioner state from builds #9823

@spikecurtis

Description

@spikecurtis
	// Update the workspace build.
	err = db.UpdateWorkspaceBuildByID(ctx, database.UpdateWorkspaceBuildByIDParams{
		ID:          build.ID,
		UpdatedAt:   now,
		Deadline:    autostop.Deadline,
		MaxDeadline: autostop.MaxDeadline,
	})
	if err != nil {
		return xerrors.Errorf("update workspace build %q: %w", build.ID, err)
	}

err = db.UpdateWorkspaceBuildByID(ctx, database.UpdateWorkspaceBuildByIDParams{

Symptoms

We are seeing multiple instances of workspace start builds with no ProvisionerState after the build completes. Then, when the user stops their workspace, terraform gets no state, takes no cleanup action, and completes the stop. Finally, when the user starts their workspace again, they get errors from the underlying infrastructure saying resources already exist.

In our dogfood, this looks like

Error: Unable to create container: Error response from daemon: Conflict. The container name "/coder-matifali-coder" is already in use by container "494d08c32846558f4475d58d32341184f46115b32e8215fc02a3808626296f29". You have to remove (or rename) that container to be able to reuse that name.
on main.tf line 329, in resource "docker_container" "workspace":
  329: resource "docker_container" "workspace" {

The previous stop will also anomalously report no resources to change or destroy, e.g.

Terraform 1.1.9
coder_agent.dev: Plan to create
coder_app.code-server: Plan to create
coder_app.gateway: Plan to create
coder_app.filebrowser: Plan to create
docker_volume.home_volume: Plan to create
docker_image.dogfood: Plan to create
Plan: 6 to add, 0 to change, 0 to destroy.

Metadata

Metadata

Assignees

Labels

s0Major regression, all-hands-on-deck to fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions