Skip to content
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

Makefile error while installing robotoff #768

Closed
akashtadwai opened this issue May 17, 2022 · 3 comments · Fixed by #770
Closed

Makefile error while installing robotoff #768

akashtadwai opened this issue May 17, 2022 · 3 comments · Fixed by #770

Comments

@akashtadwai
Copy link
Contributor

What

ERROR: Network po_default declared as external, but could not be found. Please create the network manually using `docker network create po_default` and try again.
make: *** [Makefile:54: up] Error 1

Steps to reproduce the behavior:

  1. Follow the docs in dev install

Expected behavior

Robotoff installed without any errors.

Platform (Desktop, Mobile, Hunger Games)

  • OS: Ubuntu 20.04
  • Platform: Desktop
@akashtadwai
Copy link
Contributor Author

If I set external: false in docker/dev.yml as follows,

networks:
  # this links to the product opener dev environment on local machine
  po_local:
    name: ${PO_LOCAL_NET:-po_default}
    external: false

All seems to work fine but, finally I'm getting,

Error response from daemon: network with name po_default already exists
🥫 You should be able to access your local install of Robotoff at http://robotoff.openfoodfacts.localhost

I'm not able to access the robotoff site in the above URL .

Log

 ✘ akash@akash  ~/D/robotoff   master ⁝ ✱ 
 ❯ make dev                                                                                                 [23:37:57]
🥫 Welcome to the Robotoff dev environment setup!
🥫 Note that the first installation might take a while to run, depending on your machine specs.
🥫 Typical installation time on 8GB RAM, 4-core CPU, and decent network bandwith is about 2 min.
🥫 Thanks for contributing to Robotoff!

🥫 Building and starting containers …
docker-compose --env-file=.env up -d --build 2>&1
Creating network "po_default" with the default driver
Building scheduler
Sending build context to Docker daemon  19.02MB

Step 1/41 : FROM python:3.7-slim as python-base
 ---> f64cbb646dbd
Step 2/41 : RUN apt-get update &&     apt-get install --no-install-suggests --no-install-recommends -y gettext curl build-essential &&     apt-get autoremove --purge &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 7d1ee370237f
Step 3/41 : ENV PYTHONUNBUFFERED=1     PYTHONDONTWRITEBYTECODE=1     PIP_NO_CACHE_DIR=off     PIP_DISABLE_PIP_VERSION_CHECK=on     PIP_DEFAULT_TIMEOUT=100     PYSETUP_PATH="/opt/pysetup"     VENV_PATH="/opt/pysetup/.venv"     POETRY_HOME="/opt/poetry"     POETRY_VERSION=1.1.8     POETRY_VIRTUALENVS_IN_PROJECT=true     POETRY_NO_INTERACTION=1
 ---> Using cache
 ---> 80100555c014
Step 4/41 : ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
 ---> Using cache
 ---> c7562a7b3241
Step 5/41 : FROM python-base as builder-base
 ---> c7562a7b3241
Step 6/41 : RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 -
 ---> Using cache
 ---> a75e3b38fb5e
Step 7/41 : WORKDIR $PYSETUP_PATH
 ---> Using cache
 ---> 5d9f55bb5ba9
Step 8/41 : COPY poetry.lock  pyproject.toml poetry.toml ./
 ---> Using cache
 ---> 55ebb535237a
Step 9/41 : RUN poetry install --no-dev
 ---> Using cache
 ---> 69cb4e64a0d7
Step 10/41 : FROM python-base as runtime
 ---> c7562a7b3241
Step 11/41 : COPY --from=builder-base $VENV_PATH $VENV_PATH
 ---> Using cache
 ---> e88ab21db76b
Step 12/41 : COPY --from=builder-base $POETRY_HOME $POETRY_HOME
 ---> Using cache
 ---> fcc21e06384f
Step 13/41 : RUN poetry config virtualenvs.create false
 ---> Using cache
 ---> c90367aefb74
Step 14/41 : ENV POETRY_VIRTUALENVS_IN_PROJECT=false
 ---> Using cache
 ---> a439abb8943b
Step 15/41 : ARG OFF_UID=1000
 ---> Using cache
 ---> 0f11d89df61f
Step 16/41 : ARG OFF_GID=$OFF_UID
 ---> Using cache
 ---> e9cabed92a3e
Step 17/41 : RUN groupadd -g $OFF_GID off &&     useradd -u $OFF_UID -g off -m off
 ---> Using cache
 ---> 9130f6ab9c57
Step 18/41 : COPY --chown=off:off i18n /opt/robotoff/i18n
 ---> Using cache
 ---> 67d4519105c3
Step 19/41 : RUN cd /opt/robotoff/i18n &&     bash compile.sh &&     chown off:off -R /opt/robotoff/
 ---> Using cache
 ---> 410b1a9bb913
Step 20/41 : COPY --chown=off:off robotoff /opt/robotoff/robotoff/
 ---> Using cache
 ---> 53b7b5addd12
Step 21/41 : COPY --chown=off:off data /opt/robotoff/data
 ---> Using cache
 ---> f58fe7bb52eb
Step 22/41 : COPY --chown=off:off gunicorn.py /opt/robotoff/
 ---> Using cache
 ---> 856677b719d2
Step 23/41 : COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
 ---> Using cache
 ---> 971608d39f32
Step 24/41 : RUN chmod +x /docker-entrypoint.sh
 ---> Using cache
 ---> 1f5cb2b73ec5
Step 25/41 : COPY --chown=off:off poetry.lock pyproject.toml poetry.toml /opt/robotoff/
 ---> Using cache
 ---> b2927c294a0f
Step 26/41 : USER off
 ---> Using cache
 ---> 52a4e4278e87
Step 27/41 : WORKDIR /opt/robotoff
 ---> Using cache
 ---> ce38b90598a6
Step 28/41 : ENTRYPOINT /docker-entrypoint.sh $0 $@
 ---> Using cache
 ---> 2abbbdb072f5
Step 29/41 : CMD [ "gunicorn", "--config /opt/robotoff/gunicorn.py", "--log-file=-", "robotoff.app.api:api"]
 ---> Using cache
 ---> ecfa3605ebd2
Step 30/41 : FROM builder-base as builder-dev
 ---> 69cb4e64a0d7
Step 31/41 : WORKDIR $PYSETUP_PATH
 ---> Using cache
 ---> 39895fde3306
Step 32/41 : COPY poetry.lock  pyproject.toml poetry.toml ./
 ---> Using cache
 ---> 2bb978aa8fa5
Step 33/41 : RUN poetry install
 ---> Using cache
 ---> 6a9310e5b366
Step 34/41 : FROM runtime as runtime-dev
 ---> ecfa3605ebd2
Step 35/41 : COPY --from=builder-dev $VENV_PATH $VENV_PATH
 ---> Using cache
 ---> 206f38152087
Step 36/41 : COPY --from=builder-dev $POETRY_HOME $POETRY_HOME
 ---> Using cache
 ---> 5a9d0e7ed826
Step 37/41 : RUN true
 ---> Using cache
 ---> f590758d412c
Step 38/41 : COPY .flake8 pyproject.toml ./
 ---> Using cache
 ---> 64aa872f05d9
Step 39/41 : USER root
 ---> Using cache
 ---> 28c4b7262f3a
Step 40/41 : RUN     mkdir -p /opt/robotoff/gh_pages /opt/robotoff/doc /opt/robotoff/.cov &&     chown -R off:off /opt/robotoff/gh_pages /opt/robotoff/doc /opt/robotoff/.cov
 ---> Using cache
 ---> a8d3e2d6362d
Step 41/41 : USER off
 ---> Using cache
 ---> 46293558f220
Successfully built 46293558f220
Successfully tagged openfoodfacts/robotoff:dev
Building workers
Sending build context to Docker daemon  19.02MB

Step 1/41 : FROM python:3.7-slim as python-base
 ---> f64cbb646dbd
Step 2/41 : RUN apt-get update &&     apt-get install --no-install-suggests --no-install-recommends -y gettext curl build-essential &&     apt-get autoremove --purge &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 7d1ee370237f
Step 3/41 : ENV PYTHONUNBUFFERED=1     PYTHONDONTWRITEBYTECODE=1     PIP_NO_CACHE_DIR=off     PIP_DISABLE_PIP_VERSION_CHECK=on     PIP_DEFAULT_TIMEOUT=100     PYSETUP_PATH="/opt/pysetup"     VENV_PATH="/opt/pysetup/.venv"     POETRY_HOME="/opt/poetry"     POETRY_VERSION=1.1.8     POETRY_VIRTUALENVS_IN_PROJECT=true     POETRY_NO_INTERACTION=1
 ---> Using cache
 ---> 80100555c014
Step 4/41 : ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
 ---> Using cache
 ---> c7562a7b3241
Step 5/41 : FROM python-base as builder-base
 ---> c7562a7b3241
Step 6/41 : RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 -
 ---> Using cache
 ---> a75e3b38fb5e
Step 7/41 : WORKDIR $PYSETUP_PATH
 ---> Using cache
 ---> 5d9f55bb5ba9
Step 8/41 : COPY poetry.lock  pyproject.toml poetry.toml ./
 ---> Using cache
 ---> 55ebb535237a
Step 9/41 : RUN poetry install --no-dev
 ---> Using cache
 ---> 69cb4e64a0d7
Step 10/41 : FROM python-base as runtime
 ---> c7562a7b3241
Step 11/41 : COPY --from=builder-base $VENV_PATH $VENV_PATH
 ---> Using cache
 ---> e88ab21db76b
Step 12/41 : COPY --from=builder-base $POETRY_HOME $POETRY_HOME
 ---> Using cache
 ---> fcc21e06384f
Step 13/41 : RUN poetry config virtualenvs.create false
 ---> Using cache
 ---> c90367aefb74
Step 14/41 : ENV POETRY_VIRTUALENVS_IN_PROJECT=false
 ---> Using cache
 ---> a439abb8943b
Step 15/41 : ARG OFF_UID=1000
 ---> Using cache
 ---> 0f11d89df61f
Step 16/41 : ARG OFF_GID=$OFF_UID
 ---> Using cache
 ---> e9cabed92a3e
Step 17/41 : RUN groupadd -g $OFF_GID off &&     useradd -u $OFF_UID -g off -m off
 ---> Using cache
 ---> 9130f6ab9c57
Step 18/41 : COPY --chown=off:off i18n /opt/robotoff/i18n
 ---> Using cache
 ---> 67d4519105c3
Step 19/41 : RUN cd /opt/robotoff/i18n &&     bash compile.sh &&     chown off:off -R /opt/robotoff/
 ---> Using cache
 ---> 410b1a9bb913
Step 20/41 : COPY --chown=off:off robotoff /opt/robotoff/robotoff/
 ---> Using cache
 ---> 53b7b5addd12
Step 21/41 : COPY --chown=off:off data /opt/robotoff/data
 ---> Using cache
 ---> f58fe7bb52eb
Step 22/41 : COPY --chown=off:off gunicorn.py /opt/robotoff/
 ---> Using cache
 ---> 856677b719d2
Step 23/41 : COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
 ---> Using cache
 ---> 971608d39f32
Step 24/41 : RUN chmod +x /docker-entrypoint.sh
 ---> Using cache
 ---> 1f5cb2b73ec5
Step 25/41 : COPY --chown=off:off poetry.lock pyproject.toml poetry.toml /opt/robotoff/
 ---> Using cache
 ---> b2927c294a0f
Step 26/41 : USER off
 ---> Using cache
 ---> 52a4e4278e87
Step 27/41 : WORKDIR /opt/robotoff
 ---> Using cache
 ---> ce38b90598a6
Step 28/41 : ENTRYPOINT /docker-entrypoint.sh $0 $@
 ---> Using cache
 ---> 2abbbdb072f5
Step 29/41 : CMD [ "gunicorn", "--config /opt/robotoff/gunicorn.py", "--log-file=-", "robotoff.app.api:api"]
 ---> Using cache
 ---> ecfa3605ebd2
Step 30/41 : FROM builder-base as builder-dev
 ---> 69cb4e64a0d7
Step 31/41 : WORKDIR $PYSETUP_PATH
 ---> Using cache
 ---> 39895fde3306
Step 32/41 : COPY poetry.lock  pyproject.toml poetry.toml ./
 ---> Using cache
 ---> 2bb978aa8fa5
Step 33/41 : RUN poetry install
 ---> Using cache
 ---> 6a9310e5b366
Step 34/41 : FROM runtime as runtime-dev
 ---> ecfa3605ebd2
Step 35/41 : COPY --from=builder-dev $VENV_PATH $VENV_PATH
 ---> Using cache
 ---> 206f38152087
Step 36/41 : COPY --from=builder-dev $POETRY_HOME $POETRY_HOME
 ---> Using cache
 ---> 5a9d0e7ed826
Step 37/41 : RUN true
 ---> Using cache
 ---> f590758d412c
Step 38/41 : COPY .flake8 pyproject.toml ./
 ---> Using cache
 ---> 64aa872f05d9
Step 39/41 : USER root
 ---> Using cache
 ---> 28c4b7262f3a
Step 40/41 : RUN     mkdir -p /opt/robotoff/gh_pages /opt/robotoff/doc /opt/robotoff/.cov &&     chown -R off:off /opt/robotoff/gh_pages /opt/robotoff/doc /opt/robotoff/.cov
 ---> Using cache
 ---> a8d3e2d6362d
Step 41/41 : USER off
 ---> Using cache
 ---> 46293558f220
Successfully built 46293558f220
Successfully tagged openfoodfacts/robotoff:dev
Building api
Sending build context to Docker daemon  19.02MB

Step 1/41 : FROM python:3.7-slim as python-base
 ---> f64cbb646dbd
Step 2/41 : RUN apt-get update &&     apt-get install --no-install-suggests --no-install-recommends -y gettext curl build-essential &&     apt-get autoremove --purge &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 7d1ee370237f
Step 3/41 : ENV PYTHONUNBUFFERED=1     PYTHONDONTWRITEBYTECODE=1     PIP_NO_CACHE_DIR=off     PIP_DISABLE_PIP_VERSION_CHECK=on     PIP_DEFAULT_TIMEOUT=100     PYSETUP_PATH="/opt/pysetup"     VENV_PATH="/opt/pysetup/.venv"     POETRY_HOME="/opt/poetry"     POETRY_VERSION=1.1.8     POETRY_VIRTUALENVS_IN_PROJECT=true     POETRY_NO_INTERACTION=1
 ---> Using cache
 ---> 80100555c014
Step 4/41 : ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
 ---> Using cache
 ---> c7562a7b3241
Step 5/41 : FROM python-base as builder-base
 ---> c7562a7b3241
Step 6/41 : RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 -
 ---> Using cache
 ---> a75e3b38fb5e
Step 7/41 : WORKDIR $PYSETUP_PATH
 ---> Using cache
 ---> 5d9f55bb5ba9
Step 8/41 : COPY poetry.lock  pyproject.toml poetry.toml ./
 ---> Using cache
 ---> 55ebb535237a
Step 9/41 : RUN poetry install --no-dev
 ---> Using cache
 ---> 69cb4e64a0d7
Step 10/41 : FROM python-base as runtime
 ---> c7562a7b3241
Step 11/41 : COPY --from=builder-base $VENV_PATH $VENV_PATH
 ---> Using cache
 ---> e88ab21db76b
Step 12/41 : COPY --from=builder-base $POETRY_HOME $POETRY_HOME
 ---> Using cache
 ---> fcc21e06384f
Step 13/41 : RUN poetry config virtualenvs.create false
 ---> Using cache
 ---> c90367aefb74
Step 14/41 : ENV POETRY_VIRTUALENVS_IN_PROJECT=false
 ---> Using cache
 ---> a439abb8943b
Step 15/41 : ARG OFF_UID=1000
 ---> Using cache
 ---> 0f11d89df61f
Step 16/41 : ARG OFF_GID=$OFF_UID
 ---> Using cache
 ---> e9cabed92a3e
Step 17/41 : RUN groupadd -g $OFF_GID off &&     useradd -u $OFF_UID -g off -m off
 ---> Using cache
 ---> 9130f6ab9c57
Step 18/41 : COPY --chown=off:off i18n /opt/robotoff/i18n
 ---> Using cache
 ---> 67d4519105c3
Step 19/41 : RUN cd /opt/robotoff/i18n &&     bash compile.sh &&     chown off:off -R /opt/robotoff/
 ---> Using cache
 ---> 410b1a9bb913
Step 20/41 : COPY --chown=off:off robotoff /opt/robotoff/robotoff/
 ---> Using cache
 ---> 53b7b5addd12
Step 21/41 : COPY --chown=off:off data /opt/robotoff/data
 ---> Using cache
 ---> f58fe7bb52eb
Step 22/41 : COPY --chown=off:off gunicorn.py /opt/robotoff/
 ---> Using cache
 ---> 856677b719d2
Step 23/41 : COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
 ---> Using cache
 ---> 971608d39f32
Step 24/41 : RUN chmod +x /docker-entrypoint.sh
 ---> Using cache
 ---> 1f5cb2b73ec5
Step 25/41 : COPY --chown=off:off poetry.lock pyproject.toml poetry.toml /opt/robotoff/
 ---> Using cache
 ---> b2927c294a0f
Step 26/41 : USER off
 ---> Using cache
 ---> 52a4e4278e87
Step 27/41 : WORKDIR /opt/robotoff
 ---> Using cache
 ---> ce38b90598a6
Step 28/41 : ENTRYPOINT /docker-entrypoint.sh $0 $@
 ---> Using cache
 ---> 2abbbdb072f5
Step 29/41 : CMD [ "gunicorn", "--config /opt/robotoff/gunicorn.py", "--log-file=-", "robotoff.app.api:api"]
 ---> Using cache
 ---> ecfa3605ebd2
Step 30/41 : FROM builder-base as builder-dev
 ---> 69cb4e64a0d7
Step 31/41 : WORKDIR $PYSETUP_PATH
 ---> Using cache
 ---> 39895fde3306
Step 32/41 : COPY poetry.lock  pyproject.toml poetry.toml ./
 ---> Using cache
 ---> 2bb978aa8fa5
Step 33/41 : RUN poetry install
 ---> Using cache
 ---> 6a9310e5b366
Step 34/41 : FROM runtime as runtime-dev
 ---> ecfa3605ebd2
Step 35/41 : COPY --from=builder-dev $VENV_PATH $VENV_PATH
 ---> Using cache
 ---> 206f38152087
Step 36/41 : COPY --from=builder-dev $POETRY_HOME $POETRY_HOME
 ---> Using cache
 ---> 5a9d0e7ed826
Step 37/41 : RUN true
 ---> Using cache
 ---> f590758d412c
Step 38/41 : COPY .flake8 pyproject.toml ./
 ---> Using cache
 ---> 64aa872f05d9
Step 39/41 : USER root
 ---> Using cache
 ---> 28c4b7262f3a
Step 40/41 : RUN     mkdir -p /opt/robotoff/gh_pages /opt/robotoff/doc /opt/robotoff/.cov &&     chown -R off:off /opt/robotoff/gh_pages /opt/robotoff/doc /opt/robotoff/.cov
 ---> Using cache
 ---> a8d3e2d6362d
Step 41/41 : USER off
 ---> Using cache
 ---> 46293558f220
Successfully built 46293558f220
Successfully tagged openfoodfacts/robotoff:dev
Creating robotoff_scheduler_1     ... done
Creating robotoff_postgres_1      ... done
Creating robotoff_elasticsearch_1 ... done
Creating robotoff_workers_1       ... done
Creating robotoff_api_1           ... done
🥫 Creating external networks if needed … (dev only)
( docker network create po_default || true )
Error response from daemon: network with name po_default already exists
🥫 You should be able to access your local install of Robotoff at http://robotoff.openfoodfacts.localhost

@alexgarel
Copy link
Member

thanks for the report @akashtadwai we added the po_default network to be able to talk to openfoodfacts-server I would advise to maybe add something to Makefile to create the network if needed.

Are you on our slack ? https://slack.openfoodfacts.org/

@akashtadwai
Copy link
Contributor Author

Hey @alexgarel . I've tried creating the network by docker network create too. But still the build wasn't successful. Yes, I have joined slack yesterday.

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

Successfully merging a pull request may close this issue.

2 participants