Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode disconnects from DevContainer when running skaffold build #9324

Closed
CaffeineDaemon opened this issue Feb 23, 2024 · 5 comments
Closed

Comments

@CaffeineDaemon
Copy link

Expected behavior

skaffold build can be run from inside a VSCode DevContainer without issues.

Actual behavior

Running skaffold build disconnects VSCode from the container as soon as the docker image build starts:

image

The container keeps running and the build finishes.
This does not happen when doing the same with VSCode connected directly to WSL2 or running the commands in the container through docker exec from another shell.
Muting the shell output or piping it to a file does not prevent the disconnect.
Running docker build directly is not causing a disconnect.

Information

  • Skaffold version: 2.10.1
  • Operating system:
    • Host: Windows 10 Pro 22h2
    • WSL: 2.0.9.0
    • WSL-Distro: Ubuntu 22.04.3 LTS
    • Docker Host: Rancher Desktop 1.12.3
    • Container Engine: moby
    • DevContainer OS: Ubuntu 22.04.3 LTS
  • Installed via: devcontainer feature https://github.com/rio/features/blob/main/src/skaffold/install.sh
  • VSCode Version: 1.86.2
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta8
kind: Config
metadata:
  name: stp
profiles:
- name: local-dev
  activation:
  - kubeContext: rancher-desktop
  build:
    local:
      push: false
build:
  artifacts:
  - image: reg.goibykus.de/stp/identity/keycloak
    context: identity/images/keycloak
    docker:
      dockerfile: Dockerfile
  local:
    concurrency: 1
    tryImportMissing: false
    useDockerCLI: true
deploy:
  helm:
    releases:
    - name: stp-iam
      chartPath: identity/charts/iam
      namespace: stp-identity
      valuesFiles:
      - identity/.values/stp-iam.yaml
      setValueTemplates:
        identity.keycloak.image.registry: "{{.IMAGE_DOMAIN_reg_goibykus_de_stp_identity_keycloak}}"
        identity.keycloak.image.repository: "{{.IMAGE_REPO_NO_DOMAIN_reg_goibykus_de_stp_identity_keycloak}}"
        identity.keycloak.image.tag: "{{.IMAGE_TAG_reg_goibykus_de_stp_identity_keycloak}}"
        identity.keycloak.image.digest: "{{.IMAGE_DIGEST_reg_goibykus_de_stp_identity_keycloak}}"
      setValues:
         identity.keycloak.image.pullPolicy: IfNotPresent
    hooks:
      before:
      - host:
          command: [ "helmfile", "write-values", "-e", "dev", "--skip-deps", "-l", "name=stp-iam", "--output-file-template", ".values/{{.Release.Name}}.yaml" ]
  • devcontainer.json:
{
    "name": "mydevcontainer",
    "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04",
    "features": {
        "ghcr.io/devcontainers/features/git-lfs:1": {},
        "ghcr.io/rio/features/skaffold:2": {
            "version": "v2.10.1"
        },
        "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
        "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
            "minikube": "none"
        },
        "ghcr.io/mpriscella/features/kind:1": {
            "version": "v0.17.0"
        },
        "ghcr.io/devcontainers-contrib/features/istioctl:1": {},
        "ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
        "ghcr.io/nucleuscloud/devcontainer-features/helmfile:0": {
            "version": "v0.160.0"
        }
    },

    "customizations": {
        "vscode": {
            "extensions": [
		"EditorConfig.EditorConfig",
		"kennylong.kubernetes-yaml-formatter",
		"anweber.vscode-httpyac",
		"yokawasa.jwt-debugger",
                "ms-kubernetes-tools.vscode-kubernetes-tools",
                "mhutchie.git-graph",
                "eamodio.gitlens",
                "gitlab.gitlab-workflow"
	    ]
        }
    }
}

Steps to reproduce the behavior

  1. Add devcontainer.json from above to a repository
  2. Open repository with VSCode
  3. Let VSCode build and attach to the DevContainer
  4. Inside the VSCode terminal, run skaffold build --cache-artifacts=false to force a docker build

Log Output:

time="2024-02-23T20:27:33Z" level=debug msg="skaffold API not starting as it's not requested" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="Skaffold &{Version:v2.10.1 ConfigVersion:skaffold/v4beta9 GitVersion: GitCommit:df0264229733d654ae0f43466e760dae936b12e7 BuildDate:2024-02-07T11:37:56Z GoVersion:go1.21.6 Compiler:gc Platform:linux/amd64 User:}" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="Loaded Skaffold defaults from \"/home/vscode/.skaffold/config\"" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="config version out of date: upgrading to latest \"skaffold/v4beta9\"" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="parsed 1 configs from configuration file /workspaces/stp/skaffold.yaml" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="applying profile: local-dev" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field Build" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field hooks" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field before" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field after" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field artifacts" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field insecureRegistries" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field tagPolicy" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="no values found in profile for field TagPolicy, using original config values" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field platforms" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field BuildType" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field Test" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field Render" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field Generate" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field rawYaml" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field remoteManifests" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field kustomize" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field helm" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field kpt" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field hooks" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field before" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field after" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field transform" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field validate" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field output" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field Deploy" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field DeployType" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field docker" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field helm" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field kpt" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field kubectl" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field cloudrun" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field statusCheck" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field statusCheckDeadlineSeconds" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field tolerateFailuresUntilDeadline" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field kubeContext" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field logs" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field prefix" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field jsonParse" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field fields" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field -" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field PortForward" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field ResourceSelector" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field allow" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field deny" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field Verify" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="overlaying profile on config for field CustomActions" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="map entry found when executing locate for &{reg.goibykus.de/stp/identity/keycloak identity/images/keycloak <nil> {0xc000b36370 <nil> <nil> <nil> <nil> <nil> <nil>} [] {[] []} [] } of type *latest.Artifact and pointer: 824647802176" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="Using kubectl context: rancher-desktop" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="getting client config for kubeContext: `rancher-desktop`" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="Running command: [minikube version --output=json]" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="setting Docker user agent to skaffold-v2.10.1" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="DOCKER_HOST env is not set, using the host from docker context." subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="Running command: [docker context inspect --format {{.Endpoints.docker.Host}}]" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="Command output: [unix:///var/run/docker.sock\n]" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=info msg="no kpt renderer or deployer found, skipping hydrated-dir creation" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="Running command: [kubectl config view --minify -o jsonpath='{..namespace}']" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="Command output: ['']" subtask=-1 task=DevLoop
time="2024-02-23T20:27:33Z" level=debug msg="Running command: [helm version --client]" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=debug msg="Command output: [version.BuildInfo{Version:\"v3.14.2\", GitCommit:\"c309b6f0ff63856811846ce18f3bdc93d2b4d54b\", GitTreeState:\"clean\", GoVersion:\"go1.21.7\"}\n]" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=debug msg="Executing template &{envTemplate 0xc0006c4120 0xc0006c62d0  } with environment map[BROWSER:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/bin/helpers/browser.sh COLORTERM:truecolor DISPLAY::0 GIT_ASKPASS:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/extensions/git/dist/askpass.sh GIT_EDITOR:code --wait HISTFILE:/dc/shellhistory/.bash_history HISTFILE_OLD:/home/vscode/.bash_history HOME:/home/vscode HOSTNAME:10e43e76c93c KREW_ROOT:/var/opt/krew KUBECONFIG:/home/vscode/.kube/config:/home/vscode/.kube/config-stp:/home/vscode/.kube/config-dev KUBECONFIGDIR:${containerEnv:HOME:/home/vscode}/.kube LANG:en_US.UTF-8 LESSCLOSE:/usr/bin/lesspipe %s %s LESSOPEN:| /usr/bin/lesspipe %s LS_COLORS:rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: PATH:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/opt/krew/bin:/workspaces/stp/scripts:/home/vscode/.local/bin PROMPT_COMMAND:__vsc_prompt_cmd_original PROMPT_DIRTRIM:4 PWD:/workspaces/stp REMOTE_CONTAINERS:true REMOTE_CONTAINERS_DISPLAY_SOCK:/tmp/.X11-unix/X0 REMOTE_CONTAINERS_IPC:/tmp/vscode-remote-containers-ipc-0f0cb20b-1a4d-473f-a895-58a17895ef01.sock REMOTE_CONTAINERS_SOCKETS:[\"/tmp/vscode-ssh-auth-0f0cb20b-1a4d-473f-a895-58a17895ef01.sock\",\"/tmp/.X11-unix/X0\",\"/home/vscode/.gnupg/S.gpg-agent\"] SHELL:/bin/bash SHLVL:2 SSH_AUTH_SOCK:/tmp/vscode-ssh-auth-0f0cb20b-1a4d-473f-a895-58a17895ef01.sock TERM:xterm-256color TERM_PROGRAM:vscode TERM_PROGRAM_VERSION:1.86.2 USER:vscode VSCODE_GIT_ASKPASS_EXTRA_ARGS: VSCODE_GIT_ASKPASS_MAIN:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/extensions/git/dist/askpass-main.js VSCODE_GIT_ASKPASS_NODE:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/node VSCODE_GIT_IPC_HANDLE:/tmp/user/1000/vscode-git-9a5ad21b79.sock VSCODE_IPC_HOOK_CLI:/tmp/vscode-ipc-f6aac10c-bfa7-460f-9d3e-e25ceb198211.sock WAYLAND_DISPLAY:vscode-wayland-e03be4bb-4fd5-4355-b443-d2e73088518a.sock XDG_RUNTIME_DIR:/tmp/user/1000 _:/usr/local/bin/skaffold]" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=debug msg="CLI platforms provided: \"\"" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=debug msg="platform detection from active kubernetes cluster is not enabled" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=debug msg="platforms selected for artifact \"reg.goibykus.de/stp/identity/keycloak\": \"\"" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=debug msg="Using builder: local" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=info msg="build concurrency first set to 1 parsed from *runner.pipelineBuilderWithHooks[0]" subtask=-1 task=DevLoop
time="2024-02-23T20:27:34Z" level=info msg="final build concurrency value is 1" subtask=-1 task=DevLoop
Generating tags...
 - reg.goibykus.de/stp/identity/keycloak -> time="2024-02-23T20:27:34Z" level=debug msg="Running command: [git describe --tags --always]" subtask=-1 task=Build
time="2024-02-23T20:27:34Z" level=debug msg="Command output: [0af07cb\n]" subtask=-1 task=Build
time="2024-02-23T20:27:34Z" level=debug msg="Running command: [git status . --porcelain]" subtask=-1 task=Build
time="2024-02-23T20:27:34Z" level=debug msg="Command output: [?? identity/images/keycloak/\n]" subtask=-1 task=Build
reg.goibykus.de/stp/identity/keycloak:0af07cb-dirty
time="2024-02-23T20:27:34Z" level=info msg="Tags generated in 38.453008ms" subtask=-1 task=Build
Starting build...
Building [reg.goibykus.de/stp/identity/keycloak]...
time="2024-02-23T20:27:34Z" level=debug msg="Going to prune: [sha256:e1e92c9348b39bb4495d7f424033e432e1d80c2417a83e82cddca3221f383013 sha256:3a938821bd234592bca2289baf5b77a57996e1dcb2f07f72a59dcfb1613f8fb5 sha256:9ad49da0705fab5ad32aa65630b17f328b5b163a27bd2b9cfdabe1c0bfd71454]" subtask=reg.goibykus.de/stp/identity/keycloak task=Build
time="2024-02-23T20:27:35Z" level=debug msg="Running docker build: context: identity/images/keycloak, dockerfile: Dockerfile" subtask=reg.goibykus.de/stp/identity/keycloak task=Build
time="2024-02-23T20:27:35Z" level=debug msg="Skipping credential configuration because docker-credential-gcloud is not on PATH." subtask=-1 task=DevLoop
time="2024-02-23T20:27:35Z" level=debug msg="config version out of date: upgrading to latest \"skaffold/v4beta9\"" subtask=-1 task=DevLoop
time="2024-02-23T20:27:35Z" level=debug msg="config version out of date: upgrading to latest \"skaffold/v4beta9\"" subtask=-1 task=DevLoop
time="2024-02-23T20:27:36Z" level=debug msg="Found dependencies for dockerfile: []" subtask=-1 task=DevLoop
Sending build context to Docker daemon  2.048kB

Step 1/12 : FROM reg.goibykus.de/quay-io/keycloak/keycloak:23.0 as builder
 ---> 4e894b882ca1
Step 2/12 : ENV KC_CACHE_STACK=kubernetes
 ---> Using cache
 ---> 5469516ebbfa
Step 3/12 : ENV KC_DB=postgres
 ---> Using cache
 ---> daeb901014fc
Step 4/12 : ENV KC_HEALTH_ENABLED=true
 ---> Using cache
 ---> 0e67e420fad1
Step 5/12 : ENV KC_HTTP_RELATIVE_PATH=auth/
 ---> Using cache
 ---> 578605bff59a
Step 6/12 : ENV KC_METRICS_ENABLED=false
 ---> Using cache
 ---> 26eb50159b51
Step 7/12 : ENV KC_VAULT=file
 ---> Using cache
 ---> 66eb50367dc4
Step 8/12 : WORKDIR /opt/keycloak
 ---> Using cache
 ---> 72f86c027775
Step 9/12 : RUN /opt/keycloak/bin/kc.sh build
 ---> Using cache
 ---> d599805cdb5f
Step 10/12 : FROM reg.goibykus.de/quay-io/keycloak/keycloak:23.0
 ---> 4e894b882ca1
Step 11/12 : COPY --from=builder /opt/keycloak/ /opt/keycloak/
 ---> Using cache
 ---> 9a161c999ee6
Step 12/12 : ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
 ---> Using cache
 ---> 5d7bda08bc93
Successfully built 5d7bda08bc93
Successfully tagged reg.goibykus.de/stp/identity/keycloak:0af07cb-dirty
Build [reg.goibykus.de/stp/identity/keycloak] succeeded
time="2024-02-23T20:27:37Z" level=debug msg="Failed to prune: context canceled" subtask=reg.goibykus.de/stp/identity/keycloak task=Build
time="2024-02-23T20:27:37Z" level=info msg="Build completed in 2.455 seconds" subtask=-1 task=Build

Help improve Skaffold with our 2-minute anonymous survey: run 'skaffold survey'
To help improve the quality of this product, we collect anonymized usage data for details on what is tracked and how we use this data visit <https://skaffold.dev/docs/resources/telemetry/>. This data is handled in accordance with our privacy policy <https://policies.google.com/privacy>

You may choose to opt out of this collection by running the following command:
	skaffold config set --global collect-metrics false
time="2024-02-23T20:27:37Z" level=debug msg="exporting metrics disabled" subtask=-1 task=DevLoop
@CaffeineDaemon
Copy link
Author

Found some errors in the docker daemon logs that occur every time i reproduce the error. Here they are, in case they are related to the issue:

time="2024-02-24T23:23:01.861382783Z" level=error msg="Error running exec 7432af9cdabe44bbdd4d14a69cf633cc03c44cedeea8472bf07bf16bd41627d1 in container: exec attach failed: error attaching stderr stream: write unix /mnt/wsl/rancher-desktop/run/docker.sock->@: write: broken pipe"
time="2024-02-24T23:23:01.883534487Z" level=error msg="Error running exec 6770688cbf5aaf3955681041d8f817f0b8c0f01f91197bd030be634485552c8a in container: exec attach failed: error attaching stderr stream: write unix /mnt/wsl/rancher-desktop/run/docker.sock->@: write: broken pipe"
time="2024-02-24T23:23:01.889523931Z" level=error msg="Error running exec 931462cdd60577806980da8382ccfeb9695a62e9a3d146d41e4ebf451c4d4eef in container: exec attach failed: error attaching stderr stream: write unix /mnt/wsl/rancher-desktop/run/docker.sock->@: write: broken pipe"

@CaffeineDaemon
Copy link
Author

CaffeineDaemon commented Feb 26, 2024

Could narrow it down further, the issue only occurs when the environment variable REMOTE_CONTAINERS_IPC is set. If i unset it, it works.

Maybe templating has to do something with it? This log entry contains the environment variable:

time="2024-02-23T20:27:34Z" level=debug msg="Executing template &{envTemplate 0xc0006c4120 0xc0006c62d0  } with environment map[Bwith environment map[BROWSER:/vscode/vscode-server/bin/linux-ROWSER:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/bin/helpers/browser.sh COLORTERM:truecolor DISPLAY::0 GIT_ASKPASS:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/extensions/git/dist/askpass.sh GIT_EDITOR:code --wait HISTFILE:/dc/shellhistory/.bash_history HISTFILE_OLD:/home/vscode/.bash_history HOME:/home/vscode HOSTNAME:10e43e76c93c KREW_ROOT:/var/opt/krew KUBECONFIG:/home/vscode/.kube/config:/home/vscode/.kube/config-stp:/home/vscode/.kube/config-dev KUBECONFIGDIR:${containerEnv:HOME:/home/vscode}/.kube LANG:en_US.UTF-8 LESSCLOSE:/usr/bin/lesspipe %s %s LESSOPEN:| /usr/bin/lesspipe %s LS_COLORS:rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36: PATH:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/opt/krew/bin:/workspaces/stp/scripts:/home/vscode/.local/bin PROMPT_COMMAND:__vsc_prompt_cmd_original PROMPT_DIRTRIM:4 PWD:/workspaces/stp REMOTE_CONTAINERS:true REMOTE_CONTAINERS_DISPLAY_SOCK:/tmp/.X11-unix/X0 REMOTE_CONTAINERS_IPC:/tmp/vscode-remote-containers-ipc-0f0cb20b-1a4d-473f-a895-58a17895ef01.sock REMOTE_CONTAINERS_SOCKETS:[\"/tmp/vscode-ssh-auth-0f0cb20b-1a4d-473f-a895-58a17895ef01.sock\",\"/tmp/.X11-unix/X0\",\"/home/vscode/.gnupg/S.gpg-agent\"] SHELL:/bin/bash SHLVL:2 SSH_AUTH_SOCK:/tmp/vscode-ssh-auth-0f0cb20b-1a4d-473f-a895-58a17895ef01.sock TERM:xterm-256color TERM_PROGRAM:vscode TERM_PROGRAM_VERSION:1.86.2 USER:vscode VSCODE_GIT_ASKPASS_EXTRA_ARGS: VSCODE_GIT_ASKPASS_MAIN:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/extensions/git/dist/askpass-main.js VSCODE_GIT_ASKPASS_NODE:/vscode/vscode-server/bin/linux-x64/903b1e9d8990623e3d7da1df3d33db3e42d80eda/node VSCODE_GIT_IPC_HANDLE:/tmp/user/1000/vscode-git-9a5ad21b79.sock VSCODE_IPC_HOOK_CLI:/tmp/vscode-ipc-f6aac10c-bfa7-460f-9d3e-e25ceb198211.sock WAYLAND_DISPLAY:vscode-wayland-e03be4bb-4fd5-4355-b443-d2e73088518a.sock XDG_RUNTIME_DIR:/tmp/user/1000 _:/usr/local/bin/skaffold]" subtask=-1 task=DevLoop

@CaffeineDaemon
Copy link
Author

Found the source of the problem, and skaffold is not at fault. Skaffold at some point causes the docker credential store to list all stored credentials. VSCode places a proxy credential store inside the devcontainer that should forward any calls to the host system. This works for get or store subcommands, but list crashes the VSCode extension host running inside the container.

Can be reproduced by

  1. cat ~/.docker/config.json to get the name of credsStore executable, which changes when connecting to the container
  2. running /usr/local/bin/docker-credential-dev-containers-02e71925-c4e9-4c83-8388-d458a2253f71 list (but with the id from config.json)

I could confirm that the credential store on the host gets called correctly and return the correct json data, so the must be some bug in the VSCode devcontainer extension, so i will close this issue and open one in the VSCode repo.

For anyone finding this, you can disable forwarding the credential store to the container until this is fixed with the following setting:
microsoft/vscode-remote-release#8201 (comment)

@varunchopra
Copy link

@CaffeineDaemon Can you link to the issue you created?

@CaffeineDaemon
Copy link
Author

@CaffeineDaemon Can you link to the issue you created?

Sure. microsoft/vscode-remote-release#9603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants