make blockbox fails on CentOS

Bug #1816310 reported by Noel McLoughlin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LOCI
New
Undecided
Unassigned

Bug Description

The command `make blockbox` can fail in contrib/blockbox.
It worked on Ubuntu 18.04 (see #1815581) but consistently failed on CentOS:

```
  The command '/bin/sh -c /opt/loci/scripts/install.sh' returned a non-zero code: 1
                  make: *** [base] Error 1
              stdout:
                  docker build https://git.openstack.org/openstack/loci.git \
                   --build-arg PROJECT=cinder \
                   --build-arg FROM=centos:7 \
                   --build-arg PROJECT_REF=master \
                   --tag debian-cinder:latest
                  Sending build context to Docker daemon 250.9kB

                  Step 1/26 : ARG FROM=ubuntu:xenial
                  Step 2/26 : FROM ${FROM}
                  7: Pulling from library/centos
                  a02a4930cb5d: Pulling fs layer
                  a02a4930cb5d: Download complete
                  a02a4930cb5d: Pull complete
                  Digest: sha256:184e5f35598e333bfa7de10d8fb1cebb5ee4df5bc0f970bf2b1e7c7345136426
                  Status: Downloaded newer image for centos:7
                   ---> 1e1148e4cc2c
                  Step 3/26 : ENV PATH=/var/lib/openstack/bin:$PATH
                   ---> Running in f251a479b1f4
                  Removing intermediate container f251a479b1f4
                   ---> ea5dd140fc6e
                  Step 4/26 : ARG PROJECT
                   ---> Running in c9b5f5bcb6d2
                  Removing intermediate container c9b5f5bcb6d2
                   ---> e645f35066e8
                  Step 5/26 : ARG WHEELS=loci/requirements:master-ubuntu
                   ---> Running in c5591a391c16
                  Removing intermediate container c5591a391c16
                   ---> 7eefb2db8cd6
                  Step 6/26 : ARG PROJECT_REPO=https://git.openstack.org/openstack/${PROJECT}
                   ---> Running in 1c4ffb8b68a6
                  Removing intermediate container 1c4ffb8b68a6
                   ---> 79303fa7bc48
                  Step 7/26 : ARG PROJECT_REF=master
                   ---> Running in d72d7e855495
                  Removing intermediate container d72d7e855495
                   ---> b5246ca44fba
                  Step 8/26 : ARG DISTRO
                   ---> Running in 2b0152dff469
                  Removing intermediate container 2b0152dff469
                   ---> 61a9404f23c8
                  Step 9/26 : ARG PROFILES
                   ---> Running in 68bf940f2aa0
                  Removing intermediate container 68bf940f2aa0
                   ---> dbb1f3e7b0cc
                  Step 10/26 : ARG PIP_PACKAGES=""
                   ---> Running in 7cafb9d76843
                  Removing intermediate container 7cafb9d76843
                   ---> 7b9e11f53f2f
                  Step 11/26 : ARG PIP_ARGS=""
                   ---> Running in e46625a239bc
                  Removing intermediate container e46625a239bc
                   ---> dce293f86882
                  Step 12/26 : ARG PIP_WHEEL_ARGS=$PIP_ARGS
                   ---> Running in beb16116ba7d
                  Removing intermediate container beb16116ba7d
                   ---> 1855d7a232a9
                  Step 13/26 : ARG DIST_PACKAGES=""
                   ---> Running in eb8f572573cc
                  Removing intermediate container eb8f572573cc
                   ---> de684274d720
                  Step 14/26 : ARG PLUGIN=no
                   ---> Running in 0da837edccb1
                  Removing intermediate container 0da837edccb1
                   ---> c56634d7e0f4
                  Step 15/26 : ARG PYTHON3=no
                   ---> Running in 9f27713d4576
                  Removing intermediate container 9f27713d4576
                   ---> 1e7873b9544c
                  Step 16/26 : ARG EXTRA_BINDEP=""
                   ---> Running in 1643051e45a6
                  Removing intermediate container 1643051e45a6
                   ---> a92b0c4694d2
                  Step 17/26 : ARG EXTRA_PYDEP=""
                   ---> Running in a106c729f3d5
                  Removing intermediate container a106c729f3d5
                   ---> 0c2726ce6efc
                  Step 18/26 : ARG UID=42424
                   ---> Running in b5d69f7c78fc
                  Removing intermediate container b5d69f7c78fc
                   ---> 5c004ec16d9c
                  Step 19/26 : ARG GID=42424
                   ---> Running in a3e3b14fe58d
                  Removing intermediate container a3e3b14fe58d
                   ---> 10bfe58e93c7
                  Step 20/26 : ARG NOVNC_REPO=https://github.com/novnc/novnc
                   ---> Running in 13386469d2d4
                  Removing intermediate container 13386469d2d4
                   ---> c50c1b95d134
                  Step 21/26 : ARG NOVNC_REF=v1.0.0
                   ---> Running in a5b09a2647c4
                  Removing intermediate container a5b09a2647c4
                   ---> 5005e3b8632b
                  Step 22/26 : ARG SPICE_REPO=https://gitlab.freedesktop.org/spice/spice-html5.git
                   ---> Running in ffd93b26b8fb
                  Removing intermediate container ffd93b26b8fb
                   ---> 099ac0eff250
                  Step 23/26 : ARG SPICE_REF=spice-html5-0.1.6
                   ---> Running in d360f460eff6
                  Removing intermediate container d360f460eff6
                   ---> 915d2777c532
                  Step 24/26 : COPY scripts /opt/loci/scripts
                   ---> 72be9c3646e4
                  Step 25/26 : ADD bindep.txt pydep.txt $EXTRA_BINDEP $EXTRA_PYDEP /opt/loci/
                   ---> 56eb751d3f64
                  Step 26/26 : RUN /opt/loci/scripts/install.sh
                   ---> Running in 5cc0bb7ac0e8
                  ?[91m++ awk -F= '/^ID=/ {gsub(/\"/, "", $2); print $2}' /etc/centos-release /etc/os-release /etc/redhat-release /etc/system-release
                  ?[0m?[91m+ distro=centos
                  + export distro=centos
                  + distro=centos
                  + [[ no == \n\o ]]
                  + dpkg_python_packages=("python" "virtualenv")
                  + rpm_python_packages=("python" "python-virtualenv")
                  + case ${distro} in
                  + yum upgrade -y
                  ?[0mLoaded plugins: fastestmirror, ovl
                  Determining fastest mirrors
                  Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
                  14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
                  ?[91m

                   One of the configured repositories failed (Unknown),
                   and yum doesn't have enough cached data to continue. At this point the only
                   safe thing yum can do is fail. There are a few ways to work "fix" this:

                       1. Contact the upstream for the repository and get them to fix the problem.

                       2. Reconfigure the baseurl/etc. for the repository, to point to a working
                          upstream. This is most often useful if you are using a newer
                          distribution release than is supported by the repository (and the
                          packages for the previous distribution release still work).

                       3. Run the command with the repository temporarily disabled
                              yum --disablerepo=<repoid> ...

                       4. Disable the repository permanently, so yum won't use it by default. Yum
                          will then just ignore the repository until you permanently enable it
                          again or use --enablerepo for temporary usage:

                              yum-config-manager --disable <repoid>
                          or
                              subscription-manager repos --disable=<repoid>

                       5. Configure the failing repository to be skipped, if it is unavailable.
                          Note that yum will try to contact the repo. when it runs most commands,
                          so will have to try and fail each time (and thus. yum will be be much
                          slower). If it is a very temporary problem though, this is often a nice
                          compromise:

                              yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

                  Cannot find a valid baseurl for repo: base/7/x86_64
                  ?[0m
```

My solution was to update contrib/blockbox/docker-compose.yml with this-
```
services:
    dns:
        - 8.8.8.8 ##google public dns
        - 192.168.1.1 ##my home gateway
````

What is the best approach (i.e. solution) to prevent this problem for others?

Revision history for this message
Noel McLoughlin (noelmcloughlin) wrote :

Passing 'DOCKER_OPTS = "--dns 8.8.8.8 --dns 8.8.4.4"' should work - maybe it should be documented.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.