loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.97k stars 335 forks source link

Unable to use any custom features or custom images. error getting credentials - err: exec: "docker-credential-devpod": executable file not found in $PATH #1301

Open ranchgainers opened 3 weeks ago

ranchgainers commented 3 weeks ago

What happened?

Running my workspace with

  "features": {
    "ghcr.io/devcontainers/features/go:1": {
      "version": "latest"
    }
  },

or any custom image fails with the same error.

[23:21:50] info Workspace projects already exists [23:21:50] info Creating devcontainer... [23:21:51] info devcontainer up: build image: get extended build info: fetch features: process feature ghcr.io/devcontainers/features/go:1: error getting credentials - err: exec: "docker-credential-devpod": executable file not found in $PATH, out: `` [23:21:51] error Try enabling Debug mode under Settings to see a more verbose output [23:21:51] fatal run agent command: Process exited with status 1

What did you expect to happen instead?

Custom features or custom images work.

How can we reproduce the bug? (as minimally and precisely as possible)

My devcontainer.json:

{
  "image": "mcr.microsoft.com/devcontainers/javascript-node",
  "features": {
    "ghcr.io/devcontainers/features/go:1": {
      "version": "latest"
    }
  },
  "mounts": [
    "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind",
    "source=${localEnv:HOME}/.docker,target=/home/node/.docker,type=bind,consistency=cached",
    "source=devpod-intellij,target=/home/node/.local/share/JetBrains,type=volume",
    "source=devpod-go,target=/home/node/go,type=volume",
    "source=devpod-pnpm-store,target=/home/node/.pnpm-store,type=volume",
    "source=devpod-pnpm-cache,target=/home/node/.cache/pnpm,type=volume",
    "source=devpod-npm-cache,target=/home/node/.npm,type=volume"
  ],
  "postCreateCommand": "sudo apt-get update && sudo apt-get install -y docker.io && sudo curl -L \"https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose && sudo usermod -aG docker node && npm install -g pnpm",
  "remoteUser": "node",
  "remoteEnv": {
    "DOCKER_HOST": "unix:///var/run/docker.sock",
    "GOPATH": "/home/node/go",
    "PNPM_HOME": "/home/node/.local/share/pnpm"
  }
}

Local Environment:

DevPod Provider:

Anything else we need to know?

bkneis commented 2 weeks ago

Thanks for reporting your issue @ranchgainers, can you confirm you have the context option SSH_INJECT_DOCKER_CREDENTIALS set to true? You can see this by running devpod context options

ranchgainers commented 2 weeks ago

@bkneis yes I have this output

                NAME              |          DESCRIPTION           | DEFAULT | VALUE  
  --------------------------------+--------------------------------+---------+--------
    AGENT_INJECT_TIMEOUT          | Specifies the timeout to       | 20      |        
                                  | inject the agent               |         |        
    AGENT_URL                     | Specifies the agent url to use |         |        
                                  | for DevPod                     |         |        
    DOTFILES_SCRIPT               | Specifies the script to run    |         |        
                                  | after cloning dotfiles repo to |         |        
                                  | install them                   |         |        
    DOTFILES_URL                  | Specifies the dotfiles repo    |         |        
                                  | url to use for DevPod          |         |        
    EXIT_AFTER_TIMEOUT            | Specifies if DevPod should     | true    |        
                                  | exit the process after the     |         |        
                                  | browser has been idle for a    |         |        
                                  | minute                         |         |        
    GIT_SSH_SIGNATURE_FORWARDING  | Specifies if DevPod should     | true    |        
                                  | automatically detect ssh       |         |        
                                  | signature git setting and      |         |        
                                  | inject ssh signature helper    |         |        
    GPG_AGENT_FORWARDING          | Specifies if DevPod should     | false   |        
                                  | do gpg-agent forwarding by     |         |        
                                  | default for ssh                |         |        
    REGISTRY_CACHE                | Specifies the registry to      |         |        
                                  | use as a build cache, e.g.     |         |        
                                  | gcr.io/my-project/my-dev-env   |         |        
    SSH_ADD_PRIVATE_KEYS          | Specifies if DevPod should     | true    |        
                                  | automatically add ssh-keys to  |         |        
                                  | the ssh-agent                  |         |        
    SSH_AGENT_FORWARDING          | Specifies if DevPod should do  | true    |        
                                  | agent forwarding by default    |         |        
                                  | into the workspace             |         |        
    SSH_CONFIG_PATH               | Specifies the path where the   |         |        
                                  | ssh config should be written   |         |        
                                  | to                             |         |        
    SSH_INJECT_DOCKER_CREDENTIALS | Specifies if DevPod should     | true    | true   
                                  | inject docker credentials into |         |        
                                  | the workspace                  |         |        
    SSH_INJECT_GIT_CREDENTIALS    | Specifies if DevPod should     | true    | true   
                                  | inject git credentials into    |         |        
                                  | the workspace                  |         |        
    TELEMETRY                     | Specifies if DevPod should     | true    |        
                                  | send telemetry information     |         |        
bkneis commented 2 weeks ago

@ranchgainers thanks for that. Can you also run with --debug and paste the logs?