Problem with dev image build - useradd: UID 0 is not unique

Hi,
get stucked on build openedx-dev (on Windows, but it seems to me no differ)
Already have tutor local quickstart with no production mode. Works fine. Then tutor local stop

tutor dev dc build lms
docker-compose -f C:\Users\***\AppData\Local\tutor\tutor\env\local\docker-compose.yml -f C:\Users\***\AppData\Local\tutor\tutor\env\dev\docker-compose.yml --project-name tutor_dev build lms
Building lms
[+] Building 5.6s (37/66)
 => [internal] load build definition from Dockerfile                                                               0.6s
 => => transferring dockerfile: 32B                                                                                0.1s
 => [internal] load .dockerignore                                                                                  0.8s
 => => transferring context: 2B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                    0.0s
 => [internal] load build context                                                                                  0.6s
 => => transferring context: 763B                                                                                  0.0s
 => [minimal 1/2] FROM docker.io/library/ubuntu:20.04                                                              0.0s
 => CACHED [minimal 2/2] RUN apt update &&     apt install -y build-essential curl git language-pack-en            0.0s
 => CACHED [production  1/27] RUN apt update &&     apt install -y gettext gfortran graphviz graphviz-dev libffi-  0.0s
 => CACHED [dockerize 1/1] RUN curl -L -o /tmp/dockerize.tar.gz https://github.com/jwilder/dockerize/releases/dow  0.0s
 => ERROR [production  2/27] RUN useradd --home-dir /openedx --create-home --shell /bin/bash --uid 0 app           3.0s
 => CACHED [code 1/8] RUN mkdir -p /openedx/edx-platform &&     git clone https://github.com/edx/edx-platform.git  0.0s
 => CACHED [code 2/8] WORKDIR /openedx/edx-platform                                                                0.0s
 => CACHED [code 3/8] RUN git config --global user.email "tutor@overhang.io"   && git config --global user.name "  0.0s
 => CACHED [code 4/8] RUN git fetch --depth=2 https://github.com/regisb/edx-platform 51e0ec3b97ae5badbf947d53ac07  0.0s
 => CACHED [code 5/8] RUN git fetch --depth=2 https://github.com/open-craft/edx-platform/ 03731f19459e558f188c06a  0.0s
 => CACHED [code 6/8] RUN git fetch --depth=2 https://github.com/overhangio/edx-platform/ 78da3d86b79e808462b88f2  0.0s
 => CACHED [code 7/8] RUN git fetch --depth=2 https://github.com/overhangio/edx-platform/ b63c01fb38a60f4581bdecb  0.0s
 => CACHED [code 8/8] RUN git fetch --depth=2 https://github.com/edx/edx-platform/ 85eb44445b8a6207b967bd4af5666e  0.1s
 => CACHED [locales 1/1] RUN cd /tmp     && curl -L -o openedx-i18n.tar.gz https://github.com/openedx/openedx-i18  0.0s
 => CACHED [python 1/4] RUN apt update &&     apt install -y libssl-dev zlib1g-dev libbz2-dev     libreadline-dev  0.0s
 => CACHED [python 2/4] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.2.2 --depth 1          0.0s
 => CACHED [python 3/4] RUN /opt/pyenv/bin/pyenv install 3.8.12                                                    0.0s
 => CACHED [python 4/4] RUN /opt/pyenv/versions/3.8.12/bin/python -m venv /openedx/venv                            0.0s
 => CACHED [python-requirements  1/10] RUN apt update && apt install -y software-properties-common libmysqlclient  0.0s
 => CACHED [python-requirements  2/10] COPY --from=code /openedx/edx-platform /openedx/edx-platform                0.0s
 => CACHED [python-requirements  3/10] WORKDIR /openedx/edx-platform                                               0.0s
 => CACHED [python-requirements  4/10] RUN pip install setuptools==44.1.0 pip==20.0.2 wheel==0.34.2                0.0s
 => CACHED [python-requirements  5/10] RUN pip install -r ./requirements/edx/base.txt                              0.0s
 => CACHED [python-requirements  6/10] RUN pip install django-redis==4.12.1                                        0.0s
 => CACHED [python-requirements  7/10] RUN pip install uwsgi==2.0.20                                               0.0s
 => CACHED [python-requirements  8/10] COPY ./requirements/ /openedx/requirements                                  0.0s
 => CACHED [python-requirements  9/10] RUN cd /openedx/requirements/   && touch ./private.txt   && pip install -r  0.0s
 => CACHED [python-requirements 10/10] RUN pip install 'openedx-scorm-xblock<14.0.0,>=13.0.0'                      0.0s
 => CACHED [nodejs-requirements 1/5] RUN pip install nodeenv==1.6.0                                                0.0s
 => CACHED [nodejs-requirements 2/5] RUN nodeenv /openedx/nodeenv --node=12.13.0 --prebuilt                        0.0s
 => CACHED [nodejs-requirements 3/5] COPY --from=code /openedx/edx-platform/package.json /openedx/edx-platform/pa  0.0s
 => CACHED [nodejs-requirements 4/5] WORKDIR /openedx/edx-platform                                                 0.0s
 => CACHED [nodejs-requirements 5/5] RUN npm install --verbose --registry=https://registry.npmjs.org/              0.0s
------
 > [production  2/27] RUN useradd --home-dir /openedx --create-home --shell /bin/bash --uid 0 app:
#7 2.317 useradd: UID 0 is not unique
------
executor failed running [/bin/sh -c useradd --home-dir /openedx --create-home --shell /bin/bash --uid ${APP_USER_ID} app]: exit code: 4
ERROR: Service 'lms' failed to build : Build failed
Error: Command failed with status 1: docker-compose -f C:\Users\***\AppData\Local\tutor\tutor\env\local\docker-compose.yml -f C:\Users\***\AppData\Local\tutor\tutor\env\dev\docker-compose.yml --project-name tutor_dev build lms

Looks like script tried to create root user, but it’s already created

What is the output of python -c "import os; print(os.getuid())"?

tutor local run lms bash
app@c0e88a822eaa:~/edx-platform$ python -c "import os; print(os.getuid())"
1000

Sorry no, I meant for you to run this command on the host, directly from the WSL :slight_smile:

There are some mess) WSL for Docker no need entry Linux distro. PowerShell get:

wsl --list
docker-desktop-data (default)
docker-desktop

Docker-desktop haven’t python and docker-desktop-data not connectable.
In Windows getuid don’t work

python -c "import os; print(os.getuid())"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'os' has no attribute 'getuid'

I can install any ubuntu to WSL and try to get uid from there, but don’t think that’s what you need

Hi, I run

python -c “import os; print(os.getuid())”

and result is 1000
What should I have to do next?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.