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

Code 126: Remote-Containers server terminated unexpectedly on fresh Ubuntu 20.04 install #5283

Closed
afterwire opened this issue Jul 3, 2021 · 5 comments
Assignees
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@afterwire
Copy link

  • VSCode Version: 1.57.1
  • Local OS Version: Ubuntu 20.04.2
  • Remote OS Version: 0.183.0
  • Remote Extension/Connection Type: Docker

Taken from About Screen of VS Code
Version: 1.57.1
Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48
Date: 2021-06-17T13:26:56.255Z
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 5.8.0-59-generic snap

  • Logs:
    [57 ms] Remote-Containers 0.183.0 in VS Code 1.57.1 (507ce72a4466fbb27b715c3722558bb15afa9f48).
    [57 ms] Start: Resolving Remote
    [61 ms] Setting up container for folder or workspace: /home/mark/Code/Demo
    [61 ms] Host: unix:///run/user/1001/docker.sock
    [63 ms] Start: Check Docker is running
    [63 ms] Start: Run: /usr/bin/docker version --format {{.Server.APIVersion}}
    [99 ms] Server API version: 1.41
    [104 ms] Start: Run: git rev-parse --show-cdup
    [109 ms] Start: Run: /usr/bin/docker ps -q -a --filter label=vsch.local.folder=/home/mark/Code/Demo --filter label=vsch.quality=stable
    [140 ms] Start: Run: /usr/bin/docker inspect --type container d5705fbd2088
    [169 ms] Start: Starting container
    [170 ms] Start: Run: /usr/bin/docker start d5705fbd20880dcb5c29d3895dae91525d59fe696a2c9734f7c320fe2fe096ed
    [420 ms] Start: Run: /usr/bin/docker ps -q -a --filter label=vsch.local.folder=/home/mark/Code/Demo --filter label=vsch.quality=stable
    [449 ms] Start: Run: /usr/bin/docker inspect --type container d5705fbd2088
    [478 ms] Start: Inspecting container
    [478 ms] Start: Run: /usr/bin/docker inspect --type container d5705fbd20880dcb5c29d3895dae91525d59fe696a2c9734f7c320fe2fe096ed
    [508 ms] Start: Run in container: /bin/sh
    [511 ms] Start: Run in container: uname -m
    [570 ms] x86_64
    [570 ms]
    [571 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
    [571 ms] PRETTY_NAME="Debian GNU/Linux 10 (buster)"
    NAME="Debian GNU/Linux"
    VERSION_ID="10"
    VERSION="10 (buster)"
    VERSION_CODENAME=buster
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
    [572 ms]
    [572 ms] Start: Run in container: cat /etc/passwd
    [573 ms] Start: Setup shutdown monitor
    [574 ms] Forking shutdown monitor: /home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/shutdown/shutdownMonitorProcess /run/user/1001/vscode-remote-containers-1147b9638f9fb330a1fd4ef472750df9e80783b4.sock singleContainer Debug /home/mark/.config/Code/logs/20210703T155739/exthost1/ms-vscode-remote.remote-containers 1625325207600
    [578 ms] Start: Run in container: test -d /root/.vscode-server
    [578 ms]
    [578 ms]
    [578 ms] Exit code 1
    [579 ms] Start: Run in container: test -d /root/.vscode-remote
    [579 ms]
    [579 ms]
    [580 ms] Exit code 1
    [580 ms] Start: Run in container: test -f /var/vscode-server/.patchEtcEnvironmentMarker
    [581 ms]
    [582 ms]
    [582 ms] Start: Run in container: test -f /var/vscode-server/.patchEtcProfileMarker
    [583 ms]
    [583 ms]
    [583 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
    [585 ms]
    [585 ms]
    [585 ms] Start: Run in container: mkdir -p '/root/.vscode-server/data/Machine' && cat >'/root/.vscode-server/data/Machine/settings.json' <<'settingsJSON'
    [587 ms]
    [587 ms]
    [588 ms] Start: Run in container: test -d /root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48
    [588 ms]
    [588 ms]
    [588 ms] Exit code 1
    [589 ms] Start: Run in container: test -d /vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48
    [589 ms]
    [589 ms]
    [589 ms] Start: Run in container: mkdir -p '/root/.vscode-server/bin' && ln -s '/vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48' '/root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48'
    [591 ms]
    [591 ms]
    [591 ms] Start: Run in container: touch '/vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48'
    [591 ms] Start: Launching Remote-Containers helper.
    [592 ms] Start: Run: gpgconf --list-dir agent-extra-socket
    [594 ms]
    [595 ms]
    [595 ms] /run/user/1001/gnupg/S.gpg-agent.extra
    [595 ms]
    [595 ms] Start: Run in container: gpgconf --list-dir agent-socket
    [596 ms] /root/.gnupg/S.gpg-agent
    [597 ms]
    [597 ms] Start: Run in container: gpgconf --list-dir homedir
    [598 ms] /root/.gnupg
    [598 ms]
    [598 ms] Start: Run in container: ls '/root/.gnupg/private-keys-v1.d' 2>/dev/null
    [599 ms] https://code.visualstudio.com/docs/remote/troubleshooting#_reporting-issues
    [600 ms]
    [600 ms] Exit code 2
    [600 ms] Start: Run in container: mkdir -p -m 700 '/root/.gnupg'
    [601 ms] userEnvProbe: loginInteractiveShell (default)
    [602 ms] userEnvProbe shell: /bin/bash
    [602 ms]
    [602 ms]
    [602 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --system credential.helper '!f() { /root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48/node /tmp/vscode-remote-containers-63067b109a185b54d1cfed35dbc29fcf9d26017a.js $*; }; f' || true
    [603 ms] Start: Run: gpgconf --list-dir homedir
    [606 ms]
    [606 ms]
    [607 ms] Start: Preparing Extensions
    [607 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
    [608 ms] /home/mark/.gnupg
    [608 ms]
    [608 ms]
    [609 ms]
    [609 ms] Start: Run in container: gpgconf --list-dir homedir
    [611 ms] Extensions cache, install extensions: dart-code.dart-code
    [611 ms] /root/.gnupg
    [611 ms]
    [612 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-63067b109a185b54d1cfed35dbc29fcf9d26017a.js' >/tmp/vscode-remote-containers-63067b109a185b54d1cfed35dbc29fcf9d26017a.js
    [613 ms]
    [613 ms]
    [613 ms] Start: Run in container: test -d /root/.vscode-server/extensionsCache && ls /root/.vscode-server/extensionsCache || true
    [614 ms]
    [614 ms]
    [614 ms] Start: Run in container: # Test for /root/.gnupg/pubring.kbx and gpg
    [615 ms]
    [616 ms]
    [616 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-63067b109a185b54d1cfed35dbc29fcf9d26017a.js' >/tmp/vscode-remote-containers-server-63067b109a185b54d1cfed35dbc29fcf9d26017a.js
    [617 ms]
    [617 ms]
    [617 ms] Start: Run in container: test -d /vscode/vscode-server/extensionsCache && ls /vscode/vscode-server/extensionsCache || true
    [618 ms] Start: Run in container: /root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48/node /tmp/vscode-remote-containers-server-63067b109a185b54d1cfed35dbc29fcf9d26017a.js
    [623 ms]
    [623 ms]
    [623 ms] Start: Run in container: # Copy /home/mark/.gnupg/pubring.kbx to /root/.gnupg/pubring.kbx
    [624 ms] Extensions cache, link in container: None
    [625 ms]
    [625 ms]
    [625 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 "
    [641 ms] Start: Run in container: # Test for /root/.gnupg/trustdb.gpg and gpg
    [642 ms] Start: Starting VS Code Server
    [643 ms] Start: Run in container: /root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48/server.sh --log debug --force-disable-user-env --disable-telemetry --port 0 --extensions-download-dir /root/.vscode-server/extensionsCache --install-extension dart-code.dart-code --start-server
    [643 ms]
    [643 ms]
    [643 ms] Start: Run in container: # Copy /home/mark/.gnupg/trustdb.gpg to /root/.gnupg/trustdb.gpg
    [645 ms]
    [645 ms]
    [645 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
    [693 ms] Error: stream ended with:116 but wanted:1128865906
    at u (/home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:7:57650)
    at /home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:7:57831
    at s (/home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:12:5713)
    at Socket. (/home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:12:5883)
    at Socket.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
    [694 ms] Error: stream ended with:116 but wanted:1128865906
    at u (/home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:7:57650)
    at /home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:7:57831
    at s (/home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:12:5713)
    at Socket. (/home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/extension/extension.js:12:5883)
    at Socket.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
    [695 ms] Remote-Containers server terminated (code: 126, signal: null).

Steps to Reproduce:
This is a fresh Ubuntu install (less than 20 mins old). This is the full extent of system changes that happened prior to this.

  1. I ran this script from UK's National Cyber Security Commission to improve some Ubuntu 20.04 security settings https://github.com/ukncsc/Device-Security-Guidance-Configuration-Packs/blob/main/Linux/UbuntuLTS/Ubuntu-LTS-post-install.sh (This seems likely to be related but it's actually not obvious that there is anything in there which would cause this)
  2. I installed Docker using this official script from them: https://get.docker.com/
  3. I ran dockerd-rootless-setuptool.sh install again as per the official Docker install to enable Rootless Docker on Linux
  4. I installed VS Code via the Ubuntu App store
  5. I installed the VS Code Remote Extension
  6. I attempted to run a new directory in a container (using the official Dart container option)

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jul 3, 2021
@afterwire
Copy link
Author

Further debugging information that might be helpful:

  • I tried the same process on a fully privileged account and got identical errors
  • I tried running other containers and got identical errors
  • I tried configuring devcontainers.json to use both root and vscode users and got identical errors.

@afterwire
Copy link
Author

Additional debugging information. This time on a brand new system again. However, this time I skipped Docker entirely and ran with Podman as a solution (to try and eliminate Docker itself as a source of errors). When attempting to run on a fully privileged account again. This time when the user inside my devcontainer.json file is vscode I get:

[2021-07-04T11:56:07.041Z] Remote-Containers 0.183.0 in VS Code 1.57.1 (507ce72a4466fbb27b715c3722558bb15afa9f48).
[2021-07-04T11:56:07.041Z] Start: Resolving Remote
[2021-07-04T11:56:07.045Z] Setting up container for folder or workspace: /home/mark/Code/demo
[2021-07-04T11:56:07.048Z] Start: Check Docker is running
[2021-07-04T11:56:07.048Z] Start: Run: podman version --format {{.Server.APIVersion}}
[2021-07-04T11:56:07.183Z] Stop (135 ms): Run: podman version --format {{.Server.APIVersion}}
[2021-07-04T11:56:07.183Z] Server API version: 3.2.2
[2021-07-04T11:56:07.183Z] Stop (135 ms): Check Docker is running
[2021-07-04T11:56:07.190Z] Start: Run: git rev-parse --show-cdup
[2021-07-04T11:56:07.192Z] Stop (2 ms): Run: git rev-parse --show-cdup
[2021-07-04T11:56:07.193Z] Start: Run: podman ps -q -a --filter label=vsch.local.folder=/home/mark/Code/demo --filter label=vsch.quality=stable
[2021-07-04T11:56:07.196Z] Stop (6 ms): Run: git rev-parse --show-cdup
[2021-07-04T11:56:07.330Z] Stop (137 ms): Run: podman ps -q -a --filter label=vsch.local.folder=/home/mark/Code/demo --filter label=vsch.quality=stable
[2021-07-04T11:56:07.331Z] Start: Run: podman build -f /home/mark/Code/demo/.devcontainer/Dockerfile -t vsc-demo-65a90dd0581a904ab9b164c8a28294d5 --build-arg VARIANT=2 /home/mark/Code/demo/.devcontainer
[2021-07-04T11:56:07.363Z] STEP 1: FROM docker.io/google/dart:2
[2021-07-04T11:56:07.375Z] STEP 2: ARG INSTALL_ZSH="true"
[2021-07-04T11:56:07.376Z] --> Using cache 7502069ab78c97ad64a722489881022fe2ec3bccdc12c7b7e5f331bd158e1fca
--> 7502069ab78
[2021-07-04T11:56:07.384Z] STEP 3: ARG UPGRADE_PACKAGES="false"
[2021-07-04T11:56:07.385Z] --> Using cache dd9670d286f483cec337212de47eecc577efa97778e51322fa13fb756a0bdf73
--> dd9670d286f
[2021-07-04T11:56:07.393Z] STEP 4: ARG USERNAME=vscode
[2021-07-04T11:56:07.394Z] --> Using cache 48d4977597957c52d0620d81e143dae4be40421f6b3be23c313e39fa17d46f7f
--> 48d49775979
[2021-07-04T11:56:07.403Z] STEP 5: ARG USER_UID=1000
[2021-07-04T11:56:07.404Z] --> Using cache 3f82ee3a7fcf5a1c42fc319ef5e23bf843f7bfe2ac4e0e4ee292f46c53638235
--> 3f82ee3a7fc
[2021-07-04T11:56:07.413Z] STEP 6: ARG USER_GID=$USER_UID
[2021-07-04T11:56:07.413Z] --> Using cache b57ac1f93962782e069970417a806ed6cce9e08297b39dbd7cc76361b671746f
--> b57ac1f9396
[2021-07-04T11:56:07.423Z] STEP 7: COPY library-scripts/.sh /tmp/library-scripts/
[2021-07-04T11:56:07.558Z] --> Using cache a1a38851f957ffc2b15c109c5e4d18ceb21884301fbb516dd955eb8f903030f9
--> a1a38851f95
[2021-07-04T11:56:07.566Z] STEP 8: RUN apt-get update && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" && apt-get clean -y && rm -rf /var/lib/apt/lists/
/tmp/library-scripts
[2021-07-04T11:56:07.567Z] --> Using cache 0a2545f47a8964e24be4ff85b87416a11f9aa63ad5873cb1764033a45a769a14
--> 0a2545f47a8
[2021-07-04T11:56:07.577Z] STEP 9: ENV PUB_CACHE="/usr/local/share/pub-cache"
[2021-07-04T11:56:07.577Z] --> Using cache c69edea8ff541a0b68864e9d6bbc7cde47903faa0f3dd09946001f2c4b9ef9e5
--> c69edea8ff5
[2021-07-04T11:56:07.587Z] STEP 10: ENV PATH="${PUB_CACHE}/bin:${PATH}"
[2021-07-04T11:56:07.588Z] --> Using cache 142dceb0ef795686d5cd43a1212f74b7a8e36fd519e8a4895ba5a88878d6b1d0
--> 142dceb0ef7
[2021-07-04T11:56:07.597Z] STEP 11: RUN if ! cat /etc/group | grep -e "^pub-cache:" > /dev/null 2>&1; then groupadd -r pub-cache; fi && usermod -a -G pub-cache ${USERNAME} && umask 0002 && mkdir -p ${PUB_CACHE} && chown :pub-cache ${PUB_CACHE} && sed -i -e "s/export PATH=/export PATH=/usr/local/share/pub-cache:/" /etc/profile.d/00-restore-env.sh
[2021-07-04T11:56:07.598Z] --> Using cache 5bacc27f0cf67fea803f82e253a03c0648a9d83337eaa6c625360e7c22d59b0a
STEP 12: COMMIT vsc-demo-65a90dd0581a904ab9b164c8a28294d5
[2021-07-04T11:56:07.618Z] --> 5bacc27f0cf
[2021-07-04T11:56:07.618Z] Successfully tagged localhost/vsc-demo-65a90dd0581a904ab9b164c8a28294d5:latest
[2021-07-04T11:56:07.650Z] 5bacc27f0cf67fea803f82e253a03c0648a9d83337eaa6c625360e7c22d59b0a
[2021-07-04T11:56:07.665Z] Stop (334 ms): Run: podman build -f /home/mark/Code/demo/.devcontainer/Dockerfile -t vsc-demo-65a90dd0581a904ab9b164c8a28294d5 --build-arg VARIANT=2 /home/mark/Code/demo/.devcontainer
[2021-07-04T11:56:07.666Z] Start: Run: podman inspect --type image vsc-demo-65a90dd0581a904ab9b164c8a28294d5
[2021-07-04T11:56:07.798Z] Stop (132 ms): Run: podman inspect --type image vsc-demo-65a90dd0581a904ab9b164c8a28294d5
[2021-07-04T11:56:07.799Z] Start: Run: podman build -f /tmp/vsch/updateUID.Dockerfile-0.183.0 -t vsc-demo-65a90dd0581a904ab9b164c8a28294d5-uid --build-arg BASE_IMAGE=vsc-demo-65a90dd0581a904ab9b164c8a28294d5 --build-arg REMOTE_USER=vscode --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=root /tmp/vsch
[2021-07-04T11:56:07.831Z] STEP 1: FROM vsc-demo-65a90dd0581a904ab9b164c8a28294d5
[2021-07-04T11:56:07.843Z] STEP 2: USER root
[2021-07-04T11:56:07.844Z] --> Using cache 1b499ac674423e368eea4f25e295a13cae5c7360d15fd8798239cda1ab9dc7cb
--> 1b499ac6744
[2021-07-04T11:56:07.855Z] STEP 3: ARG REMOTE_USER
[2021-07-04T11:56:07.856Z] --> Using cache e97d8c66a27ce0bf5d8425798a99e98f50ed49dc1a873cd084adfe78c162cf45
--> e97d8c66a27
[2021-07-04T11:56:07.865Z] STEP 4: ARG NEW_UID
[2021-07-04T11:56:07.866Z] --> Using cache 8ee36668c1edd11628338d2d76c1652ecb83f3fe17d382edff8bed867a64cef5
--> 8ee36668c1e
[2021-07-04T11:56:07.874Z] STEP 5: ARG NEW_GID
[2021-07-04T11:56:07.875Z] --> Using cache 06b5a6d8bff6df91d6dc1ccc5035776f08dfb5feb0bb99b88d0a7fe6f6a2ffef
--> 06b5a6d8bff
[2021-07-04T11:56:07.884Z] STEP 6: SHELL ["/bin/sh", "-c"]
[2021-07-04T11:56:07.886Z] --> Using cache 44d35c8d7cadd29be8962608662a99ec614ce49f787ddc2c3600e264c1980856
--> 44d35c8d7ca
[2021-07-04T11:56:07.896Z] STEP 7: 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;
[2021-07-04T11:56:07.897Z] --> Using cache df83734c00b6161173f59c7272a856fbbe612113544f02cad54e4c49d856b287
--> df83734c00b
[2021-07-04T11:56:07.906Z] STEP 8: ARG IMAGE_USER
[2021-07-04T11:56:07.907Z] --> Using cache 711f210ad5385f41ac85716e62f96ab884c96cc04521856c9a14a25fa170d823
--> 711f210ad53
[2021-07-04T11:56:07.915Z] STEP 9: USER $IMAGE_USER
[2021-07-04T11:56:07.916Z] --> Using cache 15288bb7d3f93318ebdd1b79f8ee09307cb16f74f9310c2afd47e8932a16e28f
STEP 10: COMMIT vsc-demo-65a90dd0581a904ab9b164c8a28294d5-uid
[2021-07-04T11:56:07.934Z] --> 15288bb7d3f
[2021-07-04T11:56:07.934Z] Successfully tagged localhost/vsc-demo-65a90dd0581a904ab9b164c8a28294d5-uid:latest
[2021-07-04T11:56:07.959Z] 15288bb7d3f93318ebdd1b79f8ee09307cb16f74f9310c2afd47e8932a16e28f
[2021-07-04T11:56:08.034Z] Stop (235 ms): Run: podman build -f /tmp/vsch/updateUID.Dockerfile-0.183.0 -t vsc-demo-65a90dd0581a904ab9b164c8a28294d5-uid --build-arg BASE_IMAGE=vsc-demo-65a90dd0581a904ab9b164c8a28294d5 --build-arg REMOTE_USER=vscode --build-arg NEW_UID=1000 --build-arg NEW_GID=1000 --build-arg IMAGE_USER=root /tmp/vsch
[2021-07-04T11:56:08.035Z] Start: Run: podman -v
[2021-07-04T11:56:08.064Z] Stop (29 ms): Run: podman -v
[2021-07-04T11:56:08.064Z] Start: Run: podman events --format json --filter event=start
[2021-07-04T11:56:08.067Z] Start: Starting container
[2021-07-04T11:56:08.067Z] Start: Run: podman run --sig-proxy=false -a STDOUT -a STDERR --mount type=bind,source=/home/mark/Code/demo,target=/workspaces/demo --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=/home/mark/Code/demo -l vsch.quality=stable -l vsch.remote.devPort=0 --entrypoint /bin/sh vsc-demo-65a90dd0581a904ab9b164c8a28294d5-uid -c echo Container started ; trap "exit 0" 15; while sleep 1 & wait $!; do :; done
[2021-07-04T11:56:08.172Z] Container started
[2021-07-04T11:56:08.320Z] Start: Run: podman inspect --type container 310c3cc2b32eb16c42779e824e4287cd3de7dcbb45d85d47a58a8766deabe2c0
[2021-07-04T11:56:08.456Z] Stop (136 ms): Run: podman inspect --type container 310c3cc2b32eb16c42779e824e4287cd3de7dcbb45d85d47a58a8766deabe2c0
[2021-07-04T11:56:08.459Z] Stop (392 ms): Starting container
[2021-07-04T11:56:08.459Z] Start: Run: podman ps -q -a --filter label=vsch.local.folder=/home/mark/Code/demo --filter label=vsch.quality=stable
[2021-07-04T11:56:08.470Z] Stop (406 ms): Run: podman events --format json --filter event=start
[2021-07-04T11:56:08.641Z] Stop (182 ms): Run: podman ps -q -a --filter label=vsch.local.folder=/home/mark/Code/demo --filter label=vsch.quality=stable
[2021-07-04T11:56:08.641Z] Start: Run: podman inspect --type container 310c3cc2b32e
[2021-07-04T11:56:08.781Z] Stop (140 ms): Run: podman inspect --type container 310c3cc2b32e
[2021-07-04T11:56:08.782Z] Start: Inspecting container
[2021-07-04T11:56:08.782Z] Start: Run: podman inspect --type container 310c3cc2b32eb16c42779e824e4287cd3de7dcbb45d85d47a58a8766deabe2c0
[2021-07-04T11:56:08.914Z] Stop (132 ms): Run: podman inspect --type container 310c3cc2b32eb16c42779e824e4287cd3de7dcbb45d85d47a58a8766deabe2c0
[2021-07-04T11:56:08.914Z] Stop (132 ms): Inspecting container
[2021-07-04T11:56:08.915Z] Start: Run in container: /bin/sh
[2021-07-04T11:56:08.919Z] Start: Run in container: uname -m
[2021-07-04T11:56:08.970Z] x86_64
[2021-07-04T11:56:08.970Z]
[2021-07-04T11:56:08.970Z] Stop (51 ms): Run in container: uname -m
[2021-07-04T11:56:08.970Z] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/nullparzo
[2021-07-04T11:56:08.972Z] PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[2021-07-04T11:56:08.972Z]
[2021-07-04T11:56:08.972Z] Stop (2 ms): Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[2021-07-04T11:56:08.973Z] Start: Run in container: cat /etc/passwd
[2021-07-04T11:56:08.974Z] Stop (1 ms): Run in container: cat /etc/passwd
[2021-07-04T11:56:08.975Z] Start: Updating configuration state
[2021-07-04T11:56:08.978Z] Stop (3 ms): Updating configuration state
[2021-07-04T11:56:08.978Z] Start: Setup shutdown monitor
[2021-07-04T11:56:08.979Z] Forking shutdown monitor: /home/mark/.vscode/extensions/ms-vscode-remote.remote-containers-0.183.0/dist/shutdown/shutdownMonitorProcess /run/user/1000/vscode-remote-containers-9bc67bc941f4991ecd2dab8b0cf15db7e8f109c9.sock singleContainer Debug /home/mark/.config/Code/logs/20210704T124434/exthost1/ms-vscode-remote.remote-containers 1625399766980
[2021-07-04T11:56:08.981Z] Stop (3 ms): Setup shutdown monitor
[2021-07-04T11:56:08.982Z] Start: Run in container: test -d /root/.vscode-server
[2021-07-04T11:56:08.982Z]
[2021-07-04T11:56:08.982Z]
[2021-07-04T11:56:08.983Z] Exit code 1
[2021-07-04T11:56:08.983Z] Stop (1 ms): Run in container: test -d /root/.vscode-server
[2021-07-04T11:56:08.983Z] Start: Run in container: test -d /root/.vscode-remote
[2021-07-04T11:56:08.983Z]
[2021-07-04T11:56:08.983Z]
[2021-07-04T11:56:08.983Z] Exit code 1
[2021-07-04T11:56:08.984Z] Stop (1 ms): Run in container: test -d /root/.vscode-remote
[2021-07-04T11:56:08.984Z] Start: Run in container: test -f /var/vscode-server/.patchEtcEnvironmentMarker
[2021-07-04T11:56:08.985Z]
[2021-07-04T11:56:08.985Z]
[2021-07-04T11:56:08.985Z] Exit code 1
[2021-07-04T11:56:08.985Z] Stop (1 ms): Run in container: test -f /var/vscode-server/.patchEtcEnvironmentMarker
[2021-07-04T11:56:08.985Z] Start: Run in container: /bin/sh
[2021-07-04T11:56:08.989Z] Start: Run in container: set -o noclobber ; mkdir -p '/var/vscode-server' && { > '/var/vscode-server/.patchEtcEnvironmentMarker' ; } 2> /dev/null
[2021-07-04T11:56:09.043Z]
[2021-07-04T11:56:09.043Z]
[2021-07-04T11:56:09.043Z] Stop (54 ms): Run in container: set -o noclobber ; mkdir -p '/var/vscode-server' && { > '/var/vscode-server/.patchEtcEnvironmentMarker' ; } 2> /dev/null
[2021-07-04T11:56:09.043Z] Start: Run in container: cat >> /etc/environment <<'etcEnvrionmentEOF'
[2021-07-04T11:56:09.044Z]
[2021-07-04T11:56:09.044Z]
[2021-07-04T11:56:09.044Z] Stop (1 ms): Run in container: cat >> /etc/environment <<'etcEnvrionmentEOF'
[2021-07-04T11:56:09.045Z] Start: Run in container: test -f /var/vscode-server/.patchEtcProfileMarker
[2021-07-04T11:56:09.045Z]
[2021-07-04T11:56:09.045Z]
[2021-07-04T11:56:09.045Z] Exit code 1
[2021-07-04T11:56:09.045Z] Stop (0 ms): Run in container: test -f /var/vscode-server/.patchEtcProfileMarker
[2021-07-04T11:56:09.045Z] Start: Run in container: set -o noclobber ; mkdir -p '/var/vscode-server' && { > '/var/vscode-server/.patchEtcProfileMarker' ; } 2> /dev/null
[2021-07-04T11:56:09.047Z]
[2021-07-04T11:56:09.047Z]
[2021-07-04T11:56:09.048Z] Stop (3 ms): Run in container: set -o noclobber ; mkdir -p '/var/vscode-server' && { > '/var/vscode-server/.patchEtcProfileMarker' ; } 2> /dev/null
[2021-07-04T11:56:09.048Z] Start: Run in container: sed -i -E 's/((^|\s)PATH=)([^\$]
)$/\1${PATH:-\3}/g' /etc/profile || true
[2021-07-04T11:56:09.051Z]
[2021-07-04T11:56:09.051Z]
[2021-07-04T11:56:09.051Z] Stop (3 ms): Run in container: sed -i -E 's/((^|\s)PATH=)([^\$]*)$/\1${PATH:-\3}/g' /etc/profile || true
[2021-07-04T11:56:09.051Z] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[2021-07-04T11:56:09.053Z]
[2021-07-04T11:56:09.054Z] mkdir: cannot create directory '/root': Permission denied
[2021-07-04T11:56:09.054Z] Exit code 1
[2021-07-04T11:56:09.054Z] Stop (3 ms): Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[2021-07-04T11:56:09.054Z] Start: Run in container: cat /root/.vscode-server/data/Machine/settings.json
[2021-07-04T11:56:09.056Z]
[2021-07-04T11:56:09.056Z] cat: /root/.vscode-server/data/Machine/settings.json: Permission denied
[2021-07-04T11:56:09.057Z] Exit code 1
[2021-07-04T11:56:09.057Z] Stop (3 ms): Run in container: cat /root/.vscode-server/data/Machine/settings.json
[2021-07-04T11:56:09.057Z] Start: Run in container: test -d /root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48
[2021-07-04T11:56:09.058Z]
[2021-07-04T11:56:09.058Z]
[2021-07-04T11:56:09.058Z] Exit code 1
[2021-07-04T11:56:09.058Z] Stop (1 ms): Run in container: test -d /root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48
[2021-07-04T11:56:09.059Z] Start: Run in container: test -d /vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48
[2021-07-04T11:56:09.059Z]
[2021-07-04T11:56:09.060Z]
[2021-07-04T11:56:09.060Z] Stop (1 ms): Run in container: test -d /vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48
[2021-07-04T11:56:09.060Z] Start: Run in container: mkdir -p '/root/.vscode-server/bin' && ln -s '/vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48' '/root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48'
[2021-07-04T11:56:09.062Z]
[2021-07-04T11:56:09.062Z] mkdir: cannot create directory '/root': Permission denied
[2021-07-04T11:56:09.062Z] Exit code 1
[2021-07-04T11:56:09.063Z] Stop (3 ms): Run in container: mkdir -p '/root/.vscode-server/bin' && ln -s '/vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48' '/root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48'
[2021-07-04T11:56:09.064Z] Command in container failed: mkdir -p '/root/.vscode-server/bin' && ln -s '/vscode/vscode-server/bin/x64/507ce72a4466fbb27b715c3722558bb15afa9f48' '/root/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48'

However, when I comment out the user in the devcontainer.json file I get the same set of errors shown in the original post.

@afterwire
Copy link
Author

afterwire commented Jul 4, 2021

Also in an aim to isolate anything even remotely controversial from the one and only script that ran before installing Podman, VSCode and setting up the plugin I have the following things:

# Set permissions for admin user's home directory.
chmod 700 "/home/$ADMINUSER"

# Prevent standard user executing su.
dpkg-statoverride --update --add root adm 4750 /bin/su

# Protect user home directories.
echo -e "${HIGHLIGHT}Configuring home directories and shell access...${NC}"
sed -ie '/^DIR_MODE=/ s/=[0-9]*\+/=0700/' /etc/adduser.conf
sed -ie '/^UMASK\s\+/ s/022/077/' /etc/login.defs

# Set some AppArmor profiles to enforce mode.
echo -e "${HIGHLIGHT}Configuring apparmor...${NC}"
aa-enforce /etc/apparmor.d/usr.bin.firefox
aa-enforce /etc/apparmor.d/usr.sbin.avahi-daemon
aa-enforce /etc/apparmor.d/usr.sbin.dnsmasq
aa-enforce /etc/apparmor.d/bin.ping
aa-enforce /etc/apparmor.d/usr.sbin.rsyslogd

# Fix some permissions in /var that are writable and executable by the standard user.
echo -e "${HIGHLIGHT}Configuring additional directory permissions...${NC}"
chmod o-w /var/crash
chmod o-w /var/metrics
chmod o-w /var/tmp

Question: Is a chmod 700 in my home directory likely to cause this kind of permissions error? (Reference: https://chmodcommand.com/chmod-700/)

Note: Tried setting home directory to match latest Ubuntu default of 750 and rebuilt everything from scratch with no impact

@chrmarti
Copy link
Contributor

chrmarti commented Jul 5, 2021

Unsure, could you try using an off-the-shelf Ubuntu and install Docker rootfull (not rootless) and confirm it works? Then apply one change at a time to see which one breaks it? (A discussion on issues with rootless: #4646)

@chrmarti chrmarti self-assigned this Jul 5, 2021
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jul 5, 2021
@github-actions
Copy link

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!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants