Skip to content

Crash building trivial config #6851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mausch opened this issue Jun 22, 2022 · 9 comments
Closed

Crash building trivial config #6851

mausch opened this issue Jun 22, 2022 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers info-needed Issue requires more information from poster

Comments

@mausch
Copy link

mausch commented Jun 22, 2022

  • VSCode Version: 1.68.1
  • Local OS Version: Windows 10
  • Remote OS Version: Local WSL I guess? I'm new to all this.
  • Remote Extension/Connection Type: WSL I guess?

Steps to Reproduce:

  1. I used the basic devcontainer builder on github codespaces, which generated these files:

Dockerfile:

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/typescript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT="18-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
#     && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node packages
# RUN su node -c "npm install -g <your-package-list -here>"

devcontainer.json:

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.236.0/containers/typescript-node
{
	"name": "Node.js & TypeScript",
	"build": {
		"dockerfile": "Dockerfile",
		// Update 'VARIANT' to pick a Node version: 18, 16, 14.
		// Append -bullseye or -buster to pin to an OS version.
		// Use -bullseye variants on local on arm64/Apple Silicon.
		"args": { 
			"VARIANT": "14"
		}
	},

	// Configure tool-specific properties.
	"customizations": {
		// Configure properties specific to VS Code.
		"vscode": {
			// Add the IDs of extensions you want installed when the container is created.
			"extensions": [
				"dbaeumer.vscode-eslint"
			]
		}
	},

	// 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": "yarn install",

	// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
	"remoteUser": "node",
	"features": {
		"git": "latest"
	}
}
  1. VScode then asks to build this, I say yes, then crashes with:
[4395 ms] Error: Command failed: docker build -f C:\Users\mauricio\AppData\Local\Temp\vsch\container-features\0.238.2-1655893673583\Dockerfile-with-features -t vsc-elevate.candidate.client-f27eaa45d1f24d77e4c28bac8b8546b0 --build-arg VARIANT=14 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=node --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp e:\elevate\elevate.candidate.client\.devcontainer
[4396 ms]     at jR (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:240:1143)
[4396 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[4397 ms]     at async Uu (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:239:2142)
[4397 ms]     at async Jy (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:239:1168)
[4398 ms]     at async zR (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:2006)
[4398 ms]     at async nb (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:3110)
[4399 ms]     at async JR (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:13046)
[4400 ms]     at async KR (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js:245:12802)
[4429 ms] Exit code 1
[4434 ms] Command failed: C:\Users\mauricio\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.238.2\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\mauricio\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder e:\elevate\elevate.candidate.client --workspace-mount-consistency cached --id-label devcontainer.local_folder=e:\elevate\elevate.candidate.client --log-level debug --log-format json --config e:\elevate\elevate.candidate.client\.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

This is worrying because:

  1. Config is trivial
  2. Error is obscure and unactionable.

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: If I disable all extensions I won't get the remote containers extension so how I am supposed to check this?

WSL and Docker work fine on this machine, I use this regularly for other things.

BTW I don't know if this is the right repo to report this, apologies if that's not the case.

Many thanks

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jun 22, 2022
@AlexandreOuellet
Copy link

I've got the same issue. At first glance, it appears to be an issue with permission, but it seems outside of our control.

A quick fix for now is removing the "features" section from the devcontainer.json. I'm guessing somebody is already working on it to fix it

@chrmarti
Copy link
Contributor

chrmarti commented Jul 5, 2022

Could you append the full log containing the error?

@chrmarti chrmarti self-assigned this Jul 5, 2022
@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jul 5, 2022
@AlexandreOuellet
Copy link

It appears to work correctly after a few hours of reporting the bug, and I can't reproduce it right now.

As far as I can remember, it seems to be related to when we tried to pull some docker image that would build the git feature. The docker image seemed to have been restricted for a few hours, which would fail the git feature part of the devcontainer.json (I'm guessing other features too, but I did not test it at the time).

@chrmarti
Copy link
Contributor

chrmarti commented Jul 6, 2022

Thanks, let us know when this occurs again. I'll look into improving the log message.

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Jul 6, 2022
@AlexandreOuellet
Copy link

In fact, it appers to be related to this issue #6819

Downgrading to the older version (0.234.0) fixes the issue, but I'm still not sure why...

@chrmarti
Copy link
Contributor

chrmarti commented Jul 8, 2022

Could you append the full log containing the error?

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jul 8, 2022
@github-actions
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@mausch
Copy link
Author

mausch commented Aug 3, 2022

Just upgraded VScode and the remote-containers extension to latest.
This is still crashing.

Full log:

[93 ms] Remote-Containers 0.241.3 in VS Code 1.69.2 (3b889b090b5ad5793f524b5d1d39fda662b96a2a).
[92 ms] Start: Resolving Remote
[131 ms] Setting up container for folder or workspace: e:\elevate\elevate.candidate.client
[138 ms] Start: Check Docker is running
[139 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[1334 ms] Server API version: 1.41
[1336 ms] Start: Run: docker volume ls -q
[1729 ms] Start: Run: docker ps -q -a --filter label=vsch.local.folder=e:\elevate\elevate.candidate.client --filter label=vsch.quality=stable
[1833 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=e:\elevate\elevate.candidate.client
[2148 ms] Start: Run: C:\Users\mauricio\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\mauricio\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder e:\elevate\elevate.candidate.client --workspace-mount-consistency cached --id-label devcontainer.local_folder=e:\elevate\elevate.candidate.client --log-level debug --log-format json --config e:\elevate\elevate.candidate.client\.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
[2345 ms] remote-containers 0.241.3.
[2345 ms] Start: Run: docker buildx version
[2626 ms] Start: Resolving Remote
[2628 ms] Start: Run: git rev-parse --show-cdup
[2672 ms] findLocalWindowsExecutable: Exectuable 'git' not found on PATH 'C:\telepresence;C:\Program Files\SSHFS-Win\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\dotnet\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Docker;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\OpenVPN\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\TortoiseGit\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Tailscale IPN;C:\Program Files (x86)\Bitvise SSH Client;C:\Program Files (x86)\Nmap;C:\Users\mauricio\.dotnet\tools;C:\Users\mauricio\AppData\Local\Programs\Fiddler;C:\Users\mauricio\AppData\Local\Microsoft\WindowsApps;C:\Users\mauricio\.dotnet\tools;C:\Users\mauricio\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Nmap;C:\Users\mauricio\.dotnet\tools;C:\Users\mauricio\AppData\Local\Programs\Fiddler;C:\Users\mauricio\AppData\Local\Microsoft\WindowsApps;C:\Users\mauricio\.dotnet\tools;C:\Users\mauricio\AppData\Local\Programs\Microsoft VS Code\bin;'.
[2676 ms] Start: Run: docker ps -q -a --filter label=devcontainer.local_folder=e:\elevate\elevate.candidate.client
[2968 ms] Preparing to parse declared features and fetch remote features.
[2968 ms] Detected local feature set. Continuing...
[2970 ms] local container features stored at: c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\node_modules\vscode-dev-containers\container-features
[2971 ms] Start: Run: tar --no-same-owner -x -f -
[3037 ms] Start: Run: docker build -t dev_container_feature_content_temp -f C:\Users\mauricio\AppData\Local\Temp\vsch\container-features\0.241.3-1659538810745\Dockerfile.buildContent C:\Users\mauricio\AppData\Local\Temp\vsch\container-features\0.241.3-1659538810745
Sending build context to Docker daemon 295.9 kB
Step 1/2 : FROM scratch
 --->
Step 2/2 : COPY . /tmp/build-features/
 ---> Using cache
 ---> e5ded56977a2
Successfully built e5ded56977a2
Successfully tagged dev_container_feature_content_temp:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Win
dows Docker host. All files and directories added to build context will have '-r
wxr-xr-x' permissions. It is recommended to double check and reset permissions f
or sensitive files and directories.
[3768 ms] Start: Run: docker build -f C:\Users\mauricio\AppData\Local\Temp\vsch\container-features\0.241.3-1659538810745\Dockerfile-with-features -t vsc-elevate.candidate.client-f27eaa45d1f24d77e4c28bac8b8546b0 --build-arg VARIANT=14 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp e:\elevate\elevate.candidate.client\.devcontainer
unable to prepare context: unable to get relative Dockerfile path: Rel: can't ma
ke C:\Users\mauricio\AppData\Local\Temp\vsch\container-features\0.241.3-16595388
10745\Dockerfile-with-features relative to E:\elevate\elevate.candidate.client\.
devcontainer
[3988 ms] Error: Command failed: docker build -f C:\Users\mauricio\AppData\Local\Temp\vsch\container-features\0.241.3-1659538810745\Dockerfile-with-features -t vsc-elevate.candidate.client-f27eaa45d1f24d77e4c28bac8b8546b0 --build-arg VARIANT=14 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp e:\elevate\elevate.candidate.client\.devcontainer
[3988 ms]     at GR (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:240:1436)
[3988 ms]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[3988 ms]     at async Hu (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:239:2796)
[3989 ms]     at async tb (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:239:1779)
[3989 ms]     at async QR (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:2006)
[3989 ms]     at async cb (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:3110)
[3989 ms]     at async i_ (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:13194)
[3989 ms]     at async n_ (c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js:245:12950)
[4003 ms] Exit code 1
[4008 ms] Command failed: C:\Users\mauricio\AppData\Local\Programs\Microsoft VS Code\Code.exe c:\Users\mauricio\.vscode\extensions\ms-vscode-remote.remote-containers-0.241.3\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\mauricio\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder e:\elevate\elevate.candidate.client --workspace-mount-consistency cached --id-label devcontainer.local_folder=e:\elevate\elevate.candidate.client --log-level debug --log-format json --config e:\elevate\elevate.candidate.client\.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
[4008 ms] Exit code 1

@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2022
@chrmarti
Copy link
Contributor

Apparently this is caused by the generated Dockerfile not being on the same drive as the context. Continuing in devcontainers/cli#240.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants