Skip to content

fix(devcontainer): drop stale vscode remoteUser - #14441

Open
NichSchlagen wants to merge 1 commit into
terrapkg:frawhidefrom
NichSchlagen:fix/devcontainer-remote-user
Open

fix(devcontainer): drop stale vscode remoteUser#14441
NichSchlagen wants to merge 1 commit into
terrapkg:frawhidefrom
NichSchlagen:fix/devcontainer-remote-user

Conversation

@NichSchlagen

Copy link
Copy Markdown
Contributor

Problem

Opening the repo in the dev container fails immediately:

Error: unable to find user vscode: no matching entries in passwd file
Error: An error occurred setting up the container.

The container itself starts fine; it breaks as soon as the Dev Containers CLI tries to open a shell as remoteUser.

Cause

The vscode user came from the ghcr.io/devcontainers/features/common-utils:2 feature. That feature was removed in cc4337c (#12805), but remoteUser and the usermod -a -G mock vscode onCreateCommand were left behind. ghcr.io/terrapkg/builder has no vscode user of its own:

$ podman run --rm ghcr.io/terrapkg/builder:frawhide grep -c vscode /etc/passwd
0

So the dev container has been broken for everyone since that commit.

Fix

Drop remoteUser and the onCreateCommand and run as root, which also makes the usermod into the mock group unnecessary. This matches how CI already builds packages with the very same image — GitHub Actions containers run as root, and mock works fine there (see .github/workflows/json-build.yml).

Re-adding the common-utils feature would be the alternative if an unprivileged user is wanted, but that seems to go against the intent of #12805.

Verification

With this change the container comes up, and a real package build inside it completes as root:

podman run --rm --privileged -v "$PWD":/workspace:z -w /workspace \
  ghcr.io/terrapkg/builder:frawhide bash -c 'anda build -c terra-rawhide-x86_64 ...'

The `vscode` user was created by the
`ghcr.io/devcontainers/features/common-utils:2` feature, which was
removed in cc4337c (terrapkg#12805). `remoteUser` and the `usermod -a -G mock
vscode` onCreateCommand were left behind, so the container now starts but
fails as soon as the Dev Containers CLI tries to open a shell:

    unable to find user vscode: no matching entries in passwd file

ghcr.io/terrapkg/builder has no `vscode` user, so run as root instead.
This matches how CI already builds packages with the same image, where
mock works fine as root.
@Owen-sz
Owen-sz requested a review from nothingneko July 26, 2026 17:09
@nothingneko

Copy link
Copy Markdown
Member

do we want to allow this to run as root or not, @Owen-sz thoughts?

@madonuko

Copy link
Copy Markdown
Member

I don't see an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants