Skip to content

groupadd: GID '1000' already exists #531

Description

It looks like it is an error to set the GID to 1000 when installing the common-utils feature on a debian base in codespaces.
It's possible this is a codespaces issue... or maybe the base image includes a common-utils feature which creates a 1000 group. Once created the id isn't overridden in the codespaces devcontainer.json file that includes the feature.

https://github.com/devcontainers/images/blob/main/src/base-debian/.devcontainer/devcontainer.json#L7
https://github.com/devcontainers/features/blob/main/src/common-utils/main.sh#L362

I created the devcontainer.json below using the vscode wizard in github codespaces....
F1 -> Add Dev Container Configuration Files... -> Create new configuration -> Debian -> bullseye -> Common utilities -> meson -> bazel -> android sdk -> android sdk platform tools -> ok -> configure options -> emulator -> ok -> 33 -> 33.0.2 -> v1.15.0 -> nonFreePackages -> ok -> devcontainer -> 1000 -> 1000

2023-04-26 20:08:02.133Z: #17 0.515 ===========================================================================
#17 0.515 Feature       : Common Utilities
#17 0.515 Description   : Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.
#17 0.515 Id            : ghcr.io/devcontainers/features/common-utils
#17 0.515 Version       : 2.0.8
#17 0.515 Documentation : https://github.com/devcontainers/features/tree/main/src/common-utils
#17 0.515 Options       :
#17 0.515     INSTALLZSH="true"
#17 0.515     CONFIGUREZSHASDEFAULTSHELL="false"
#17 0.515     INSTALLOHMYZSH="true"
#17 0.515     UPGRADEPACKAGES="true"
#17 0.515     USERNAME="devcontainer"
#17 0.515     USERUID="1000"
#17 0.515     USERGID="1000"
#17 0.515     NONFREEPACKAGES="true"
2023-04-26 20:08:02.241Z: #17 0.522 ===========================================================================
#17 0.587 Marker file found:
#17 0.590     PACKAGES_ALREADY_INSTALLED=true
#17 0.590     LOCALE_ALREADY_SET=true
#17 0.590     EXISTING_NON_ROOT_USER=vscode
#17 0.590     RC_SNIPPET_ALREADY_ADDED=true
#17 0.590     ZSH_ALREADY_INSTALLED=true
#17 0.623 
2023-04-26 20:08:02.343Z: #17 0.629 ERROR: Feature "Common Utilities" (ghcr.io/devcontainers/features/common-utils) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/common-utils for help troubleshooting this error.
#17 ERROR: executor failed running [/bin/sh -c cp -ar /tmp/build-features-src/common-utils_1 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/common-utils_1  && cd /tmp/dev-container-features/common-utils_1  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/common-utils_1]: exit code: 4
------
 > [dev_containers_target_stage 5/9] RUN --mount=type=bind,from=dev_containers_feature_content_source,source=common-utils_1,target=/tmp/build-features-src/common-utils_1     cp -ar /tmp/build-features-src/common-utils_1 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/common-utils_1  && cd /tmp/dev-container-features/common-utils_1  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/common-utils_1:
#17 0.515     NONFREEPACKAGES="true"
#17 0.522 ===========================================================================
#17 0.587 Marker file found:
#17 0.590     PACKAGES_ALREADY_INSTALLED=true
#17 0.590     LOCALE_ALREADY_SET=true
#17 0.590     EXISTING_NON_ROOT_USER=vscode
#17 0.590     RC_SNIPPET_ALREADY_ADDED=true
#17 0.590     ZSH_ALREADY_INSTALLED=true
#17 0.623 groupadd: GID '1000' already exists
#17 0.629 ERROR: Feature "Common Utilities" (ghcr.io/devcontainers/features/common-utils) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/common-utils for help troubleshooting this error.
------
ERROR: failed to solve: executor failed running [/bin/sh -c cp -ar /tmp/build-features-src/common-utils_1 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/common-utils_1  && cd /tmp/dev-container-features/common-utils_1  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/common-utils_1]: exit code: 4
2023-04-26 20:08:02.346Z: Stop: Run: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.37.0-1682539652479 --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-codespaces-blank-6ddb1da97a62cb20a5a675bfb2d37ebadcb57a94646c29490eab9ebed016e64b-features -f /tmp/devcontainercli-root/container-features/0.37.0-1682539652479/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2023-04-26 20:08:02.359Z: {"outcome":"error","message":"Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.37.0-1682539652479 --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-codespaces-blank-6ddb1da97a62cb20a5a675bfb2d37ebadcb57a94646c29490eab9ebed016e64b-features -f /tmp/devcontainercli-root/container-features/0.37.0-1682539652479/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder","description":"An error occurred setting up the container."}
2023-04-26 20:08:02.385Z: Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.37.0-1682539652479 --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-codespaces-blank-6ddb1da97a62cb20a5a675bfb2d37ebadcb57a94646c29490eab9ebed016e64b-features -f /tmp/devcontainercli-root/container-features/0.37.0-1682539652479/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2023-04-26 20:08:02.388Z:     at wse (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1916:3264)
2023-04-26 20:08:02.390Z:     at K7 (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1916:3200)
2023-04-26 20:08:02.393Z:     at processTicksAndRejections (internal/process/task_queues.js:95:5)
2023-04-26 20:08:02.394Z:     at async Hse (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1931:2626)
2023-04-26 20:08:02.395Z:     at async Ch (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:1931:3741)
2023-04-26 20:08:02.397Z:     at async cae (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2059:17376)
2023-04-26 20:08:02.398Z:     at async uae (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2059:17117)
2023-04-26 20:08:02.399Z: devcontainer process exited with exit code 1

====================================== ERROR ====================================
2023-04-26 20:08:02.401Z: Failed to create container.
=================================================================================
2023-04-26 20:08:02.402Z: Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.37.0-1682539652479 --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-codespaces-blank-6ddb1da97a62cb20a5a675bfb2d37ebadcb57a94646c29490eab9ebed016e64b-features -f /tmp/devcontainercli-root/container-features/0.37.0-1682539652479/Dockerfile.extended /var/lib/docker/codespacemount/.persistedshare/empty-folder
2023-04-26 20:08:02.405Z: Error Code: 1302

====================================== ERROR ====================================
2023-04-26 20:08:02.419Z: Container creation failed.
=================================================================================
2023-04-26 20:08:02.431Z: 

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
	"name": "Debian",
	// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
	"image": "mcr.microsoft.com/devcontainers/base:bullseye",
	"features": {
		"ghcr.io/devcontainers/features/common-utils:2": {
			"installZsh": true,
			"installOhMyZsh": true,
			"upgradePackages": true,
			"nonFreePackages": true,
			"username": "devcontainer",
			"userUid": "1000",
			"userGid": "1000"
		},
		"ghcr.io/devcontainers-contrib/features/meson-asdf:2": {
			"version": "latest"
		},
		"ghcr.io/balazs23/devcontainers-features/bazel:1": {
			"bazelisk": "v1.15.0"
		},
		"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {},
		"ghcr.io/jarrodcolburn/features/android-sdk:0": {
			"emulator": true,
			"platforms": "33",
			"build-tools": "33.0.2"
		}
	}

	// Features to add to the dev container. More info: https://containers.dev/features.
	// "features": {},

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],

	// Configure tool-specific properties.
	// "customizations": {},

	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
	// "remoteUser": "root"
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions