VS代码容器远程扩展:无法获取远程环境

时间:2020-01-04 10:10:39

标签: docker visual-studio-code archlinux

我对VS Code远程开发有问题。我正在使用docker容器隔离我的环境。这可以在我的主机上使用,但不能在我最近设置的笔记本电脑上使用。

笔记本电脑统计: Linux Thinkpad 5.4.7-arch1-1#1 SMP PREEMPT星期二,2019年12月31日17:20:16 +0000 x86_64 GNU / Linux

我已经安装了VS Code二进制文件的最新版本(不是开源版本)和用于远程开发的扩展。

现在,当我尝试在容器中打开一个预先存在的项目(在我的主机上可以工作)或尝试将其附加到运行中的容器时,我在vs代码中收到两个通知,而无法访问项目文件。

容器构建日志

[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
--------------------------

通知:

无法获取远程环境


无法连接到远程扩展主机服务器(错误:连接ECONNREFUSED :: 1:37469)

VS Code窗口日志:

[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

结果:VS Code Error State

我尝试过的步骤

  • 安装较旧版本的扩展程序以检查回归
  • 尝试与代码内部人员
  • 使用来自vs代码的模板创建一个新的容器文件

在这一点上,我认为我对该扩展如何进行进一步调试的了解甚少。如果您能指出我可以尝试的更多步骤,那就太好了。

谢谢

0 个答案:

没有答案