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.64k stars 285 forks source link

TypeError: Cannot read properties of undefined (reading 'matchAll') when trying to rebuild and open in container #7493

Closed ghost closed 1 year ago

ghost commented 1 year ago

Type: Bug

I'm trying to configure a container and having the following error (see complete log below) : TypeError: Cannot read properties of undefined (reading 'matchAll')

Error log ``` [2022-11-10T08:08:15.175Z] Dev Containers 0.263.0 in VS Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b). [2022-11-10T08:08:15.175Z] Start: Run: docker version --format {{.Server.APIVersion}} [2022-11-10T08:08:15.257Z] Stop (82 ms): Run: docker version --format {{.Server.APIVersion}} [2022-11-10T08:08:15.257Z] 1.41 [2022-11-10T08:08:15.397Z] Start: Run: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/julian/repo/Yocto/communication-interface-board-linux-image-1 --log-level debug --log-format json --config /home/julian/repo/Yocto/communication-interface-board-linux-image-1/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root true [2022-11-10T08:08:15.792Z] (node:38440) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. [2022-11-10T08:08:15.793Z] (Use `code --trace-deprecation ...` to show where the warning was created) [2022-11-10T08:08:15.780Z] @devcontainers/cli 0.23.2. Node.js v16.14.2. linux 6.0.7-arch1-1 x64. [2022-11-10T08:08:15.779Z] Start: Run: git rev-parse --show-cdup [2022-11-10T08:08:15.786Z] Stop (7 ms): Run: git rev-parse --show-cdup [2022-11-10T08:08:15.788Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/julian/repo/Yocto/communication-interface-board-linux-image-1 [2022-11-10T08:08:15.812Z] Stop (24 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=/home/julian/repo/Yocto/communication-interface-board-linux-image-1 [2022-11-10T08:08:15.820Z] * Processing feature: common [2022-11-10T08:08:15.820Z] (!) WARNING: Using the deprecated 'common' Feature. See https://github.com/devcontainers/features/tree/main/src/common-utils#example-usage for the updated Feature. [2022-11-10T08:08:16.392Z] * Fetching feature: common-utils_1_oci [2022-11-10T08:08:16.944Z] Start: Run: docker inspect --type image ubuntu:20.04 [2022-11-10T08:08:16.970Z] Stop (26 ms): Run: docker inspect --type image ubuntu:20.04 [2022-11-10T08:08:16.971Z] TypeError: Cannot read properties of undefined (reading 'matchAll') at bc (/home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js:1804:14180) at Lse (/home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js:1804:14678) at /home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js:1804:14229 at Array.map () at bc (/home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js:1804:14195) at wO (/home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js:1804:13470) at Vse (/home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js:1804:21055) at process.processTicksAndRejections (node:internal/process/task_queues:96:5) at async sue (/home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js:2013:31891) [2022-11-10T08:08:17.007Z] Stop (1610 ms): Run: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/julian/.vscode/extensions/ms-vscode-remote.remote-containers-0.263.0/dist/spec-node/devContainersSpecCLI.js read-configuration --workspace-folder /home/julian/repo/Yocto/communication-interface-board-linux-image-1 --log-level debug --log-format json --config /home/julian/repo/Yocto/communication-interface-board-linux-image-1/.devcontainer/devcontainer.json --include-merged-configuration --mount-workspace-git-root true [2022-11-10T08:08:17.007Z] Exit code 1 ```

I have the following settings:

Dockerfile ```Dockerfile ARG version=20.04 FROM ubuntu:$version # can be overwritten with e.g. docker build --build-arg UID=42 ARG UID=1000 ARG GID=1000 ARG USER=yocto ENV USER ${USER} ENV HOME /home/${USER} ENV UID ${UID} ENV GID ${GID} ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 ENV LC_ALL en_US.UTF-8 # use the IP address as hostnames can't be resolved at build time #ARG http_proxy=http://: #ARG https_proxy=https://: #ENV http_proxy ${http_proxy} #ENV https_proxy ${http_proxy} # Setup the proxy #RUN echo "Acquire::http::Proxy \"${http_proxy}\";" >/etc/apt/apt.conf.d/80proxy && \ # echo "Acquire::https::Proxy \"${https_proxy}\";" >>/etc/apt/apt.conf.d/80proxy ENV DEBIAN_FRONTEND=noninteractive ENV DEBCONF_NONINTERACTIVE_SEEN=true # Install the essential packages of # https://www.yoctoproject.org/docs/2.4/ref-manual/ref-manual.html#detailed-supported-distros RUN apt-get -qy update && \ apt-get -qy install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ bison flex bc \ rsync \ xz-utils debianutils iputils-ping # Add what we need additional to work with the image # screen is needed for bitbake -c devshell # libncurses-dev is needed for 'bitbake -c menuconfig virtual/kernel' RUN apt-get -qy install tzdata locales sudo nano vim screen libncurses-dev bmap-tools RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \ dpkg-reconfigure --frontend=noninteractive locales && \ update-locale LANG=en_US.UTF-8 && \ ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata && \ addgroup -gid ${GID} ${USER} && \ adduser --disabled-password --gecos "" --uid ${UID} --gid ${GID} --shell /usr/bin/bash ${USER} && \ mkdir -p /etc/sudoers.d/ && touch /etc/sudoers.d/${USER} && chmod 0755 /etc/sudoers.d && \ echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/${USER} # User management RUN usermod -a -G sudo ${USER} && \ usermod -a -G users ${USER} && \ usermod -a -G dialout ${USER} && \ usermod -u ${UID} ${USER} && \ groupmod -g ${GID} ${USER} RUN echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers RUN sed -i -e 's/HashKnownHosts yes/HashKnownHosts no/' /etc/ssh/ssh_config # Some tools we like to have when looking into issues RUN apt-get -qy install silversearcher-ag RUN pip3 install gitpython && \ mkdir -p ${HOME}/.ssh && \ chmod 775 ${HOME}/.ssh && \ mkdir -p ${HOME}/.cache/pip/http && \ ln -s /src/.bash_history ${HOME}/.bash_history && \ true ADD rootfs/home/.ssh/id_rsa ${HOME}/.ssh/ ADD rootfs/home/.ssh/id_rsa.pub ${HOME}/.ssh/ ADD rootfs/home/.ssh/known_hosts ${HOME}/.ssh/ RUN chmod 600 ${HOME}/.ssh/id_rsa RUN chmod 600 ${HOME}/.ssh/id_rsa.pub # Yocto requires bash instead of dash for /usr/bin RUN \ ln -s bash /bin/sh.bash && \ mv /bin/sh.bash /bin/sh && \ true RUN mkdir -p /src /src/msc-ldk-downloads /src/msc-ldk-sstate-cache && \ chown ${UID}:${GID} /src -R && \ chown ${UID}:${GID} ${HOME} -R && \ true RUN echo "if [ -e /src/.bashrc ]; then source /src/.bashrc; fi" >> ${HOME}/.bashrc # Add github.com to known hosts RUN ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts USER ${USER} WORKDIR /src ```
devcontainer.json ```json // For format details, see https://aka.ms/devcontainer.json. { "name": "Com Interface Board Build Environment", "build": { "dockerfile": "Dockerfile" }, // Set *default* container specific settings.json values on container create. "settings": { "terminal.integrated.profiles.linux": { "bash": { "path": "bash", "icon": "terminal-bash" } }, "terminal.integrated.defaultProfile.linux": "bash" }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ "eugenwiens.bitbake", "plorefice.devicetree", "mhutchie.git-graph", "yzhang.markdown-all-in-one" ], // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "yocto", "features": { "common": { "username": "automatic", "uid": "automatic", "gid": "automatic", "installZsh": true, "installOhMyZsh": true, "upgradePackages": false, "nonFreePackages": false } }, "remoteEnv": { "MSC_LDK_YOCTO_SSTATE_DIR": "/src/msc-ldk-sstate-cache", "MSC_LDK_YOCTO_DL_DIR": "/src/msc-ldk-downloads" }, // Mount /dev/bus/usb so USB can be used inside the docker "mounts": [ "type=bind,source=/dev/bus/usb,target=/dev/bus/usb", "type=bind,source=${localWorkspaceFolder},target=/src" ], "runArgs": [ // We are forced to run in privileged mode so we can bind mount usb "--privileged" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. // Add all folders to safe.directory list // See https://community.atlassian.com/t5/Bitbucket-questions/Unsafe-repository-REPO-is-owned-by-someone-else/qaq-p/2016432 "postCreateCommand": "git config --global --add safe.directory /workspaces/communication-interface-board-linux-image" } ```

⚠️ The issue disappears either when


Extension version: 0.263.0 (issue also occurs with release 0.262.0 version) VS Code version: Code 1.73.1 (6261075646f055b99068d3688932416f2346dd3b, 2022-11-09T03:54:53.913Z) OS version: Linux x64 6.0.7-arch1-1 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz (8 x 2265)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|1, 1, 1| |Memory (System)|23.18GB (17.38GB free)| |Process Argv|--unity-launch --crash-reporter-id 2fff6df5-0f2f-417c-9cf2-2d8bc08e2284| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|plasma| |XDG_CURRENT_DESKTOP|KDE| |XDG_SESSION_DESKTOP|KDE| |XDG_SESSION_TYPE|x11|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593:30376534 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 pyindex848:30577860 nodejswelcome1cf:30587006 fc301958:30595537 3biah626:30602489 gswce2:30605431 iaj6b796:30604794 dbltrim-noruby:30604474 ```
chrmarti commented 1 year ago

We need to support ENV without = between name and value.

chrmarti commented 1 year ago

This fix is available in Dev Containers 0.264.0-pre-release. Let me know if that fixes this issue for you. Thanks.

ridhwaans commented 1 year ago

Thanks for the fix

ghost commented 1 year ago

This fix is available in Dev Containers 0.264.0-pre-release. Let me know if that fixes this issue for you. Thanks.

Thanks, this fixes the issue for me !

aeschli commented 1 year ago

Verified that ENV without = works in v0.265.0