microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 289 forks source link

.local/bin is not in PATH when executing a post-create script and PATH is set in remoteEnv #6841

Closed vadim-su closed 1 year ago

vadim-su commented 2 years ago
[39 ms] Remote-Containers 0.238.2 in VS Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630).
[39 ms] Start: Resolving Remote
[45 ms] Setting up container for folder or workspace: /home/mrd/Projects/personal/raycast
[53 ms] Start: Check Docker is running
[53 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[77 ms] Server API version: 1.41
[78 ms] Start: Run: docker volume ls -q
[100 ms] Start: Run: docker inspect --type container 4710b31819449eb941735c49403b57a280e65f58584837c6634f38234f1a1fa8
[117 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=/home/mrd/Projects/personal/raycast --filter label=vsch.quality=stable
[134 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/mrd/Projects/personal/raycast
[154 ms] Start: Run: /opt/visual-studio-code/code /home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/mrd/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/mrd/Projects/personal/raycast --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/mrd/Projects/personal/raycast --log-level debug --log-format json --config /home/mrd/Projects/personal/raycast/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[274 ms] remote-containers 0.238.2.
[274 ms] Start: Run: docker buildx version
[322 ms] Start: Resolving Remote
[324 ms] Start: Run: git rev-parse --show-cdup
[327 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/mrd/Projects/personal/raycast
[343 ms] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /home/mrd/Projects/personal/raycast/.devcontainer/Dockerfile -t vsc-raycast-8dbb65be23c408bcf91eb231efac50fe --build-arg VARIANT=3.10-bullseye --build-arg NODE_VERSION=none /home/mrd/Projects/personal/raycast
[+] Building 0.0s (7/7) FINISHED                                                
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/p  0.0s
 => [1/2] FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bulls  0.0s
 => CACHED [2/2] RUN if [ "none" != "none" ]; then su vscode -c "umask 00  0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:68f5df6cd6c1e67dd5ac7cf47b5fe83e1e8b365f5d8ac  0.0s
 => => naming to docker.io/library/vsc-raycast-8dbb65be23c408bcf91eb231ef  0.0s
 => exporting cache                                                        0.0s
 => => preparing build cache for export                                    0.0s
[515 ms] Start: Run: docker inspect --type image vsc-raycast-8dbb65be23c408bcf91eb231efac50fe
[532 ms] Start: Run: docker build -f /tmp/vsch/updateUID.Dockerfile-0.238.2 -t vsc-raycast-8dbb65be23c408bcf91eb231efac50fe-uid --build-arg BASE_IMAGE=vsc-raycast-8dbb65be23c408bcf91eb231efac50fe --build-arg REMOTE_USER=vscode --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=root /tmp/vsch
Sending build context to Docker daemon  10.24kB
Step 1/10 : ARG BASE_IMAGE
Step 2/10 : FROM $BASE_IMAGE
 ---> 68f5df6cd6c1
Step 3/10 : USER root
 ---> Using cache
 ---> 334e3a3a2eba
Step 4/10 : ARG REMOTE_USER
 ---> Using cache
 ---> d643d7aa2563
Step 5/10 : ARG NEW_UID
 ---> Using cache
 ---> ca1cca5128d3
Step 6/10 : ARG NEW_GID
 ---> Using cache
 ---> ce4f07d4779f
Step 7/10 : SHELL ["/bin/sh", "-c"]
 ---> Using cache
 ---> cb9a1f9bb0a0
Step 8/10 : RUN eval $(sed -n "s/${REMOTE_USER}:[^:]*:\([^:]*\):\([^:]*\):[^:]*:\([^:]*\).*/OLD_UID=\1;OLD_GID=\2;HOME_FOLDER=\3/p" /etc/passwd);       eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_UID}:.*/EXISTING_USER=\1/p" /etc/passwd);   eval $(sed -n "s/\([^:]*\):[^:]*:${NEW_GID}:.*/EXISTING_GROUP=\1/p" /etc/group);        if [ -z "$OLD_UID" ]; then              echo "Remote user not found in /etc/passwd ($REMOTE_USER).";       elif [ "$OLD_UID" = "$NEW_UID" -a "$OLD_GID" = "$NEW_GID" ]; then               echo "UIDs and GIDs are the same ($NEW_UID:$NEW_GID).";    elif [ "$OLD_UID" != "$NEW_UID" -a -n "$EXISTING_USER" ]; then          echo "User with UID exists ($EXISTING_USER=$NEW_UID).";         elif [ "$OLD_GID" != "$NEW_GID" -a -n "$EXISTING_GROUP" ]; then            echo "Group with GID exists ($EXISTING_GROUP=$NEW_GID).";       else            echo "Updating UID:GID from $OLD_UID:$OLD_GID to $NEW_UID:$NEW_GID.";     sed -i -e "s/\(${REMOTE_USER}:[^:]*:\)[^:]*:[^:]*/\1${NEW_UID}:${NEW_GID}/" /etc/passwd;                 if [ "$OLD_GID" != "$NEW_GID" ]; then                   sed -i -e "s/\([^:]*:[^:]*:\)${OLD_GID}:/\1${NEW_GID}:/" /etc/group;               fi;             chown -R $NEW_UID:$NEW_GID $HOME_FOLDER;        fi;
 ---> Using cache
 ---> e59566f504a2
Step 9/10 : ARG IMAGE_USER
 ---> Using cache
 ---> 607fe9fcddf9
Step 10/10 : USER $IMAGE_USER
 ---> Using cache
 ---> 20109c6d38f9
Successfully built 20109c6d38f9
Successfully tagged vsc-raycast-8dbb65be23c408bcf91eb231efac50fe-uid:latest
[574 ms] Start: Run: docker -v
[589 ms] Start: Run: docker events --format {{json .}} --filter event=start
[592 ms] Start: Starting container
[592 ms] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=/home/mrd/Projects/personal/raycast,target=/workspaces/raycast --mount type=volume,src=vscode,dst=/vscode -l devcontainer.local_folder=/home/mrd/Projects/personal/raycast --entrypoint /bin/sh vsc-raycast-8dbb65be23c408bcf91eb231efac50fe-uid -c echo Container started
Container started
[753 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/mrd/Projects/personal/raycast
[769 ms] Start: Run: docker inspect --type container f96a226b6c3b
[787 ms] Start: Inspecting container
[787 ms] Start: Run: docker inspect --type container f96a226b6c3be5b1853fb0544603b43c39f58ae86e4c105e4da93a0c4b84e68c
[805 ms] Start: Run in container: /bin/sh
[809 ms] Start: Run in container: uname -m
[866 ms] x86_64
[866 ms] 
[866 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[867 ms] PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[867 ms] 
[867 ms] Start: Run in container: cat /etc/passwd
[868 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcEnvironmentMarker'
[868 ms] 
[868 ms] 
[868 ms] Exit code 1
[868 ms] Start: Run in container: /bin/sh
[871 ms] Start: Run in container: test ! -f '/var/devcontainer/.patchEtcEnvironmentMarker' && set -o noclobber && mkdir -p '/var/devcontainer' && { > '/var/devcontainer/.patchEtcEnvironmentMarker' ; } 2> /dev/null
[929 ms] 
[929 ms] 
[929 ms] Start: Run in container: cat >> /etc/environment <<'etcEnvrionmentEOF'
[930 ms] 
[930 ms] 
[930 ms] Start: Run in container: test -f '/var/devcontainer/.patchEtcProfileMarker'
[930 ms] 
[930 ms] 
[930 ms] Exit code 1
[930 ms] Start: Run in container: test ! -f '/var/devcontainer/.patchEtcProfileMarker' && set -o noclobber && mkdir -p '/var/devcontainer' && { > '/var/devcontainer/.patchEtcProfileMarker' ; } 2> /dev/null
[931 ms] 
[931 ms] 
[931 ms] Start: Run in container: sed -i -E 's/((^|\s)PATH=)([^\$]*)$/\1${PATH:-\3}/g' /etc/profile || true
[932 ms] 
[932 ms] 
[936 ms] Start: Run: docker inspect --type container f96a226b6c3be5b1853fb0544603b43c39f58ae86e4c105e4da93a0c4b84e68c
[956 ms] Start: Run: /opt/visual-studio-code/code /home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/mrd/Projects/personal/raycast --log-level debug --log-format json --config /home/mrd/Projects/personal/raycast/.devcontainer/devcontainer.json --mount-workspace-git-root true
[1080 ms] remote-containers 0.238.2.
[1080 ms] Start: Run: git rev-parse --show-cdup
[1092 ms] Start: Inspecting container
[1092 ms] Start: Run: docker inspect --type container f96a226b6c3be5b1853fb0544603b43c39f58ae86e4c105e4da93a0c4b84e68c
[1113 ms] Start: Run in container: /bin/sh
[1118 ms] Start: Run in container: uname -m
[1175 ms] x86_64
[1175 ms] 
[1175 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[1176 ms] PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[1176 ms] 
[1177 ms] Start: Run in container: cat /etc/passwd
[1178 ms] Start: Updating configuration state
[1183 ms] Start: Setup shutdown monitor
[1183 ms] Forking shutdown monitor: /home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/shutdown/shutdownMonitorProcess /run/user/1000/vscode-remote-containers-4f41eae00597fff9109ea2378318447a9bff4307.sock singleContainer Debug /home/mrd/.config/Code/logs/20220618T090417/exthost1/ms-vscode-remote.remote-containers 1655532909506
[1188 ms] Start: Run in container: test -d /home/vscode/.vscode-server
[1188 ms] 
[1189 ms] 
[1189 ms] Exit code 1
[1189 ms] Start: Run in container: test -d /home/vscode/.vscode-remote
[1189 ms] 
[1189 ms] 
[1189 ms] Exit code 1
[1190 ms] Start: Run in container: test ! -f '/home/vscode/.vscode-server/data/Machine/.writeMachineSettingsMarker' && set -o noclobber && mkdir -p '/home/vscode/.vscode-server/data/Machine' && { > '/home/vscode/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[1191 ms] 
[1191 ms] 
[1191 ms] Start: Run: /opt/visual-studio-code/code /home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/mrd/Projects/personal/raycast --log-level debug --log-format json --config /home/mrd/Projects/personal/raycast/.devcontainer/devcontainer.json --include-features-configuration --mount-workspace-git-root true
[1318 ms] remote-containers 0.238.2.
[1318 ms] Start: Run: git rev-parse --show-cdup
[1327 ms] Start: Run in container: mkdir -p '/home/vscode/.vscode-server/data/Machine' && cat >'/home/vscode/.vscode-server/data/Machine/settings.json' <<'settingsJSON'
[1329 ms] 
[1329 ms] 
[1329 ms] Start: Run in container: test -d /home/vscode/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630
[1330 ms] 
[1330 ms] 
[1330 ms] Exit code 1
[1330 ms] Start: Run in container: test -d /vscode/vscode-server/bin/linux-x64/30d9c6cd9483b2cc586687151bcbcd635f373630
[1330 ms] 
[1330 ms] 
[1330 ms] Start: Run in container: mkdir -p '/home/vscode/.vscode-server/bin' && ln -snf '/vscode/vscode-server/bin/linux-x64/30d9c6cd9483b2cc586687151bcbcd635f373630' '/home/vscode/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630'
[1331 ms] 
[1332 ms] 
[1332 ms] Start: Run in container: /bin/sh
[1336 ms] Start: Launching Remote-Containers helper.
[1336 ms] Start: Run in container: touch '/vscode/vscode-server/bin/linux-x64/30d9c6cd9483b2cc586687151bcbcd635f373630'
[1336 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-48f3e143b5576514dafee47f064a48a1484c934e.sock) forwarded to local host (/run/user/1000/ssh-agent.socket).
[1337 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[1341 ms] /run/user/1000/gnupg/S.gpg-agent.extra
[1341 ms] 
[1341 ms] Start: Run in container: gpgconf --list-dir agent-socket
[1342 ms] /home/vscode/.gnupg/S.gpg-agent
[1342 ms] 
[1342 ms] Start: Run in container: gpgconf --list-dir homedir
[1343 ms] /home/vscode/.gnupg
[1343 ms] 
[1343 ms] Start: Run in container: ls '/home/vscode/.gnupg/private-keys-v1.d' 2>/dev/null
[1344 ms] 
[1344 ms] 
[1344 ms] Exit code 2
[1345 ms] Start: Run in container: mkdir -p -m 700 '/home/vscode/.gnupg'
[1345 ms] Start: Run in container: /bin/sh
[1349 ms] userEnvProbe: loginInteractiveShell (default)
[1350 ms] Start: Run in container: echo ~
[1350 ms] userEnvProbe shell: /bin/bash
[1350 ms] 
[1350 ms] 
[1351 ms] Start: Run: gpgconf --list-dir homedir
[1355 ms] Start: Run in container: # Test for /home/vscode/.ssh/known_hosts and ssh
[1355 ms] /home/mrd/.gnupg
[1355 ms] 
[1356 ms] 
[1356 ms] 
[1356 ms] Start: Run in container: gpgconf --list-dir homedir
[1357 ms] /home/vscode/.gnupg
[1357 ms] 
[1357 ms] Start: Run in container: # Copy /home/mrd/.ssh/known_hosts to /home/vscode/.ssh/known_hosts
[1359 ms] 
[1359 ms] 
[1359 ms] Start: Run in container: # Test for /home/vscode/.gnupg/pubring.kbx and gpg
[1360 ms] 
[1360 ms] 
[1360 ms] Start: Run in container: # Copy /home/mrd/.gnupg/pubring.kbx to /home/vscode/.gnupg/pubring.kbx
[1361 ms] 
[1361 ms] 
[1361 ms] Start: Run in container: # Test for /home/vscode/.gnupg/trustdb.gpg and gpg
[1362 ms] 
[1362 ms] 
[1362 ms] Start: Run in container: # Copy /home/mrd/.gnupg/trustdb.gpg to /home/vscode/.gnupg/trustdb.gpg
[1363 ms] 
[1363 ms] 
[1364 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[1392 ms] 
[1393 ms] 
[1393 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --system --replace-all credential.helper '!f() { /home/vscode/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node /tmp/vscode-remote-containers-48f3e143b5576514dafee47f064a48a1484c934e.js $*; }; f' || true
[1394 ms] 
[1394 ms] 
[1395 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd ; readlink /proc/$pid/ns/mnt ; cat /proc/$pid/stat | tr "
[1419 ms] Start: Run in container: cat '/home/vscode/.vscode-server/data/Machine/.connection-token-30d9c6cd9483b2cc586687151bcbcd635f373630' 2>/dev/null || (umask 377 && echo 'cc4c8e06-05d2-49c2-8a03-a39e1580235b' >'/home/vscode/.vscode-server/data/Machine/.connection-token-30d9c6cd9483b2cc586687151bcbcd635f373630-4d83985a-f09f-4ae0-99e3-e3ccaf08200b' && mv -n '/home/vscode/.vscode-server/data/Machine/.connection-token-30d9c6cd9483b2cc586687151bcbcd635f373630-4d83985a-f09f-4ae0-99e3-e3ccaf08200b' '/home/vscode/.vscode-server/data/Machine/.connection-token-30d9c6cd9483b2cc586687151bcbcd635f373630' && rm -f '/home/vscode/.vscode-server/data/Machine/.connection-token-30d9c6cd9483b2cc586687151bcbcd635f373630-4d83985a-f09f-4ae0-99e3-e3ccaf08200b' && cat '/home/vscode/.vscode-server/data/Machine/.connection-token-30d9c6cd9483b2cc586687151bcbcd635f373630')
[1422 ms] cc4c8e06-05d2-49c2-8a03-a39e1580235b
[1422 ms] 
[1422 ms] Start: Starting VS Code Server
[1423 ms] Start: Preparing Extensions
[1423 ms] Start: Run in container: test ! -f '/home/vscode/.vscode-server/data/Machine/.installExtensionsMarker' && set -o noclobber && mkdir -p '/home/vscode/.vscode-server/data/Machine' && { > '/home/vscode/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[1424 ms] 
[1424 ms] 
[1425 ms] Extensions cache, install extensions: ms-python.python, ms-python.vscode-pylance, njpwerner.autodocstring, KevinRose.vsc-python-indent
[1425 ms] Start: Run in container: test -d /home/vscode/.vscode-server/extensionsCache && ls /home/vscode/.vscode-server/extensionsCache || true
[1426 ms] 
[1426 ms] 
[1426 ms] Start: Run in container: test -d /vscode/vscode-server/extensionsCache && ls /vscode/vscode-server/extensionsCache || true
[1427 ms] alexcvzz.vscode-sqlite-0.14.1
christian-kohler.npm-intellisense-1.4.1
dbaeumer.vscode-eslint-2.2.2
eamodio.gitlens-12.0.6
eamodio.gitlens-12.0.7
eg2.vscode-npm-script-0.3.25
github.copilot-1.22.5957
github.copilot-1.23.5969
github.copilot-1.24.6022
github.copilot-1.25.6056
github.copilot-1.27.6094
github.copilot-1.28.6134
github.copilot-1.29.6152
github.copilot-1.30.6165
github.vscode-codeql-1.6.6
hbenl.vscode-test-explorer-2.21.1
kevinrose.vsc-python-indent-1.16.0
kuanhulio.discord-0.0.6
ms-azuretools.vscode-docker-1.22.0
ms-python.python-2022.6.2
ms-python.python-2022.6.3
ms-python.python-2022.8.0
ms-python.vscode-pylance-2022.5.2
ms-python.vscode-pylance-2022.5.3
ms-python.vscode-pylance-2022.6.0
ms-python.vscode-pylance-2022.6.10
ms-python.vscode-pylance-2022.6.20
ms-toolsai.jupyter-2022.4.1021342353
ms-toolsai.jupyter-2022.5.1001601848
ms-toolsai.jupyter-keymap-1.0.0
ms-toolsai.jupyter-renderers-1.0.6
ms-toolsai.jupyter-renderers-1.0.7
ms-toolsai.jupyter-renderers-1.0.8
ms-vscode.test-adapter-converter-0.1.6
mtxr.sqltools-0.23.0
mtxr.sqltools-driver-pg-0.2.0
njpwerner.autodocstring-0.6.1
redhat.vscode-yaml-1.7.0
tamasfe.even-better-toml-0.14.2
yzhang.markdown-all-in-one-3.4.3
[1427 ms] 
[1427 ms] Extensions cache, link in container: kevinrose.vsc-python-indent-1.16.0, ms-python.python-2022.6.2, ms-python.python-2022.6.3, ms-python.python-2022.8.0, ms-python.vscode-pylance-2022.5.2, ms-python.vscode-pylance-2022.5.3, ms-python.vscode-pylance-2022.6.0, ms-python.vscode-pylance-2022.6.10, ms-python.vscode-pylance-2022.6.20, njpwerner.autodocstring-0.6.1
[1428 ms] Start: Run in container: mkdir -p '/home/vscode/.vscode-server/extensionsCache' && ln -s '/vscode/vscode-server/extensionsCache'/* '/home/vscode/.vscode-server/extensionsCache' || true
[1430 ms] /home/vscode
[1430 ms] 
[1430 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-48f3e143b5576514dafee47f064a48a1484c934e.js' >/tmp/vscode-remote-containers-48f3e143b5576514dafee47f064a48a1484c934e.js
[1430 ms] 
[1430 ms] 
[1430 ms] Start: Run in container: cd /vscode/vscode-server/extensionsCache && touch 'kevinrose.vsc-python-indent-1.16.0' 'ms-python.python-2022.6.2' 'ms-python.python-2022.6.3' 'ms-python.python-2022.8.0' 'ms-python.vscode-pylance-2022.5.2' 'ms-python.vscode-pylance-2022.5.3' 'ms-python.vscode-pylance-2022.6.0' 'ms-python.vscode-pylance-2022.6.10' 'ms-python.vscode-pylance-2022.6.20' 'njpwerner.autodocstring-0.6.1'
[1431 ms] Start: Run in container: /home/vscode/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/bin/code-server --log debug --force-disable-user-env --server-data-dir /home/vscode/.vscode-server --use-host-proxy --telemetry-level all --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /home/vscode/.vscode-server/data/Machine/.connection-token-30d9c6cd9483b2cc586687151bcbcd635f373630 --extensions-download-dir /home/vscode/.vscode-server/extensionsCache --install-extension ms-python.python --install-extension ms-python.vscode-pylance --install-extension njpwerner.autodocstring --install-extension KevinRose.vsc-python-indent --start-server --disable-websocket-compression
[1435 ms] 
[1435 ms] 
[1435 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-48f3e143b5576514dafee47f064a48a1484c934e.js' >/tmp/vscode-remote-containers-server-48f3e143b5576514dafee47f064a48a1484c934e.js_1655532910941
[1435 ms] 
[1435 ms] 
[1438 ms] 
[1438 ms] 
[1514 ms] userEnvProbe PATHs:
Probe:     '/usr/local/share/nvm/current/bin:/usr/local/bin:/usr/local/share/nvm/current/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/py-utils/bin:/home/vscode/.local/bin:/usr/local/py-utils/bin'
Container: '/usr/local/share/nvm/current/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/py-utils/bin'
[1520 ms] *
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
[1525 ms] Server bound to 127.0.0.1:43059 (IPv4)
Extension host agent listening on 43059

[1525 ms] Start: Run in container: echo 43059 >'/home/vscode/.vscode-server/data/Machine/.devport-30d9c6cd9483b2cc586687151bcbcd635f373630'
[1527 ms] 
[1527 ms] 
[1527 ms] Port forwarding for container port 43059 starts listening on local port.
[1527 ms] Port forwarding local port 43059 to container port 43059
[1528 ms] Start: Run: /opt/visual-studio-code/code /home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js run-user-commands --user-data-folder /home/mrd/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/mrd/Projects/personal/raycast --container-id f96a226b6c3be5b1853fb0544603b43c39f58ae86e4c105e4da93a0c4b84e68c --log-level debug --log-format json --config /home/mrd/Projects/personal/raycast/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --skip-non-blocking-commands false --prebuild false --stop-for-personalization true --remote-env SSH_AUTH_SOCK=/tmp/vscode-ssh-auth-48f3e143b5576514dafee47f064a48a1484c934e.sock --remote-env REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-48f3e143b5576514dafee47f064a48a1484c934e.sock --remote-env REMOTE_CONTAINERS=true --mount-workspace-git-root true
[1544 ms] Port forwarding connection from 55984 > 43059 > 43059 in the container.
[1544 ms] Start: Run in container: /home/vscode/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node -e 
[1660 ms] Installing extensions...
[1662 ms] [06:15:11] Extension host agent started.
[1679 ms] Port forwarding 55984 > 43059 > 43059 stderr: Connection established
[1703 ms] remote-containers 0.238.2.
[1703 ms] Start: Run: docker buildx version
[1756 ms] Port forwarding connection from 56008 > 43059 > 43059 in the container.
[1756 ms] Start: Run in container: /home/vscode/.vscode-server/bin/30d9c6cd9483b2cc586687151bcbcd635f373630/node -e 
[1783 ms] [06:15:11] ComputeTargetPlatform: linux-x64
[1784 ms] Start: Run: git rev-parse --show-cdup
[1789 ms] Start: Run: docker inspect --type container f96a226b6c3be5b1853fb0544603b43c39f58ae86e4c105e4da93a0c4b84e68c
[1835 ms] Start: Inspecting container
[1835 ms] Start: Run: docker inspect --type container f96a226b6c3be5b1853fb0544603b43c39f58ae86e4c105e4da93a0c4b84e68c
[1847 ms] Port forwarding 56008 > 43059 > 43059 stderr: Connection established
[1856 ms] Start: Run in container: /bin/sh
[1860 ms] Start: Run in container: uname -m
[1907 ms] x86_64
[1907 ms] 
[1907 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[1908 ms] PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[1908 ms] 
[1908 ms] Start: Run in container: cat /etc/passwd
[1910 ms] userEnvProbe: loginInteractiveShell (default)
[1910 ms] Start: Run in container: mkdir -p '/home/vscode/.devcontainer' && CONTENT="$(cat '/home/vscode/.devcontainer/.onCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2022-06-18T06:15:10.112585994Z}" != '2022-06-18T06:15:10.112585994Z' ] && echo '2022-06-18T06:15:10.112585994Z' > '/home/vscode/.devcontainer/.onCreateCommandMarker'
[1911 ms] userEnvProbe shell: /bin/bash
[1911 ms] Start: Run in container: /bin/bash -lic echo -n 380b80ceb3f9d97dd1c58c42f1c46651; cat /proc/self/environ; echo -n 380b80ceb3f9d97dd1c58c42f1c46651
[1914 ms] 
[1914 ms] 
[1914 ms] Start: Run in container: mkdir -p '/home/vscode/.devcontainer' && CONTENT="$(cat '/home/vscode/.devcontainer/.updateContentCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2022-06-18T06:15:10.112585994Z}" != '2022-06-18T06:15:10.112585994Z' ] && echo '2022-06-18T06:15:10.112585994Z' > '/home/vscode/.devcontainer/.updateContentCommandMarker'
[1916 ms] 
[1916 ms] 
[1916 ms] Start: Run in container: mkdir -p '/home/vscode/.devcontainer' && CONTENT="$(cat '/home/vscode/.devcontainer/.postCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2022-06-18T06:15:10.112585994Z}" != '2022-06-18T06:15:10.112585994Z' ] && echo '2022-06-18T06:15:10.112585994Z' > '/home/vscode/.devcontainer/.postCreateCommandMarker'
[1917 ms] [06:15:11] [127.0.0.1][b506ec3a][ManagementConnection] New connection established.
[1919 ms] 
[1919 ms] 
[1919 ms] [06:15:11] [127.0.0.1][00f28dc1][ExtensionHostConnection] New connection established.
Running the postCreateCommand from devcontainer.json...

[1924 ms] [06:15:11] [127.0.0.1][00f28dc1][ExtensionHostConnection] <298> Launched Extension Host Process.
[1993 ms] userEnvProbe PATHs:
Probe:     '/usr/local/share/nvm/current/bin:/usr/local/bin:/usr/local/share/nvm/current/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/py-utils/bin:/home/vscode/.local/bin:/usr/local/py-utils/bin'
Container: '/usr/local/share/nvm/current/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/py-utils/bin'
[1994 ms] Start: Run in container: /bin/sh -c .devcontainer/post-craete.sh
/usr/bin/env: ‘bash’: No such file or directory
[2072 ms] postCreateCommand failed with exit code 127. Skipping any further user-provided commands.
[2073 ms] Error: Command failed: /bin/sh -c .devcontainer/post-craete.sh
[2073 ms]     at bc (/home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:100:137)
[2073 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2074 ms]     at async yc (/home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:93:3564)
[2074 ms]     at async wc (/home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:93:2839)
[2074 ms]     at async i_ (/home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:22496)
[2074 ms]     at async n_ (/home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js:245:20650)
[2077 ms] Exit code 1
[2077 ms] Command failed: /opt/visual-studio-code/code /home/mrd/.vscode/extensions/ms-vscode-remote.remote-containers-0.238.2/dist/spec-node/devContainersSpecCLI.js run-user-commands --user-data-folder /home/mrd/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/mrd/Projects/personal/raycast --container-id f96a226b6c3be5b1853fb0544603b43c39f58ae86e4c105e4da93a0c4b84e68c --log-level debug --log-format json --config /home/mrd/Projects/personal/raycast/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --skip-non-blocking-commands false --prebuild false --stop-for-personalization true --remote-env SSH_AUTH_SOCK=/tmp/vscode-ssh-auth-48f3e143b5576514dafee47f064a48a1484c934e.sock --remote-env REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-48f3e143b5576514dafee47f064a48a1484c934e.sock --remote-env REMOTE_CONTAINERS=true --mount-workspace-git-root true
[3113 ms] Installing extension 'njpwerner.autodocstring'...
[3114 ms] [06:15:12] Getting Manifest... njpwerner.autodocstring
[3116 ms] Installing extension 'kevinrose.vsc-python-indent'...
[3116 ms] [06:15:12] Getting Manifest... kevinrose.vsc-python-indent
[3186 ms] Installing extension 'ms-python.vscode-pylance'...
[06:15:12] Getting Manifest... ms-python.vscode-pylance
[3192 ms] Installing extension 'ms-python.python'...
[3193 ms] [06:15:12] Getting Manifest... ms-python.python
[3406 ms] [06:15:12] Installing extension: kevinrose.vsc-python-indent
[3408 ms] [06:15:12] Installing extension: njpwerner.autodocstring
[3557 ms] [06:15:13] Installing extension: ms-python.python
[3566 ms] [06:15:13] Installing extension: ms-python.vscode-pylance
[3618 ms] [06:15:13] Downloaded extension: kevinrose.vsc-python-indent /home/vscode/.vscode-server/extensionsCache/kevinrose.vsc-python-indent-1.16.0
[3635 ms] [06:15:13] Downloaded extension: njpwerner.autodocstring /home/vscode/.vscode-server/extensionsCache/njpwerner.autodocstring-0.6.1
[3702 ms] [06:15:13] Extracted extension to /home/vscode/.vscode-server/extensions/.3c96a99b-9f83-4764-8e05-af64ef9b110c: kevinrose.vsc-python-indent
[3734 ms] [06:15:13] Renamed to /home/vscode/.vscode-server/extensions/kevinrose.vsc-python-indent-1.16.0
[3735 ms] [06:15:13] Extracting completed. kevinrose.vsc-python-indent
[3736 ms] [06:15:13] Extension installed successfully: kevinrose.vsc-python-indent
[3736 ms] Extension 'kevinrose.vsc-python-indent' v1.16.0 was successfully installed.
[3750 ms] [06:15:13] Extracted extension to /home/vscode/.vscode-server/extensions/.140f4470-02ca-4cc3-bb05-0201272470b1: njpwerner.autodocstring
[3780 ms] [06:15:13] Renamed to /home/vscode/.vscode-server/extensions/njpwerner.autodocstring-0.6.1
[06:15:13] Extracting completed. njpwerner.autodocstring
[06:15:13] Extension installed successfully: njpwerner.autodocstring
Extension 'njpwerner.autodocstring' v0.6.1 was successfully installed.
[4483 ms] [06:15:13] Getting Manifest... ms-python.python
[4657 ms] [06:15:14] Getting Manifest... ms-toolsai.jupyter
[5440 ms] [06:15:14] Getting Manifest... ms-toolsai.jupyter-keymap
[5726 ms] [06:15:15] Getting Manifest... ms-toolsai.jupyter-renderers
[6012 ms] [06:15:15] Getting Manifest... ms-python.vscode-pylance
[6158 ms] [06:15:15] Getting Manifest... ms-toolsai.jupyter
[6406 ms] [06:15:15] Installing extension: ms-toolsai.jupyter
[6407 ms] [06:15:15] Installing extension: ms-toolsai.jupyter-keymap
[06:15:15] Installing extension: ms-toolsai.jupyter-renderers
[06:15:15] Extension is already requested to install ms-python.vscode-pylance
[6483 ms] [06:15:15] Downloaded extension: ms-python.python /home/vscode/.vscode-server/extensionsCache/ms-python.python-2022.8.0
[6483 ms] [06:15:15] Downloaded extension: ms-toolsai.jupyter /home/vscode/.vscode-server/extensionsCache/ms-toolsai.jupyter-2022.5.1001601848
[06:15:15] Downloaded extension: ms-toolsai.jupyter-renderers /home/vscode/.vscode-server/extensionsCache/ms-toolsai.jupyter-renderers-1.0.8
[6762 ms] [06:15:16] Extracted extension to /home/vscode/.vscode-server/extensions/.d781f048-a8e7-460d-8d0f-da5ce87effb2: ms-toolsai.jupyter-renderers
[6766 ms] [06:15:16] Renamed to /home/vscode/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.8
[6767 ms] [06:15:16] Extracting completed. ms-toolsai.jupyter-renderers
[7144 ms] [06:15:16] Extracted extension to /home/vscode/.vscode-server/extensions/.7755050b-b489-4b73-ba6f-4096f8eaa04a: ms-toolsai.jupyter
[7179 ms] [06:15:16] Renamed to /home/vscode/.vscode-server/extensions/ms-toolsai.jupyter-2022.5.1001601848
[7185 ms] [06:15:16] Extracting completed. ms-toolsai.jupyter
[7325 ms] [06:15:16] Getting Manifest... ms-toolsai.jupyter-keymap
[7619 ms] [06:15:17] Getting Manifest... ms-toolsai.jupyter-renderers
[7686 ms] [06:15:17] Downloaded extension: ms-toolsai.jupyter-keymap /home/vscode/.vscode-server/extensionsCache/ms-toolsai.jupyter-keymap-1.0.0
[7691 ms] [06:15:17] Extracted extension to /home/vscode/.vscode-server/extensions/.dcf0a5b7-6734-42dc-84ee-2dc3a6a973c2: ms-toolsai.jupyter-keymap
[7692 ms] [06:15:17] Renamed to /home/vscode/.vscode-server/extensions/ms-toolsai.jupyter-keymap-1.0.0
[7693 ms] [06:15:17] Extracting completed. ms-toolsai.jupyter-keymap
[7901 ms] [06:15:17] Extracted extension to /home/vscode/.vscode-server/extensions/.f1f79eaa-08b9-4b1f-ace4-d46267ca2dfc: ms-python.python
[7921 ms] [06:15:17] Renamed to /home/vscode/.vscode-server/extensions/ms-python.python-2022.8.0
[7932 ms] [06:15:17] Extension is already requested to install ms-python.python
[7937 ms] [06:15:17] Extracting completed. ms-python.python
[7937 ms] [06:15:17] Extension installed successfully: ms-toolsai.jupyter-renderers
[7937 ms] [06:15:17] Extension installed successfully: ms-toolsai.jupyter
[06:15:17] Extension installed successfully: ms-toolsai.jupyter-keymap
[06:15:17] Extension installed successfully: ms-python.python
[7939 ms] Extension 'ms-python.python' v2022.8.0 was successfully installed.
[7963 ms] [06:15:17] Downloaded extension: ms-python.vscode-pylance /home/vscode/.vscode-server/extensionsCache/ms-python.vscode-pylance-2022.6.20
[9812 ms] [06:15:19] Extracted extension to /home/vscode/.vscode-server/extensions/.02276407-cff9-4aad-acf7-0dac90c5ac08: ms-python.vscode-pylance
[9826 ms] [06:15:19] Renamed to /home/vscode/.vscode-server/extensions/ms-python.vscode-pylance-2022.6.20
[9827 ms] [06:15:19] Extracting completed. ms-python.vscode-pylance
[9828 ms] [06:15:19] Extension installed successfully: ms-python.vscode-pylance
[9829 ms] Extension 'ms-python.vscode-pylance' v2022.6.20 was successfully installed.

Steps to Reproduce:

  1. Add custom PATH to remoteEnv
  2. Add something executable to /home/vscode/.local/bin
  3. Try to run that executable from a postCreateCommand script.

Weird situation, because in a container console I have the right PATH with .local/bin. Also when I remove PATH from remoteEnv it works fine.

vadim-su commented 2 years ago

My .devcontainer files

devcontainer.json ```jsonc // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/python-3 { "name": "Python 3", "build": { "dockerfile": "Dockerfile", "context": "..", "args": { // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local on arm64/Apple Silicon. "VARIANT": "3.10-bullseye", // Options "NODE_VERSION": "none" } }, // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. "vscode": { // Set *default* container specific settings.json values on container create. "settings": { "python.defaultInterpreterPath": "/usr/local/bin/python", "python.linting.enabled": true, "python.linting.flake8Enabled": true }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ "ms-python.python", "ms-python.vscode-pylance", "njpwerner.autodocstring", "KevinRose.vsc-python-indent" ] } }, "remoteEnv": { "PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/__pypackages__/3.10/bin" }, // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": ".devcontainer/post-craete.sh", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode" } ```
Dockerfile ```dockerfile # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/python-3/.devcontainer/base.Dockerfile # [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster ARG VARIANT="3.10-bullseye" FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} ENV DISPLAY=$DISPLAY # [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 ARG NODE_VERSION="none" RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. # COPY requirements.txt /tmp/pip-tmp/ # RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ # && rm -rf /tmp/pip-tmp # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # && apt-get -y install --no-install-recommends # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 ```
post-craete.sh ```bash #!/usr/bin/env bash # This script is run after the container is created. PDM_VERSION="1.0" pip3 install --user "pdm~=$PDM_VERSION" pdm install ```
chrmarti commented 2 years ago

${containerEnv:PATH} is not the same as the PATH read from the default shell in the container. .local/bin appears to be added in your .bashrc (or profile). You could add .local/bin in "removeEnv"'s PATH to make sure it is set for the postCreateCommand.

vadim-su commented 2 years ago

@chrmarti Thanks for the answer. I fixed it a similar way, but why do I get the working PATH when I don't set removeEnv?

github-actions[bot] commented 1 year ago

Hey @chrmarti, this issue might need further attention.

@suharnikov, you can help us out by closing this issue if the problem no longer exists, or adding more information.

github-actions[bot] commented 1 year ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!