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.66k stars 288 forks source link

Unable to start devcontainer when code resides on google drive #8741

Open dss010101 opened 1 year ago

dss010101 commented 1 year ago

I have recently moved mostof my projects and code over to a google drive (which is mapped as the G: drive on my windows system).

When building and restarting my dev container in vscode, i am getting the below error. This does not happen if switch back to my original location for the code. Does anyone know what this error means and how to resolve?

[2023-07-15T21:00:31.101Z] Error response from daemon: failed to create task for container: failed to creat
e shim task: OCI runtime create failed: runc create failed: unable to start cont
ainer process: can't get final child's PID from pipe: EOF: unknown
[2023-07-15T21:00:31.223Z] Stop (1600 ms): Run: docker-compose --project-name tks_service_devcontainer -f g:\My Drive\Documents\Projects\tk_lab\tks_service\.devcontainer\docker-compose.yml -f c:\Users\tks0101\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data\docker-compose\docker-compose.devcontainer.build-1689454789995.yml -f c:\Users\tks0101\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data\docker-compose\docker-compose.devcontainer.containerFeatures-1689454829622.yml up -d
[2023-07-15T21:00:31.229Z] Error: Command failed: docker-compose --project-name tks_service_devcontainer -f g:\My Drive\Documents\Projects\tk_lab\tks_service\.devcontainer\docker-compose.yml -f c:\Users\tks0101\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data\docker-compose\docker-compose.devcontainer.build-1689454789995.yml -f c:\Users\tks0101\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data\docker-compose\docker-compose.devcontainer.containerFeatures-1689454829622.yml up -d
[2023-07-15T21:00:31.230Z]     at Tte (c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js:1972:3061)
[2023-07-15T21:00:31.230Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2023-07-15T21:00:31.230Z]     at async Pte (c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js:1954:3170)
[2023-07-15T21:00:31.231Z]     at async rre (c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js:2024:3833)
[2023-07-15T21:00:31.231Z]     at async Yf (c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js:2024:4775)
[2023-07-15T21:00:31.231Z]     at async Dne (c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js:2156:12193)
[2023-07-15T21:00:31.231Z]     at async Sne (c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js:2156:11934)
[2023-07-15T21:00:31.244Z] Stop (44742 ms): Run: C:\Program Files\Microsoft VS Code\Code.exe --ms-enable-electron-run-as-node c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\tks0101\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-3f362441-332a-422a-ab13-a7279c1674ce1689454783051 --workspace-folder g:\My Drive\Documents\Projects\tk_lab\tks_service --workspace-mount-consistency cached --id-label devcontainer.local_folder=g:\My Drive\Documents\Projects\tk_lab\tks_service --id-label devcontainer.config_file=g:\My Drive\Documents\Projects\tk_lab\tks_service\.devcontainer\devcontainer.json --log-level debug --log-format json --config g:\My Drive\Documents\Projects\tk_lab\tks_service\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --mount type=bind,source=\\wsl.localhost\Ubuntu\mnt\wslg\runtime-dir\wayland-0,target=/tmp/vscode-wayland-2dbfa161-730c-42c4-9b9d-2e8ba4f91894.sock --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2023-07-15T21:00:31.245Z] Exit code 1
[2023-07-15T21:00:31.248Z] Command failed: C:\Program Files\Microsoft VS Code\Code.exe --ms-enable-electron-run-as-node c:\Users\tks0101\.vscode\extensions\ms-vscode-remote.remote-containers-0.299.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\tks0101\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --container-session-data-folder /tmp/devcontainers-3f362441-332a-422a-ab13-a7279c1674ce1689454783051 --workspace-folder g:\My Drive\Documents\Projects\tk_lab\tks_service --workspace-mount-consistency cached --id-label devcontainer.local_folder=g:\My Drive\Documents\Projects\tk_lab\tks_service --id-label devcontainer.config_file=g:\My Drive\Documents\Projects\tk_lab\tks_service\.devcontainer\devcontainer.json --log-level debug --log-format json --config g:\My Drive\Documents\Projects\tk_lab\tks_service\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --mount type=bind,source=\\wsl.localhost\Ubuntu\mnt\wslg\runtime-dir\wayland-0,target=/tmp/vscode-wayland-2dbfa161-730c-42c4-9b9d-2e8ba4f91894.sock --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2023-07-15T21:00:31.248Z] Exit code 1

The docker-compose looks like this and the underlying docker image for ts_service is based on mcr.microsoft.com/devcontainers/python:3-bullseye

version: '3.8'

services:
  ts_service:
    container_name: ts_service
    image: ts_service
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    volumes:
      - ../..:/workspaces:cached

    command: sleep infinity
    shm_size: 0.94gb
    network_mode: service:tks_db

  tks_db:
    #image: timescale/timescaledb:latest-pg15
    image: postgres
    restart: unless-stopped
    volumes:
      - ../../database/postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: ******
      POSTGRES_DB: tks_db
      POSTGRES_PASSWORD: ************
    ports: 
      - 5001:5000
      - 5433:5432

I am developing on Windows 11, but my vscode dev container environment is debian based linux(mcr.microsoft.com/devcontainers/python:3-bullseye) running in desktop docker. As mentioned - this does not happen if the code resides on my systems native harddrive - only when the code is on a google drive map.

chrmarti commented 1 year ago

Similar error: https://github.com/moby/moby/issues/40835

dss010101 commented 3 weeks ago

Hi, i am coming back to this issue. i never solved it, instead simply copied by files locally to the 'c:' drive and it worked there. Put as i am relying on google drive as my main drive more and more, i would like to understand why this is happening.

My project structure without running in a devcontainer looks like this: Image

The docker-compose.yml looks like this:

networks:
  ai-net:
    driver: bridge

services:
  alpha_insite_app:
    container_name: alpha_insite_app
    image: alpha_insite_app
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    env_file:
      - ./.env      
    volumes:
      #- ../..:/workspaces:cached
      - ../..:/workspaces
      - ~/.ssh:/home/${USER_NAME}/.ssh

    command: sleep infinity
    shm_size: '2gb'

    ports: 
      - 8000:5000
    # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
    networks:
      - ai-net   

The problem is when i build and open the container - it builds fine and vs code does open into the built container fine, but the code/source is NOT mapped. all i see is this:

Image

I do see in the logs the following:


[6477 ms] Start: Run: docker inspect --type image alpha_insite_app
[6600 ms] Docker Compose override file for creating container:
services:
  'alpha_insite_app':
    entrypoint: ["/bin/sh", "-c", "echo Container started\n
trap \"exit 0\" 15\n
\n
exec \"$$@\"\n
while sleep 1 & wait $$!; do :; done", "-"]
    labels:
      - 'devcontainer.local_folder=g:\My Drive\Documents\Projects\stock-analysis\alpha_insite\alpha_insite_app'
      - 'devcontainer.config_file=g:\My Drive\Documents\Projects\stock-analysis\alpha_insite\alpha_insite_app\.devcontainer\devcontainer.json'
    volumes:
      - vscode:/vscode
volumes:

  vscode:
    external: true

but ththatt path is not being mounted it seems and so my source code is not available within the container. This was working at one point fine. no longer..

any help would be appreciated...