Skip to content

Error creating and deleting workspace via WebUI: request job was invalidated: compute parameters: inject single "docker_image": unsupported source scheme: "none" #3691

Closed
@mafredri

Description

@mafredri

The title may be a bit misleading since I ran into multiple related issues simultaneously.

Issues

  1. Creating a workspace via WebUI produces the error with a template containing a certain variable declaration (see below)
  2. The error results in an impossible-to-start/delete workspace
  3. The template works fine when doing coder create via CLI
  4. However, deleting the errored workspace via CLI does not work (hangs forever)
  5. WebUI logs contain nothing
  6. WebUI sometimes detects the failure, other times remains "pending" forever

Template

The relevant part from the template:

variable "docker_image" {
  description = "What Docker image would you like to use for your workspace?"
}

Full template: docker-latest.zip

What happened?

A workspace was created via WebUI:

image

The following error was logged by the server:

2022-08-25 09:35:27.065 [DEBUG]	(coderd.provisionerd-kind_nightingale3)	<./coderd/provisionerdaemons.go:167>	(*provisionerdServer).AcquireJob	locked job from database	{"id": "ac26feba-2e05-4998-ad78-b64278f5ef99"}
2022-08-25 09:35:27.071 [WARN]	<./provisionerd/provisionerd.go:212>	(*Server).acquireJob	acquire job ...
  "error": request job was invalidated: compute parameters: inject single "docker_image": unsupported source scheme: "none"
           	storj.io/drpc/drpcwire.UnmarshalError:26
           	storj.io/drpc/drpcstream.(*Stream).HandlePacket:198
           	storj.io/drpc/drpcmanager.(*Manager).manageReader:216

(Note: I'd expect to see this error somewhere in the build log of the workspace.)

These are relevant requests done by the WebUI during workspace creation:

GET http://coder.home.my.domain:4000/api/v2/templateversions/8ea121d6-7cda-4112-9a82-7b0f8236db71/schema
[
    {
        "id": "59006ad4-fab8-401c-9b48-88a4875cd36c",
        "created_at": "2022-08-25T09:13:14.8106Z",
        "job_id": "a4642f18-e837-418f-8593-65e37909279e",
        "name": "docker_image",
        "description": "Which Docker image would you like to use for your workspace?",
        "default_source_scheme": "none",
        "default_source_value": "",
        "allow_override_source": true,
        "default_destination_scheme": "provisioner_variable",
        "allow_override_destination": false,
        "default_refresh": "",
        "redisplay_value": true,
        "validation_error": "",
        "validation_condition": "",
        "validation_type_system": "none",
        "validation_value_type": ""
    }
]

POST http://coder.home.my.domain:4000/api/v2/organizations/48be9b09-4468-4bde-9afc-fe0fb3264f74/workspaces
{
    "name": "test5",
    "template_id": "32d2d75d-192d-4634-b91b-8249278b05b0",
    "parameter_values": [
        {
            "name": "docker_image",
            "destination_scheme": "provisioner_variable",
            "source_scheme": "none",
            "source_value": "debian:sid-slim"
        }
    ]
}

GET http://coder.home.my.domain:4000/api/v2/workspaces/0ae3f435-c9bb-4af8-a101-17159c02e777/builds
[
  {
    "id": "f88c061e-e182-4c22-9e3b-75be5e01bfa7",
    "created_at": "2022-08-25T09:35:26.948455Z",
    "updated_at": "2022-08-25T09:35:26.948455Z",
    "workspace_id": "0ae3f435-c9bb-4af8-a101-17159c02e777",
    "workspace_name": "test5",
    "workspace_owner_id": "d7b44033-22ce-4ba2-8928-9528cf5edb97",
    "workspace_owner_name": "mafredri",
    "template_version_id": "8ea121d6-7cda-4112-9a82-7b0f8236db71",
    "build_number": 1,
    "name": "nervous_shaw5",
    "transition": "start",
    "initiator_id": "d7b44033-22ce-4ba2-8928-9528cf5edb97",
    "initiator_name": "mafredri",
    "job": {
      "id": "ac26feba-2e05-4998-ad78-b64278f5ef99",
      "created_at": "2022-08-25T09:35:26.948455Z",
      "status": "pending",
      "storage_source": "d79d12173b16beb6a5d56a22c7e0376ae7d9577af8d3c21db0d569dce04d9c3f"
    },
    "deadline": "0001-01-01T00:00:00Z",
    "reason": "initiator"
  }
]

If we reload the page / request the build again, we can see that the error message is there (but not visible anywhere).

GET http://coder.home.my.domain:4000/api/v2/workspaces/0ae3f435-c9bb-4af8-a101-17159c02e777/builds
[
  {
    "id": "f88c061e-e182-4c22-9e3b-75be5e01bfa7",
    "created_at": "2022-08-25T09:35:26.948455Z",
    "updated_at": "2022-08-25T09:35:26.948455Z",
    "workspace_id": "0ae3f435-c9bb-4af8-a101-17159c02e777",
    "workspace_name": "test5",
    "workspace_owner_id": "d7b44033-22ce-4ba2-8928-9528cf5edb97",
    "workspace_owner_name": "mafredri",
    "template_version_id": "8ea121d6-7cda-4112-9a82-7b0f8236db71",
    "build_number": 1,
    "name": "nervous_shaw5",
    "transition": "start",
    "initiator_id": "d7b44033-22ce-4ba2-8928-9528cf5edb97",
    "initiator_name": "mafredri",
    "job": {
      "id": "ac26feba-2e05-4998-ad78-b64278f5ef99",
      "created_at": "2022-08-25T09:35:26.948455Z",
      "started_at": "2022-08-25T09:35:27.063839Z",
      "completed_at": "2022-08-25T09:35:27.070169Z",
      "error": "compute parameters: inject single \"docker_image\": unsupported source scheme: \"none\"",
      "status": "failed",
      "worker_id": "0e4cd73a-0f06-4841-81c4-5e31d9d525e4",
      "storage_source": "d79d12173b16beb6a5d56a22c7e0376ae7d9577af8d3c21db0d569dce04d9c3f"
    },
    "deadline": "0001-01-01T00:00:00Z",
    "reason": "initiator"
  }
]

Trying to delete the workspace will also fail:

image

Trying to delete via CLI might hang or fail:

❯ coder delete --yes test5
✘ Queued [156ms]
✘ Running [8ms]
compute parameters: inject single "docker_image": unsupported source scheme: "none"
Run 'coder delete --help' for usage.

❯ coder delete --yes test5
✘ Queued [429ms]
⧗  Running
^C

(Reason may be the same that the WebUI doesn't always update status.)

What was expected

  • Workspace would not have been created due to early failure
  • Or, workspace creation succeeded with error, but can be deleted
  • WebUI and CLI create workspaces the same way
  • Protect parameters against unsupported schemes
  • If the variable was bad, it should've been caught during template creation

Metadata

Metadata

Assignees

Labels

apiArea: HTTP APIsiteArea: frontend dashboard

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions