VS Code Container Remote Extension: Could not fetch remote environment - docker

I have a problem with VS Code remote development. I am using a docker container to isolate my environment. This works on my main machine, but not on my Laptop which I recently set up.
The Laptop stats:
Linux Thinkpad 5.4.7-arch1-1 #1 SMP PREEMPT Tue, 31 Dec 2019 17:20:16 +0000 x86_64 GNU/Linux
I have installed the most recent version of the VS Code binaries (not the open source version) and the extension for remote development.
Now when I try to open a preexisiting project (which works on my main machine) inside a container or try to attach to a running container I get two notifications in vs code and no access to the project files.
Container Build Log
[0 ms] Start: Resolving remote
[1 ms] Setting up container for folder or workspace: /home/philipp/Projects/Ferienwohnung_Walther
[4 ms] Start: Check Docker is running
[33 ms] Start: Run: docker build -f /home/philipp/Projects/Ferienwohnung_Walther/.devcontainer/Dockerfile -t vsc-ferienwohnung_walther-f2cd21b5a0eb18ef2a7ad25ba128b053 /home/philipp/Projects/Ferienwohnung_Walther/.devcontainer
[65 ms] Sending build context to Docker daemon 5.632kB
[102 ms] Step 1/6 : FROM node:lts
[102 ms] ---> 6b5991bf650f
Step 2/6 : ENV DEBIAN_FRONTEND=noninteractive
[102 ms] ---> Using cache
---> 60d927450ba8
Step 3/6 : ARG USER_UID=1000
[103 ms] ---> Using cache
---> 4d5dc4e9421a
Step 4/6 : ARG USER_GID=$USER_UID
[103 ms] ---> Using cache
---> 283c5b3feb04
Step 5/6 : RUN apt-get update && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 && apt-get -y install git iproute2 procps && npm install -g eslint && if [ "$USER_GID" != "1000" ]; then groupmod node --gid $USER_GID; fi && if [ "$USER_UID" != "1000" ]; then usermod --uid $USER_UID node; fi && apt-get install -y sudo && echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node && chmod 0440 /etc/sudoers.d/node && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* && npm install -g gatsby-cli && npm install
[104 ms] ---> Using cache
---> ecb1a4bbb610
[104 ms] Step 6/6 : CMD ["bash"]
[104 ms] ---> Using cache
---> 4b40397244fc
[105 ms] Successfully built 4b40397244fc
[113 ms] Successfully tagged vsc-ferienwohnung_walther-f2cd21b5a0eb18ef2a7ad25ba128b053:latest
[118 ms] Start: Run: git rev-parse --show-toplevel
[128 ms] Start: Starting container
[128 ms] Start: Run: docker run -a STDOUT -a STDERR -p 127.0.0.1:8000:8000 --mount type=bind,source=/home/philipp/Projects/Ferienwohnung_Walther,target=/workspaces/Ferienwohnung_Walther,consistency=cached -l vsch.quality=stable -l vsch.remote.devPort=0 -l vsch.local.folder=/home/philipp/Projects/Ferienwohnung_Walther --entrypoint /bin/sh vsc-ferienwohnung_walther-f2cd21b5a0eb18ef2a7ad25ba128b053 -c echo Container started ; while sleep 1; do :; done
[734 ms] Container started
[745 ms] Start: Inspecting container
[750 ms] Start: Run in container: uname -m
[1005 ms] x86_64
[1005 ms]
[1005 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[1006 ms] PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
[1006 ms]
[1007 ms] Start: Run in container: cat /etc/passwd
[1008 ms] Start: Updating configuration state
[1009 ms] Start: Setup shutdown monitor
[1011 ms] Forking shutdown monitor: /home/philipp/.vscode/extensions/ms-vscode-remote.remote-containers-0.94.0/dist/shutdownMonitorProcess /run/user/1000/vscode-remote-containers-46e7b8adba2ed8d9f9924860b5b3558d79c7fa06.sock singleContainer Info
[1014 ms] Start: Run in container: test -d /root/.vscode-server
[1015 ms]
[1015 ms]
[1015 ms] Exit code 1
[1015 ms] Start: Run in container: test -d /root/.vscode-remote
[1015 ms]
[1015 ms]
[1015 ms] Exit code 1
[1016 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[1017 ms]
[1017 ms]
[1017 ms] Start: Run in container: mkdir -p '/root/.vscode-server/data/Machine' && cat >'/root/.vscode-server/data/Machine/settings.json' <<'settingsJSON'
[1019 ms]
[1019 ms]
[1019 ms] Start: Run in container: # Copy .gitconfig
[1022 ms]
[1022 ms]
[1023 ms] Start: Run in container: test -d /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0
[1023 ms]
[1023 ms]
[1023 ms] Exit code 1
[1023 ms] Installing VS Code Server for commit 26076a4de974ead31f97692a0d32f90d735645c0
[1023 ms] Start: Run in container: mkdir -p /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0_1578132510402
[1024 ms]
[1024 ms]
[1025 ms] Start: Run: docker exec -w /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0_1578132510402 -u root -i 1a22cf666c2dcc444f05f998b4ce810dfb7c0b505303bb11967a12cabf3b1a3c tar --no-same-owner -xz --strip-components 1
[2130 ms]
[2130 ms]
[2131 ms] Start: Run in container: mv -n /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0_1578132510402 /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0
[2132 ms]
[2132 ms]
[2132 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[2133 ms]
[2133 ms]
[2134 ms] Start: Run in container: cd /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0; export VSCODE_AGENT_FOLDER=/root/.vscode-server; /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/server.sh --install-extension dbaeumer.vscode-eslint --install-extension formulahendry.auto-rename-tag --install-extension mgmcdermott.vscode-language-babel --install-extension eamodio.gitlens --install-extension gruntfuggly.todo-tree --install-extension esbenp.prettier-vscode --install-extension jpoissonnier.vscode-styled-components --install-extension naumovs.color-highlight --force
[15166 ms] Installing extensions...
Installing extension 'dbaeumer.vscode-eslint' v2.0.11...
Extension 'dbaeumer.vscode-eslint' v2.0.11 was successfully installed.
Installing extension 'formulahendry.auto-rename-tag' v0.1.1...
Extension 'formulahendry.auto-rename-tag' v0.1.1 was successfully installed.
Installing extension 'mgmcdermott.vscode-language-babel' v0.0.25...
Extension 'mgmcdermott.vscode-language-babel' v0.0.25 was successfully installed.
Installing extension 'eamodio.gitlens' v10.2.0...
Extension 'eamodio.gitlens' v10.2.0 was successfully installed.
Installing extension 'gruntfuggly.todo-tree' v0.0.162...
Extension 'gruntfuggly.todo-tree' v0.0.162 was successfully installed.
Installing extension 'esbenp.prettier-vscode' v3.18.0...
Extension 'esbenp.prettier-vscode' v3.18.0 was successfully installed.
Installing extension 'jpoissonnier.vscode-styled-components' v0.0.27...
Extension 'jpoissonnier.vscode-styled-components' v0.0.27 was successfully installed.
Installing extension 'naumovs.color-highlight' v2.3.0...
Extension 'naumovs.color-highlight' v2.3.0 was successfully installed.
[15166 ms]
[15167 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.postCreateCommandMarker' ; } 2> /dev/null
[15168 ms]
[15168 ms]
[15168 ms] Start: Run in container: test -f /root/.vscode-server/.postCreateCommandMarker
[15168 ms]
[15168 ms]
[15168 ms] Exit code 1
[15169 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink -f /proc/$pid/cwd ; xargs -0 < /proc/$pid/environ ; xargs -0 < /proc/$pid/cmdline ; } ; echo ; done 2>/dev/null
[15181 ms] Start: Run: docker exec -w /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0 -u root -e SHELL=/bin/bash -e VSCODE_AGENT_FOLDER=/root/.vscode-server 1a22cf666c2dcc444f05f998b4ce810dfb7c0b505303bb11967a12cabf3b1a3c /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/server.sh --disable-user-env-probe --port 0
[15660 ms]
*
* Visual Studio Code Server
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license https://aka.ms/vscode-remote/license
*
[15694 ms] IP Address: 172.17.0.3
[15696 ms] Extension host agent listening on 45223
[15696 ms] Start: Run in container: echo 45223 >/root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c0/.devport
[15696 ms]
[15696 ms] [10:08:45] Extension host agent started.
[15697 ms]
[15697 ms]
[15697 ms] Forwarding local port 45223 to container port 45223
[15697 ms] Start: Setting up SSH authentication socket.
[15698 ms]
--------------------------
Published Ports:
8000/tcp -> 127.0.0.1:8000
--------------------------
Notifications:
Could not fetch remote environment
Failed to connect to the remote extension host server (Error: connect ECONNREFUSED ::1:37469)
VS Code window log:
[2020-01-04 10:44:22.405] [renderer1] [error] [remote-connection][ExtensionHost][563bd…][initial][localhost:37469] socketFactory.connect() failed. Error:
[2020-01-04 10:44:22.406] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.406] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2020-01-04 10:44:22.406] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.407] [renderer1] [error] [remote-connection][Management ][71630…][initial][localhost:37469] socketFactory.connect() failed. Error:
[2020-01-04 10:44:22.407] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.407] [renderer1] [error] [remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:
[2020-01-04 10:44:22.407] [renderer1] [error] Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.666] [renderer1] [error] connect ECONNREFUSED ::1:37469: Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:44:22.667] [renderer1] [error] Could not fetch environment: Error: Could not fetch environment
at file:///opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:3798:126
at processTicksAndRejections (internal/process/task_queues.js:89:5)
[2020-01-04 10:44:22.667] [renderer1] [error] connect ECONNREFUSED ::1:37469: Error: connect ECONNREFUSED ::1:37469
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14)
[2020-01-04 10:56:49.757] [renderer1] [error] Could not fetch environment: Error: Could not fetch environment
at file:///opt/visual-studio-code/resources/app/out/vs/workbench/workbench.desktop.main.js:3798:126
The result: VS Code Error State
Steps I have tried
install older versions of the extension to check for a regression
try vs code insider
create a new container file with a template from vs code
At this point I think I know little about how the extension works to debug this any further. It would be great if you could point me to more steps I could try.
Thank you

Related

Is it possible to run locally default GitHub Codespaces image locally?

As I don't have access to Github Codespaces and I'm not the type of person to pay for Github Teams only for this... is it possible to run mcr.microsoft.com/vscode/devcontainers/universal:2.0.9-linux locally with docker?
I tried to use steps in https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux to copy .devcontainer folder to my project folder, but when I try to use Remote-Containers: Reopen Folder in Container it stops with error:
[2022-09-05T22:07:51.999Z] Stop (218 ms): Run: docker inspect --type container 2e252fbefb8fa27f8e4d527747cb5da095103cd894f904fd94004f0fdbc8df93
[2022-09-05T22:07:51.999Z] Stop (218 ms): Inspecting container
[2022-09-05T22:07:51.999Z] Start: Run in container: /bin/sh
[2022-09-05T22:07:52.002Z] Start: Run in container: uname -m
[2022-09-05T22:07:52.016Z] Stop (17 ms): Run in container: /bin/sh
[2022-09-05T22:07:52.016Z] Shell server terminated (code: 1, signal: null)
[2022-09-05T22:07:52.016Z] Error response from daemon: Container 2e252fbefb8fa27f8e4d527747cb5da095103cd894f904fd94004f0fdbc8df93 is not running
[2022-09-05T22:07:52.016Z] Start: Run in container: cat /etc/passwd
[2022-09-05T22:07:52.016Z] Stdin closed!
[2022-09-05T22:07:52.017Z] Error: An error occurred setting up the container.
[2022-09-05T22:07:52.017Z] at SF (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:257:2186)
[2022-09-05T22:07:52.017Z] at pb (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:257:2124)
[2022-09-05T22:07:52.017Z] at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-09-05T22:07:52.017Z] at async DF (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:263:2006)
[2022-09-05T22:07:52.017Z] at async to (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:263:3110)
[2022-09-05T22:07:52.017Z] at async Ak (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:383:8108)
[2022-09-05T22:07:52.018Z] at async Ok (/home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js:383:7864)
[2022-09-05T22:07:52.021Z] Stop (736 ms): Run: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/randomperson/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/randomperson/Documents/Github/Bob --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/randomperson/Documents/Github/Bob --log-level debug --log-format json --config /home/randomperson/Documents/Github/Bob/.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
[2022-09-05T22:07:52.021Z] Exit code 1
[2022-09-05T22:07:52.025Z] Command failed: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/randomperson/.vscode/extensions/ms-vscode-remote.remote-containers-0.251.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/randomperson/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/randomperson/Documents/Github/Bob --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/randomperson/Documents/Github/Bob --log-level debug --log-format json --config /home/randomperson/Documents/Github/Bob/.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
[2022-09-05T22:07:52.025Z] Exit code 1
Is there maybe an image with a specific tag that can be self-hosted or my machine is just too slow for this.

Remote Dev Containers - Moving to Docker Compose

I'm using VSCode Devcontainers to develop a micro-services application and I've been using a Java Devcontainer without issues.
But, given the micro-service nature of the project, there are other containers I need to execute (for instance, a postgres db).
This is the only container I use to develop, where I install Java-specific extensions, intellisense working, etc. I do NOT have this on my local machine nor do I want to have. Only when coding on the container.
Now, I did some research to shift the use of Devcontainers to docker-compose and start not only the Java devcontainer but also the database.
Everything seems to run fine.
However, the dev container will alway exit with code 137 and I can't figure out why.
The structure of the code is as follows:
|.devcontainer
|--devcontainer.json
|--Dockerfile
|--docker-compose.yaml
|.git
|actionable-content
|--(my module code)
|db
|--Dockerfile
|--init.sql
|(...)
This is the output of the containers build commands:
[18 ms] Start: Resolving remote
[20 ms] Setting up container for folder or workspace: /Users/zed/Projects/circle-labs
[39 ms] Start: Check Docker is running
[39 ms] Start: Run: docker info
[401 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=evooq-circle --filter label=com.docker.compose.service=dev-container
[444 ms] Start: Run: docker inspect --type container ea365c78bc6d
[490 ms] Start: Removing existing container.
[490 ms] Start: Run: docker rm -f ea365c78bc6d229737805fe4121324b45c87688ccd369bccebf209689f2658d7
[611 ms] Start: Run: docker-compose -f /Users/zed/Projects/circle-labs/.devcontainer/docker-compose.yaml config --services
[1027 ms] Start: Run: docker events --format {{json .}} --filter status=start
[1032 ms] Start: Run: docker-compose --project-name evooq-circle -f /Users/zed/Projects/circle-labs/.devcontainer/docker-compose.yaml up -d --build db dev-container
Building db
Step 1/2 : FROM postgres:9.6
---> 16f0ba6ed857
Step 2/2 : COPY init.sql /docker-entrypoint-initdb.d/
---> Using cache
---> e90f4e0c7c73
Successfully built e90f4e0c7c73
Successfully tagged evooq-circle_db:latest
Building dev-container
Step 1/15 : FROM openjdk:11-jdk
---> a548e8a50190
Step 2/15 : ARG USERNAME=vscode
---> Using cache
---> bd1352aa5e59
Step 3/15 : ARG USER_UID=1000
---> Using cache
---> 192dca586afc
Step 4/15 : ARG USER_GID=$USER_UID
---> Using cache
---> 91a3124b064c
Step 5/15 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 222b620a3e1b
Step 6/15 : RUN apt-get update && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 && groupadd --gid $USER_GID $USERNAME && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME && apt-get install -y sudo && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && chmod 0440 /etc/sudoers.d/$USERNAME && apt-get -y install git openssh-client less iproute2 procps curl lsb-release
---> Using cache
---> 8ad502a168f4
Step 7/15 : ARG MAVEN_VERSION=3.6.3
---> Using cache
---> 2f0fed0ae029
Step 8/15 : ARG MAVEN_SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
---> Using cache
---> ba172229c081
Step 9/15 : RUN mkdir -p /usr/share/maven /usr/share/maven/ref && curl -fsSL -o /tmp/apache-maven.tar.gz https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz && echo "${MAVEN_SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 && rm -f /tmp/apache-maven.tar.gz && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
---> Using cache
---> 033989c61d1f
Step 10/15 : COPY maven-settings.xml /usr/share/maven/ref/
---> Using cache
---> 5dcb163d3198
Step 11/15 : ENV MAVEN_HOME /usr/share/maven
---> Using cache
---> 9c21dcb2fa42
Step 12/15 : ENV MAVEN_CONFIG /root/.m2
---> Using cache
---> 56960418c145
Step 13/15 : RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
---> Using cache
---> 939839f8b869
Step 14/15 : ENV DEBIAN_FRONTEND=dialog
---> Using cache
---> da8ceada8e6f
Step 15/15 : RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi
---> Using cache
---> 8781e2f051b0
Successfully built 8781e2f051b0
Successfully tagged evooq-circle_dev-container:latest
evooq-circle_db_1 is up-to-date
Creating evooq-circle_dev-container_1 ... done
[2449 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=evooq-circle --filter label=com.docker.compose.service=dev-container
[2507 ms] Start: Run: docker inspect --type container f11a0e8f78c2
[2555 ms] Start: Inspecting container
[2555 ms] Start: Run: docker inspect --type container f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49
[2609 ms] Start: Run: docker exec -i -u root -e VSCODE_REMOTE_CONTAINERS_SESSION=190e175e-f482-4554-aaf4-e062c672fcdb1593105541203 f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 /bin/sh
[2614 ms] Start: Run in container: uname -m
[2753 ms] x86_64
[2753 ms]
[2753 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[2761 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/"
[2761 ms]
[2761 ms] Start: Run in container: cat /etc/passwd
[2765 ms] Start: Updating configuration state
[2770 ms] Start: Setup shutdown monitor
[2773 ms] Forking shutdown monitor: /Users/zed/.vscode/extensions/ms-vscode-remote.remote-containers-0.122.1/dist/shutdownMonitorProcess /var/folders/bp/bjk1_4fs2ljdx8pflq89nd500000gn/T/vscode-remote-containers-e8ace0f38179417fa6822e6d83141fd504155ae0.sock dockerCompose Info /Users/zed/Library/Application Support/Code/logs/20200625T091545/exthost3/ms-vscode-remote.remote-containers
[2779 ms] Start: Run in container: test -d /root/.vscode-server
[2785 ms]
[2785 ms]
[2785 ms] Exit code 1
[2785 ms] Start: Run in container: test -d /root/.vscode-remote
[2788 ms]
[2788 ms]
[2788 ms] Exit code 1
[2788 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[2797 ms]
[2797 ms]
[2797 ms] Start: Run in container: mkdir -p '/root/.vscode-server/data/Machine' && cat >'/root/.vscode-server/data/Machine/settings.json' <<'settingsJSON'
[2804 ms]
[2804 ms]
[2804 ms] Start: Run in container: test -d /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[2806 ms]
[2806 ms]
[2806 ms] Exit code 1
[2807 ms] Installing VS Code Server for commit cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[2807 ms] Start: Run in container: mkdir -p /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d_1593105545145
[2811 ms]
[2811 ms]
[2812 ms] Start: Run: docker exec -i -u root -w /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d_1593105545145 f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 tar --no-same-owner -xz --strip-components 1
[5305 ms]
[5306 ms]
[5306 ms] Start: Run in container: mv -n /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d_1593105545145 /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[5317 ms]
[5317 ms]
[5317 ms] Start: Launching Remote-Containers helper.
[5318 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[5343 ms] Start: Run in container: gpgconf --list-dir agent-socket
[5348 ms] /root/.gnupg/S.gpg-agent
[5348 ms]
[5348 ms] Start: Run in container: mkdir -p -m 700 '/root/.gnupg'
[5356 ms]
[5356 ms]
[5356 ms] Start: Run in container: # Copy /Users/zed/.gitconfig to /root/.gitconfig
[5356 ms] Start: Run: gpgconf --list-dir homedir
[5369 ms]
[5369 ms]
[5369 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-f97cc7a21081e70e2303f2544443a16dbafee09f.js' >/tmp/vscode-remote-containers-f97cc7a21081e70e2303f2544443a16dbafee09f.js
[5382 ms]
[5382 ms]
[5382 ms] Start: Run in container: gpgconf --list-dir homedir
[5401 ms] /root/.gnupg
[5401 ms]
[5401 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global credential.helper '!f() { /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/node /tmp/vscode-remote-containers-f97cc7a21081e70e2303f2544443a16dbafee09f.js $*; }; f' || true
[5419 ms]
[5419 ms]
[5420 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-f97cc7a21081e70e2303f2544443a16dbafee09f.js' >/tmp/vscode-remote-containers-server-f97cc7a21081e70e2303f2544443a16dbafee09f.js
[5442 ms]
[5442 ms]
[5443 ms] Start: Run in container: # Copy /Users/zed/.gnupg/pubring.kbx to /root/.gnupg/pubring.kbx
[5445 ms] Start: Run: docker exec -i -u root -e REMOTE_CONTAINERS_SOCKETS=["/tmp/vscode-ssh-auth-f97cc7a21081e70e2303f2544443a16dbafee09f.sock","/root/.gnupg/S.gpg-agent"] -e REMOTE_CONTAINERS_IPC=/tmp/vscode-remote-containers-ipc-f97cc7a21081e70e2303f2544443a16dbafee09f.sock f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/node /tmp/vscode-remote-containers-server-f97cc7a21081e70e2303f2544443a16dbafee09f.js
[5482 ms]
[5482 ms]
[5482 ms] Start: Run in container: set -o noclobber ; mkdir -p '/root/.vscode-server/data/Machine' && { > '/root/.vscode-server/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[5494 ms]
[5494 ms]
[5494 ms] Start: Run in container: # Copy /Users/zed/.gnupg/trustdb.gpg to /root/.gnupg/trustdb.gpg
[5529 ms]
[5529 ms]
[5529 ms] Start: Run in container: test -d /root/.vscode-server/extensionsCache && ls /root/.vscode-server/extensionsCache || true
[5530 ms] Start: Run: gpg-connect-agent updatestartuptty /bye
[5536 ms]
[5536 ms]
[5539 ms] Start: Run in container: mkdir -p /root/.vscode-server/extensionsCache/tmp-1593105547877
[5553 ms]
[5553 ms]
[5553 ms] Start: Run: docker exec -i -u root -w /root/.vscode-server/extensionsCache/tmp-1593105547877 f11a0e8f78c28d23046be8ff36fa28a18bc2d1147d24bd04f3aac39f7d02cb49 tar x --strip-components 1
[6353 ms] Start: Run in container: mv /root/.vscode-server/extensionsCache/tmp-1593105547877/* /root/.vscode-server/extensionsCache && rmdir /root/.vscode-server/extensionsCache/tmp-1593105547877
[6393 ms]
[6394 ms]
[6394 ms] Start: Run in container: cd /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d; export VSCODE_AGENT_FOLDER=/root/.vscode-server; /root/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/server.sh --extensions-download-dir /root/.vscode-server/extensionsCache --install-extension vscjava.vscode-java-pack --install-extension pivotal.vscode-boot-dev-pack --install-extension github.vscode-pull-request-github --install-extension kumar-harsh.graphql-for-vscode --install-extension zxh404.vscode-proto3 --install-extension humao.rest-client --force
[6704 ms] Start: Run in container: ls /root/.vscode-server/extensionsCache
[6704 ms] Stdin closed!
[6706 ms] Shell server terminated (code: 137, signal: null)
[6747 ms] Remote-Containers server terminated (code: 137, signal: null).
I suspect the issue may lie in the extensions installation process, but I'm not entirely sure.
Anyway, I went from this combination of devcontainer.json + Dockerfile here (gist), to the combination of devcontainer.json + docker-compose.yaml + Dockerfile, that are here (another gist).
What could be causing the errors above? I'm really lost here as I don't see a reason.
Also, I suspect I need the runArgs from the initial version but they seem not to be supported when using docker-compose mode.
Thanks
Well, for any of you that end up here looking here, here's what I changed that did the trick:
On my docker-compose.yaml I added the following:
volumes:
# Make the first part whatever your working dir is
- ..:/workspace:cached
- "${HOME}/.ssh:/root/.ssh-localhost:ro"
command: /bin/sh -c "while sleep 1000; do :; done"
On the Dockerfile I added a CMD to the end as well:
CMD [ "sleep", "infinity" ]
Then, rebuild the image, and it should work.
Also, regarding the runArgs, I added this to my docker-compose.yaml file:
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
These additions/modifications should do the trick for you as well
This is the command I always use in any Dockerfile for VSCode:
# Keep container running (for use in VSCode)
CMD [ "tail", "-f", "/dev/null" ]

HyperLedger Fabric v1.4.4: Instantiating smart contract on mychannel with error

I am following the HyperLedger Fabric v1.4.4 "Writing Your First Application" tutorial[1], but I am having a problem running the code ./startFabric.sh javascript:
+ echo 'Instantiating smart contract on mychannel'
Instantiating smart contract on mychannel
+ docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l node -v 1.0 -c '{"Args":[]}' -P 'AND('\''Org1MSP.member'\'','\''Org2MSP.member'\'')' --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
2019-11-25 16:14:38.470 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-11-25 16:14:38.470 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/fabric-shim failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-11-25T16_17_00_000Z-debug.log
"
I think that error is related to the docker image, because it occurs when the following code is executed:
echo "Instantiating smart contract on mychannel"
docker exec \
-e CORE_PEER_LOCALMSPID=Org1MSP \
-e CORE_PEER_MSPCONFIGPATH=${ORG1_MSPCONFIGPATH} \
cli \
peer chaincode instantiate \
-o orderer.example.com:7050 \
-C mychannel \
-n fabcar \
-l "$CC_RUNTIME_LANGUAGE" \
-v 1.0 \
-c '{"Args":[]}' \
-P "AND('Org1MSP.member','Org2MSP.member')" \
--tls \
--cafile ${ORDERER_TLS_ROOTCERT_FILE} \
--peerAddresses peer0.org1.example.com:7051 \
--tlsRootCertFiles ${ORG1_TLS_ROOTCERT_FILE}
I don't know much about docker, but I'm learning. Until then, does anyone help me with this problem?
[1] https://hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html
Update 1
The same error was observed when I run ./byfn.sh up -l node, but no error for ./byfn.sh up. I think the error is connected to fabric-shim. I am still looking for an answer to this error.
The command to Instantiate the smart contract will be trying to start a new chaincode container, and this is failing because the new container cannot successfully run npm install commands.
The problem could be a Docker DNS issue, or an npm registry connection problem due to the country or company you are connecting from.
The following 2 previous answers should help you:
Network calls fail during image build on corporate network
Error while running fabcar sample in javascript

Install npm inside docker container Error: could not get uid/gid

I have the following docker running fine:
https://hub.docker.com/r/verdaccio/verdaccio
I want to install plugin inside the docker
https://www.npmjs.com/package/verdaccio-bitbucket
see all dockers:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d14f0fd7fd85 verdaccio/verdaccio "uid_entrypoint /bin…" 2 hours ago Up 2 hours 0.0.0.0:4873->4873/tcp
Connecting to the docker container:
[ec2-user#ip-9-9-11-67 ~]$ docker exec -it d14f0fd7fd85 /bin/sh
I run
/opt/verdaccio # npm install -g verdaccio-bitbucket
Get the following error
/opt/verdaccio # npm install -g verdaccio-bitbucket
Error: could not get uid/gid
[ 'nobody', 0 ]
at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:37:16
at ChildProcess.exithandler (child_process.js:301:5)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:77:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:173:20)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at process.emit (events.js:198:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
/opt/verdaccio # npm install -g verdaccio-bitbucket
Help...

docker: how to restart containers from files from /var/lib/docker/containers

I have updated my distro from 13.04 to 13.10 and had a bunch of running containers. the container files are still in /var/lib/docker/container however I can not start these:
$ sudo docker start 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
Error: No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
2014/03/25 05:18:14 Error: failed to start one or more containers
$ sudo tail /var/log/upstart/docker.log
2014/03/25 05:11:19 POST /v1.10/images/create?fromImage=7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65&tag=
[/var/lib/docker|5227412d] +job pull(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65, )
HTTP code: 404
[/var/lib/docker|5227412d] -job pull(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65, ) = ERR (1)
2014/03/25 05:18:14 POST /v1.10/containers/7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65/start
[/var/lib/docker|5227412d] +job start(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65)
No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
[/var/lib/docker|5227412d] -job start(7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65) = ERR (1)
[error] server.go:950 Error: No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
[error] server.go:85 HTTP Error: statusCode=404 No such container: 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
debug log from docker startup
[debug] runtime.go:300 Cannot load container 7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65 because it was created with another graph driver.
inspecting driver which this container was created with:
$ cd /var/lib/docker/containers/7ef2b26aa60d70d9167571dcc55502eee0c9f80ad7601bacc8a047ca1b28be65
$ cat ./config.json | grep -o Driver.*\",
Driver":"aufs","ExecDriver":"lxc-0.9.0",
is there any way to recover these?
Turns out after updating aufs was uninstalled. reinstalling like so:
sudo apt-get update
sudo apt-get install linux-image-extra-`uname -r`
fixes issue!

Resources