Skip to content

bug: Coder treats all devcontainers as if they were managed by Coder #19345

@bilby91

Description

@bilby91

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Hello,

We recently started having issues with our workspaces after upgrading to 2.24.X. For some reason, Coder thinks that all the devcontainers in the machine are managed by Coder, even if they were not provisioned at all by it. This leads to the workspace reporting unhealthy and preventing the clients from connecting with it.

Is this a known issue in 2.24 ? Is there any workaround ?

Thanks!

Relevant Log Output

[ 3245.506317] cloud-init[1822]: 2025-08-13 20:34:54.749 [debu]  containers: containers updated successfully  container_count=22  warning_count=0  devcontainer_count=8
[ 3250.451297] cloud-init[1822]: 2025-08-13 20:34:59.694 [debu]  got stats callback
[ 3250.451834] cloud-init[1822]: 2025-08-13 20:34:59.694 [debu]  computing stats report
[ 3250.451918] cloud-init[1822]: 2025-08-13 20:34:59.694 [debu]  starting peer latency measurement for stats
[ 3250.451996] cloud-init[1822]: 2025-08-13 20:34:59.695 [debu]  collecting agent metrics for stats
[ 3255.504031] cloud-init[1822]: 2025-08-13 20:35:04.747 [debu]  containers.devcontainer-cli: @devcontainer/cli  workspace_folder=/crunchloop/dap  config_path=/crunchloop/dap/.devcontainer/devcontainer.json  stderr=true  line="/bin/bash: line 1: devcontainer: command not found"
[ 3255.504609] cloud-init[1822]: 2025-08-13 20:35:04.747 [erro]  containers: inject subagent into container failed  devcontainer_id=a02d410b-333f-4fb1-87c4-0595352739b8  devcontainer_name=dap  workspace_folder=/crunchloop/dap  config_path=/crunchloop/dap/.devcontainer/devcontainer.json  container_id=6792002da7ca38c90b08681d355461f6ff9cc4f6d3dabaca65e4580f8192c0c5  container_name=dap_devcontainer-app-1 ...
[ 3255.504678] cloud-init[1822]:     error= read devcontainer config:
[ 3255.504742] cloud-init[1822]:                github.com/coder/coder/v2/agent/agentcontainers.(*API).maybeInjectSubAgentIntoContainerLocked
[ 3255.504884] cloud-init[1822]:                    /home/runner/work/coder/coder/agent/agentcontainers/api.go:1197
[ 3255.504942] cloud-init[1822]:              - devcontainer read-configuration failed:
[ 3255.505020] cloud-init[1822]:                github.com/coder/coder/v2/agent/agentcontainers.(*devcontainerCLI).ReadConfig
[ 3255.505087] cloud-init[1822]:                    /home/runner/work/coder/coder/agent/agentcontainers/devcontainercli.go:350
[ 3255.505150] cloud-init[1822]:              - exit status 127

Expected Behavior

Coder should ignore devcontainer that were not provisioned by Coder.

Steps to Reproduce

  1. Create a new workspace
  2. Connect to workspace using VS Code
  3. Clone repo and open repo in devcontainer
  4. Wait until the workspace is unhealthy.

Environment

  • Host OS: Ubuntu 22.04
  • Coder version: 2.24.3

Additional Context

The issue is new (previously worked fine), I have tested this on the latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue that require triage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions