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

Error: EIO: i/o error, stat '/workspaces/repo' #6080

Open janegilring opened 2 years ago

janegilring commented 2 years ago

devcontainer.json:

{
    "name": "azure-management",
    "build": {
        "dockerfile": "Dockerfile",
    },

    // Set *default* container specific settings.json values on container create.
    "settings": {
        "terminal.integrated.shell.linux": "pwsh"
    },

    // Add the IDs of extensions you want installed when the container is created.
    // Note that some extensions may not work in Alpine Linux. See https://aka.ms/vscode-remote/linux.
    "extensions": ["ms-vscode.powershell","ms-vscode.azure-account","ms-dotnettools.dotnet-interactive-vscode","hashicorp.terraform"],

    // 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": "uname -a",

    "mounts": ["source=${localEnv:USERPROFILE}//.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached","source=c://git//repos,target=/workspaces/repos,type=bind,consistency=cached"],

    // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
    "remoteUser": "vscode"
}

Dockerfile:

FROM mcr.microsoft.com/powershell:7.2.1-ubuntu-focal

RUN apt-get update && apt-get -y upgrade

RUN apt-get update && apt-get install -y \
    wget \
    unzip \
    ca-certificates \
    apt-transport-https \
    lsb-release \
    gnupg \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Prerequisite for .NET Interactive Notebooks: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode
# https://docs.microsoft.com/en-gb/dotnet/core/install/linux-ubuntu#2004-
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && dpkg -i packages-microsoft-prod.deb && rm packages-microsoft-prod.deb
RUN apt-get update && apt-get install -y dotnet-sdk-6.0

# Switch to non-root user:
RUN useradd --create-home vscode
WORKDIR /home/vscode
USER vscode

Steps to Reproduce:

  1. Re-open a folder in a dev container based on the above devcontainer.json and Dockerfile
  2. Try to open a file from a mounted directory under /workspaces, either the custom bind mount or the auto mount point for the directory/repo being re-opened in the container
  3. The following pops up: "Error: EIO: i/o error, stat '/workspaces/repos/test.txt'"

Does this issue occur when you try this locally?: N/A Does this issue occur when you try this locally and all extensions are disabled?: N/A

I have tried to reproduce on another machine with the same versions as listed above, and I can`t seem to reproduce there. Hence, I am thinking it might be something related to the other machine - which has worked just fine with dev-containers up until now.

janegilring commented 2 years ago

After posting the issue I tried to simply reboot the machine. After doing so, the issue was gone and I could access mounted files and folders within all of the 3 dev-containers I had the issue within. Since it is not reproducible, we can close the issue.

Regardless, it would be interesting to know what could cause this problem. Any thoughts?

chrmarti commented 2 years ago

I can only guess at the moment: Docker Desktop has some kind of a filesystem adapter to allow mounting Windows folders in the Linux containers. Maybe that subsystem got in a bad state and rebooting got it back up. Next time try restarting only Docker Desktop to see if that fixes it before rebooting to narrow down the problem.

Closing for now, thanks.

chrmarti commented 7 months ago

Reopening in favor of https://github.com/microsoft/vscode-remote-release/issues/9585.

@arghhjayy mentioned seeing this on Windows 11 with Docker Desktop 4.27.2 (137060).

Could you open an issue for Docker Desktop for Windows to track this? Thanks.