question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Features] installsAfter is ignored, if a version is given

See original GitHub issue

If I define an installsAfter in a devcontainer-feature.json like this:

"installsAfter": [
    "ghcr.io/devcontainers/features/node"
]

It looks like this is honored, if I define the feature exactly like that

// Works
"ghcr.io/devcontainers/features/node": {}

but not if I define it with a version instead, e.g.

// Doesn't work
"ghcr.io/devcontainers/features/node:1": {},

To reproduce that, e.g. have a look at this scenario.json https://github.com/NicoVIII/devcontainer-features/blob/main/test/pnpm/scenarios.json The first two testcases work as expected, the last one, where I defined the version, didn’t. You can look at that in the output of the GitHub Actions job (which is a bit crowded with all the docker output, but after a while you can see, that the first two scenarios succeeded, while the last one didn’t): https://github.com/NicoVIII/devcontainer-features/actions/runs/3399930614/jobs/5654000995#step:4:2058

Is this intended? I would have guessed, that installsAfter works for all versions, if I don’t define one in there.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
samruddhikhandalecommented, Nov 7, 2022

If I am understanding it correctly, then looks like the issue occurs for the version-bug scenario (It is using a versioned Node Feature (ie ghcr.io/devcontainers/features/node:1) - which should be allowed I believe).

The author expects the pnpm Feature to be installed after ghcr.io/devcontainers/features/node Feature because of 👇 (which makes sense to me)

...
// devcontainer-feature.json for pnpm feature
"installsAfter": [
    "ghcr.io/devcontainers/features/node"
]
...

I tried to repro with devcontainer features test ... command and the I can see that the Compute Order is incorrect in the logs.

[2357 ms] --- Computed order ----
[2357 ms] ./pnpm
[2357 ms] ghcr.io/devcontainers/features/node:1

@joshspicer Could this be a bug in the devcontainer features test command ?

I was able to successfully create a dev container as follows 👇 . The compute order was correct, so probably not a bug with installsAfter property? 🤔

// .devcontainer.json
{
	"image": "ubuntu:latest",
	"features": {
		"ghcr.io/devcontainers/features/node:1": {
			"version": "lts"
		},
		"ghcr.io/nicoviii/devcontainer-features/pnpm:1": {}
	}
}
0reactions
NicoVIIIcommented, Dec 9, 2022

I still have this problem and I don’t have it only in the CLI tests but also when I try to use the feature in VScode directly.

devcontainer.json

{
	"name": "Debian",
	"image": "mcr.microsoft.com/devcontainers/base:bullseye",
	"features": {
		"ghcr.io/devcontainers/features/node:1": {},
		"ghcr.io/NicoVIII/devcontainer-features/pnpm:1": {}
	}
}

Output:

Step 10/18 : RUN echo "_CONTAINER_USER_HOME=$(getent passwd root | cut -d: -f6)" >> /tmp/build-features/devcontainer-features.builtin.env && echo "_REMOTE_USER_HOME=$(getent passwd vscode | cut -d: -f6)" >> /tmp/build-features/devcontainer-features.builtin.env
[2022-12-09T06:35:59.031Z]  ---> Using cache
 ---> 5f9522ef9391
Step 11/18 : RUN cd /tmp/build-features/pnpm_2 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh
[2022-12-09T06:35:59.048Z]  ---> Running in c48c988d5f7b
[2022-12-09T06:35:59.267Z] ===========================================================================
Feature       : Pnpm
Description   : Installs pnpm, requires npm installed
Id            : ghcr.io/NicoVIII/devcontainer-features/pnpm
Version       : 1.0.0
Documentation : 
Options       :
    VERSION="latest"
===========================================================================
[2022-12-09T06:35:59.268Z] ./install.sh: 5: npm: not found
Try to install pnpm with version 'latest'
[2022-12-09T06:35:59.268Z] ERROR: Feature "Pnpm" (ghcr.io/NicoVIII/devcontainer-features/pnpm) failed to install!
[2022-12-09T06:35:59.454Z] The command '/bin/sh -c cd /tmp/build-features/pnpm_2 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh' returned a non-zero code: 127
[2022-12-09T06:35:59.458Z] Stop (13506 ms): Run: docker build --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/base:bullseye --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-test-67cea80c5a3bdd6cf76ac7afa2f531b4-features -f /tmp/devcontainercli-nico/container-features/0.25.2-1670567743115/Dockerfile.extended /home/nico/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
[2022-12-09T06:35:59.460Z] Error: Command failed: docker build --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/devcontainers/base:bullseye --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-test-67cea80c5a3bdd6cf76ac7afa2f531b4-features -f /tmp/devcontainercli-nico/container-features/0.25.2-1670567743115/Dockerfile.extended /home/nico/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
[2022-12-09T06:35:59.460Z]     at Aoe (/home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1893:1355)
[2022-12-09T06:35:59.461Z]     at uT (/home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1893:1291)
[2022-12-09T06:35:59.462Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-12-09T06:35:59.462Z]     at async Poe (/home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1899:2128)
[2022-12-09T06:35:59.463Z]     at async Zf (/home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:1899:3278)
[2022-12-09T06:35:59.464Z]     at async aue (/home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:2020:15276)
[2022-12-09T06:35:59.465Z]     at async oue (/home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js:2020:15030)
[2022-12-09T06:35:59.473Z] Stop (16590 ms): Run: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/nico/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/nico/Schreibtisch/test --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/nico/Schreibtisch/test --log-level debug --log-format json --config /home/nico/Schreibtisch/test/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-12-09T06:35:59.474Z] Exit code 1
[2022-12-09T06:35:59.478Z] Command failed: /opt/visual-studio-code/code --ms-enable-electron-run-as-node /home/nico/.vscode/extensions/ms-vscode-remote.remote-containers-0.266.1/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/nico/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /home/nico/Schreibtisch/test --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/nico/Schreibtisch/test --log-level debug --log-format json --config /home/nico/Schreibtisch/test/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-12-09T06:35:59.479Z] Exit code 1
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do Windows Feature Updates Ignore the After ...
Windows Feature Updates (e.g. 1903, 1909, 2004, 20H2) ignore the After Deployment 'do not reboot' option and restart the server anyway.
Read more >
global.json is ignored unless the SDK version is an exact ...
I've set up another environment on Linux with 2.1, 3.1, and 5.0 installed and can't repro it there either, except for when the...
Read more >
Features and functionality removed in Windows client
Feature Details and mitigation Support removed HomeGroup 1803 XPS Viewer 1803 Tile Data Layer To be replaced by the Tile Store. 1709
Read more >
How to get Wix to update a previously installed version of a ...
Now I need to update it, so I bumped up the version number but when I go to install the new program over...
Read more >
Authoring Tasks - Gradle User Manual
The “should run after” ordering rule is similar but less strict as it will be ignored in two situations. Firstly if using that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found