vzarytovskii / haskell-dev-env

A Dockerfile for Haskell Development, and DevContainer for VSCode, for installing GHC HLS (Haskell Language Server) and the required plugins
MIT License
56 stars 17 forks source link

.devcontainer doesn't build #8

Closed hanjoosten closed 10 months ago

hanjoosten commented 2 years ago

Hi, I tried to use this .devcontainer, but it doesn't build. I tried it locally as well as online (using github codespace). Locally, I get some errormessage that says that the user vscode isn't there:

[2022-10-21T13:09:04.926Z] Dev Containers 0.255.4 in VS Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075).
[2022-10-21T13:09:04.926Z] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:05.129Z] Stop (203 ms): Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:05.156Z] Start: Resolving Remote
[2022-10-21T13:09:05.184Z] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:05.398Z] Stop (214 ms): Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:05.402Z] Start: Run: wsl -d Ubuntu-20.04 -e /bin/sh -c cd '/home/han/git/Ampersand' && /bin/sh
[2022-10-21T13:09:05.454Z] Start: Run in host: id -un
[2022-10-21T13:09:05.562Z] han
[2022-10-21T13:09:05.562Z] 
[2022-10-21T13:09:05.563Z] Stop (109 ms): Run in host: id -un
[2022-10-21T13:09:05.563Z] Start: Run in host: cat /etc/passwd
[2022-10-21T13:09:05.568Z] Stop (5 ms): Run in host: cat /etc/passwd
[2022-10-21T13:09:05.569Z] Start: Run in host: echo ~
[2022-10-21T13:09:05.571Z] /home/han
[2022-10-21T13:09:05.572Z] 
[2022-10-21T13:09:05.572Z] Stop (3 ms): Run in host: echo ~
[2022-10-21T13:09:05.573Z] Start: Run in host: test -x '/home/han/.vscode-remote-containers/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node'
[2022-10-21T13:09:05.576Z] 
[2022-10-21T13:09:05.577Z] 
[2022-10-21T13:09:05.577Z] Exit code 1
[2022-10-21T13:09:05.577Z] Stop (4 ms): Run in host: test -x '/home/han/.vscode-remote-containers/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node'
[2022-10-21T13:09:05.578Z] Start: Run in host: test -x '/home/han/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node'
[2022-10-21T13:09:05.579Z] 
[2022-10-21T13:09:05.579Z] 
[2022-10-21T13:09:05.580Z] Stop (2 ms): Run in host: test -x '/home/han/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node'
[2022-10-21T13:09:05.580Z] Start: Run in host: test -f '/home/han/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node_modules/node-pty/package.json'
[2022-10-21T13:09:05.582Z] 
[2022-10-21T13:09:05.583Z] 
[2022-10-21T13:09:05.583Z] Stop (3 ms): Run in host: test -f '/home/han/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node_modules/node-pty/package.json'
[2022-10-21T13:09:05.584Z] Start: Run in host: test -f '/home/han/.vscode-remote-containers/dist/vscode-remote-containers-server-0.255.4.js'
[2022-10-21T13:09:05.588Z] 
[2022-10-21T13:09:05.589Z] 
[2022-10-21T13:09:05.589Z] Stop (5 ms): Run in host: test -f '/home/han/.vscode-remote-containers/dist/vscode-remote-containers-server-0.255.4.js'
[2022-10-21T13:09:05.595Z] userEnvProbe: loginInteractiveShell (default)
[2022-10-21T13:09:05.596Z] userEnvProbe shell: /bin/bash
[2022-10-21T13:09:05.761Z] userEnvProbe PATHs:
Probe:     '/home/han/.local/bin:/home/han/.cabal/bin:/home/han/.ghcup/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Python38/Scripts/:/mnt/c/Python38/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/MiKTeX 2.9/miktex/bin/x64/:/mnt/d/Program Files/RedHat/java-1.8.0-openjdk-1.8.0.242-3/bin:/mnt/d/Program Files/RedHat/java-1.8.0-openjdk-1.8.0.242-3/jre/bin:/mnt/c/Program Files (x86)/Graphviz2.38/bin:/mnt/d/Program Files/graphviz-2.44.1-win32/Graphviz/bin:/mnt/d/xampp/php:/mnt/c/ProgramData/ComposerSetup/bin:/mnt/c/Program Files/nodejs/:/mnt/c/ProgramData/chocolatey/bin:/mnt/d/Program Files/PostgreSQL/12/bin:/mnt/d/ffmpeg-4.2.3-win64-static/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/PowerShell/7-preview/preview:/mnt/c/Program Files/PowerShell/7/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/d/Program Files (x86)/Elm/0.19.1/bin:/mnt/c/Users/hjo20125/.cargo/bin:/mnt/c/Users/hjo20125/AppData/Local/Microsoft/WindowsApps:/mnt/c/C:/Program Files (x86)/Graphviz2.38/bin/:/mnt/c/C:/Program Files/Git/usr/bin/:/mnt/c/Users/hjo20125/AppData/Roaming/Composer/vendor/bin:/mnt/c/Users/hjo20125/AppData/Roaming/npm:/mnt/c/Users/hjo20125/AppData/Roaming/cabal/bin:/mnt/c/ProgramData/chocolatey/lib/ghc/tools/ghc-8.10.2/bin:/mnt/c/ProgramData/chocolatey/lib/ghc/tools/ghc-8.6.5/bin:/mnt/c/Users/hjo20125/AppData/Roaming/local/bin:/mnt/c/Users/hjo20125/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/hjo20125/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/hjo20125/AppData/Local/gitkraken/bin:/mnt/c/tools/msys64:/mnt/d/ghcup/bin:/mnt/c/Users/hjo20125/AppData/Roaming/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin:/snap/bin:/home/han/.dotnet/tools'
Container: None
[2022-10-21T13:09:05.765Z] Setting up container for folder or workspace: /home/han/git/Ampersand
[2022-10-21T13:09:05.769Z] Start: Check Docker is running
[2022-10-21T13:09:05.769Z] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[2022-10-21T13:09:05.946Z] Stop (177 ms): Run in Host: docker version --format {{.Server.APIVersion}}
[2022-10-21T13:09:05.947Z] Server API version: 1.41
[2022-10-21T13:09:05.947Z] Stop (178 ms): Check Docker is running
[2022-10-21T13:09:05.949Z] Start: Run in Host: docker volume ls -q
[2022-10-21T13:09:06.125Z] Stop (176 ms): Run in Host: docker volume ls -q
[2022-10-21T13:09:06.144Z] Start: Run in Host: docker ps -q -a --filter label=vsch.local.folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand --filter label=vsch.quality=stable
[2022-10-21T13:09:06.292Z] Stop (148 ms): Run in Host: docker ps -q -a --filter label=vsch.local.folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand --filter label=vsch.quality=stable
[2022-10-21T13:09:06.292Z] Start: Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:06.443Z] Stop (151 ms): Run in Host: docker ps -q -a --filter label=devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:06.443Z] Start: Run in Host: docker inspect --type container 22e9973f25e8
[2022-10-21T13:09:06.577Z] Stop (134 ms): Run in Host: docker inspect --type container 22e9973f25e8
[2022-10-21T13:09:06.588Z] Start: Run in Host: /home/han/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node /home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/han/git/Ampersand --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand --log-level debug --log-format json --config /home/han/git/Ampersand/.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-10-21T13:09:07.034Z] (node:19009) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2022-10-21T13:09:07.035Z] (Use `node --trace-deprecation ...` to show where the warning was created)
[2022-10-21T13:09:07.042Z] @devcontainers/cli 0.20.0. Node.js v16.14.2. linux 5.10.102.1-microsoft-standard-WSL2 x64.
[2022-10-21T13:09:07.042Z] Start: Run: docker buildx version
[2022-10-21T13:09:07.293Z] Stop (251 ms): Run: docker buildx version
[2022-10-21T13:09:07.293Z] github.com/docker/buildx v0.9.1 ed00243a0ce2a0aee75311b06e32d33b44729689
[2022-10-21T13:09:07.294Z] 
[2022-10-21T13:09:07.294Z] Start: Resolving Remote
[2022-10-21T13:09:07.304Z] Start: Run: git rev-parse --show-cdup
[2022-10-21T13:09:07.310Z] Stop (6 ms): Run: git rev-parse --show-cdup
[2022-10-21T13:09:07.312Z] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:07.439Z] Stop (127 ms): Run: docker ps -q -a --filter label=devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:07.440Z] Start: Run: docker inspect --type container 22e9973f25e8
[2022-10-21T13:09:07.561Z] Stop (121 ms): Run: docker inspect --type container 22e9973f25e8
[2022-10-21T13:09:07.565Z] Start: Inspecting container
[2022-10-21T13:09:07.566Z] Start: Run: docker inspect --type container 22e9973f25e8ccc3641a2c2cc0d8652355b2f1534af34fc41e8ffa62d696088b
[2022-10-21T13:09:07.684Z] Stop (118 ms): Run: docker inspect --type container 22e9973f25e8ccc3641a2c2cc0d8652355b2f1534af34fc41e8ffa62d696088b
[2022-10-21T13:09:07.684Z] Stop (119 ms): Inspecting container
[2022-10-21T13:09:07.688Z] Start: Run in container: /bin/sh
[2022-10-21T13:09:07.694Z] Start: Run in container: uname -m
[2022-10-21T13:09:07.834Z] Stop (146 ms): Run in container: /bin/sh
[2022-10-21T13:09:07.837Z] Shell server terminated (code: 126, signal: null)
[2022-10-21T13:09:07.838Z] unable to find user vscode: no matching entries in passwd file

[2022-10-21T13:09:07.837Z] Start: Run in container: cat /etc/passwd
[2022-10-21T13:09:07.837Z] Stdin closed!
[2022-10-21T13:09:07.839Z] Error: An error occurred setting up the container.
[2022-10-21T13:09:07.839Z]     at Use (/home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js:1868:1339)
[2022-10-21T13:09:07.840Z]     at jO (/home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js:1868:1275)
[2022-10-21T13:09:07.840Z]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-10-21T13:09:07.840Z]     at async Xse (/home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js:1874:2030)
[2022-10-21T13:09:07.840Z]     at async Uf (/home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js:1874:3193)
[2022-10-21T13:09:07.840Z]     at async Cae (/home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js:1994:10350)
[2022-10-21T13:09:07.841Z]     at async yae (/home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js:1994:10104)
[2022-10-21T13:09:07.849Z] Stop (1261 ms): Run in Host: /home/han/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node /home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/han/git/Ampersand --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand --log-level debug --log-format json --config /home/han/git/Ampersand/.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-10-21T13:09:07.849Z] Exit code 1
[2022-10-21T13:09:07.856Z] Command failed: /home/han/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/node /home/han/.vscode-remote-containers/dist/dev-containers-cli-0.255.4/dist/spec-node/devContainersSpecCLI.js up --workspace-folder /home/han/git/Ampersand --workspace-mount-consistency cached --id-label devcontainer.local_folder=\\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand --log-level debug --log-format json --config /home/han/git/Ampersand/.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-10-21T13:09:07.856Z] Exit code 1
[2022-10-21T13:09:12.735Z] Start: Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
[2022-10-21T13:09:12.952Z] Stop (217 ms): Run: wsl -d Ubuntu-20.04 -e wslpath -u \\wsl.localhost\Ubuntu-20.04\home\han\git\Ampersand
vzarytovskii commented 2 years ago

It seems to be a vscode-remote issue. I'll look at it next week.

hanjoosten commented 2 years ago

Maybe related to https://github.com/microsoft/vscode-remote-release/issues/7377

hanjoosten commented 2 years ago

I have done some experimenting. It turns out that changing the version of ms-vscode-remote.remote-containers makes the difference. version 251.0 was the last one that was good, 255.2 and onwards yield the problem.

vzarytovskii commented 2 years ago

I have done some experimenting. It turns out that changing the version of ms-vscode-remote.remote-containers makes the difference. version 251.0 was the last one that was good, 255.2 and onwards yield the problem.

Huh, interesting, it seems it is indeed related to the issue you've posted above. I'll dig into it and see if I can workaround it.

vzarytovskii commented 10 months ago

Fix seems to be released in newer version of the devcontainers