ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.87k stars 3.4k forks source link

docker-compose-build is failing with a "Couldn't resolve host name" #12462

Closed cdelgehier closed 2 years ago

cdelgehier commented 2 years ago

Please confirm the following

Bug Summary

I am trying to run an AWX locally to do my development. The problem seems the same as #12321 but this issue is closed without solution. I also asked on #ansible-awx without success.

The problem occurs on macos + minikube or on windows + WSL2

AWX version

21.2.0

Select the relevant components

Installation method

docker development environment

Modifications

no

Ansible version

ansible 6.0.0 and ansible-core 2.13.1

Operating system

MacOS and Windows

Web browser

Firefox

Steps to reproduce

ansible --version
ansible [core 2.13.1]
  config file = None
  configured module search path = ['/Users/cedricd/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/cedricd/venv/ansible/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/cedricd/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/cedricd/venv/ansible/bin/ansible
  python version = 3.9.13 (main, May 24 2022, 21:28:31) [Clang 13.1.6 (clang-1316.0.21.2)]
  jinja version = 3.0.1
  libyaml = True

 # minikube version
minikube version: v1.26.0
commit: f4b412861bb746be73053c9f6d2895f12cf78565

 # minikube ssh

$ docker version
Client:
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:50:40 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.6
  Git commit:       75249d8
  Built:            Fri Jul 30 19:55:09 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.1
  GitCommit:        4144b63817ebcc5b358fc2c8ef95f7cddd709aa7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Expected results

"make docker-compose" works

Actual results

 # git checkout  21.2.0
 # make docker-compose-build
ansible-playbook tools/ansible/dockerfile.yml -e build_dev=True -e receptor_image=quay.io/ansible/receptor:devel
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [Render AWX Dockerfile and sources] *********************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [dockerfile : Create _build directory] ******************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [dockerfile : Render supervisor configs] ****************************************************************************************************************************************************************************************************************
ok: [localhost] => (item=supervisor.conf)
ok: [localhost] => (item=supervisor_task.conf)

TASK [dockerfile : Render Dockerfile] ************************************************************************************************************************************************************************************************************************
ok: [localhost]

PLAY RECAP ***************************************************************************************************************************************************************************************************************************************************
localhost                  : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

DOCKER_BUILDKIT=1 docker build -t ghcr.io/ansible/awx_devel:HEAD \
        --build-arg BUILDKIT_INLINE_CACHE=1 \
        --cache-from=ghcr.io/ansible/awx_devel:HEAD .
[+] Building 2.6s (10/49)
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                     0.0s
 => => transferring dockerfile: 37B                                                                                                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                        0.0s
 => => transferring context: 34B                                                                                                                                                                                                                         0.0s
 => [internal] load metadata for quay.io/centos/centos:stream9                                                                                                                                                                                           1.3s
 => ERROR importing cache manifest from ghcr.io/ansible/awx_devel:HEAD                                                                                                                                                                                   0.5s
 => CACHED [builder 1/9] FROM quay.io/centos/centos:stream9@sha256:e2887d600f87b7fb4834f02a9aa183df87a0201328257064190844ef3865cf02                                                                                                                      0.0s
 => https://raw.githubusercontent.com/containers/libpod/master/contrib/podmanimage/stable/podman-containers.conf                                                                                                                                         0.6s
 => [internal] load build context                                                                                                                                                                                                                        0.0s
 => => transferring context: 1.31kB                                                                                                                                                                                                                      0.0s
 => https://raw.githubusercontent.com/containers/libpod/master/contrib/podmanimage/stable/containers.conf                                                                                                                                                0.6s
 => FROM quay.io/ansible/receptor:devel                                                                                                                                                                                                                  0.0s
 => ERROR [builder 2/9] RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' &&     dnf config-manager --set-enabled crb &&     dnf -y install     gcc     gcc-c++     git-core     gettext     glibc-langpack-en     libffi-devel     lib  0.7s
------
 > importing cache manifest from ghcr.io/ansible/awx_devel:HEAD:
------
------
 > [builder 2/9] RUN dnf -y update && dnf install -y 'dnf-command(config-manager)' &&     dnf config-manager --set-enabled crb &&     dnf -y install     gcc     gcc-c++     git-core     gettext     glibc-langpack-en     libffi-devel     libtool-ltdl-devel     make     nodejs     nss     openldap-devel     patch     postgresql     postgresql-devel     python3-devel     python3-pip     python3-psycopg2     python3-setuptools     swig     unzip     xmlsec1-devel     xmlsec1-openssl-devel:
#14 0.443 /bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
#14 0.548 Failed to set locale, defaulting to C.UTF-8
#14 0.665 CentOS Stream 9 - BaseOS                        0.0  B/s |   0  B     00:00
#14 0.666 Errors during downloading metadata for repository 'baseos':
#14 0.666   - Curl error (6): Couldn't resolve host name for https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http [getaddrinfo() thread failed to start]
#14 0.673 Error: Failed to download metadata for repo 'baseos': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http [getaddrinfo() thread failed to start]
------
executor failed running [/bin/sh -c dnf -y update && dnf install -y 'dnf-command(config-manager)' &&     dnf config-manager --set-enabled crb &&     dnf -y install     gcc     gcc-c++     git-core     gettext     glibc-langpack-en     libffi-devel     libtool-ltdl-devel     make     nodejs     nss     openldap-devel     patch     postgresql     postgresql-devel     python3-devel     python3-pip     python3-psycopg2     python3-setuptools     swig     unzip     xmlsec1-devel     xmlsec1-openssl-devel]: exit code: 1
make: *** [docker-compose-build] Error 1

Additional information

 # minikube ssh
$ curl -L 'https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http'
<?xml version="1.0" encoding="utf-8"?>
<metalink version="3.0" xmlns="http://www.metalinker.org/" type="dynamic" pubdate="Mon, 04 Jul 2022 20:22:20 GMT" generator="mirrormanager" xmlns:mm0="http://fedorahosted.org/mirrormanager">
 <files>
  <file name="repomd.xml">
   <mm0:timestamp>1656366878</mm0:timestamp>
   <size>3997</size>
   <verification>
    <hash type="md5">ff0f67f901b31b5ae7d85916e14b0a8a</hash>
    <hash type="sha1">bdc62120199f31adf50e04b38e8a486af2adcdab</hash>
    <hash type="sha256">e8c86ffeea212f952ece7ccd88f50dfe6c829fb47fce97b4e2d3eca39168e433</hash>
    <hash type="sha512">d4e650ef6b39755ab61cc4410cd2d445ae215bb42a8d73737deb6fbcfcfcd9e1120d51a0a2d6ad520b9526aa8dff04b71ba395a6f0ee3d7a759182ad1c2bd719</hash>
   </verification>
   <resources maxconnections="1">
    <url protocol="http" type="http" location="FR" preference="100">http://mirror.in2p3.fr/pub/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="FR" preference="100">https://mirror.in2p3.fr/pub/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="FR" preference="99">http://fr2.rpmfind.net/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="FR" preference="99">https://fr2.rpmfind.net/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="UA" preference="98">http://mirror.lanet.network/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="UA" preference="98">https://mirror.lanet.network/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="DE" preference="97">https://mirror1.hs-esslingen.de/pub/Mirrors/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="DE" preference="97">http://mirror1.hs-esslingen.de/pub/Mirrors/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="UA" preference="96">http://centos-stream.ip-connect.info/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="UA" preference="96">https://centos-stream.ip-connect.info/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="DE" preference="95">http://ftp.uni-bayreuth.de/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="DE" preference="95">https://ftp.uni-bayreuth.de/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="DK" preference="94">http://mirror.netsite.dk/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="DK" preference="94">https://mirror.netsite.dk/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="CZ" preference="93">http://mirror.karneval.cz/pub/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="CZ" preference="93">https://mirror.karneval.cz/pub/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="CZ" preference="92">http://ftp.fi.muni.cz/pub/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="CZ" preference="92">https://ftp.fi.muni.cz/pub/linux/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="IS" preference="91">http://centos.is/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="IS" preference="91">https://centos.is/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="AT" preference="90">http://mirror.alwyzon.net/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="AT" preference="90">https://mirror.alwyzon.net/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="DE" preference="89">http://ftp.plusline.net/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="DE" preference="89">https://ftp.plusline.net/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="NL" preference="88">http://mirror.mijn.host/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="NL" preference="88">https://mirror.mijn.host/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="NL" preference="87">http://centos-stream.mirror.wearetriple.com/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="NL" preference="87">https://centos-stream.mirror.wearetriple.com/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="LV" preference="86">http://centos-stream.koyanet.lv/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="LV" preference="86">https://centos-stream.koyanet.lv/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="DE" preference="85">https://mirror.netzwerge.de/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="DE" preference="85">http://mirror.netzwerge.de/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="CH" preference="84">http://linuxsoft.cern.ch/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="CH" preference="84">https://linuxsoft.cern.ch/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="AT" preference="83">http://mirror.im.jku.at/mirror/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="AT" preference="83">https://mirror.im.jku.at/mirror/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="RO" preference="82">http://mirrors.hostico.ro/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="RO" preference="82">https://mirrors.hostico.ro/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="IT" preference="81">http://it1.mirror.vhosting-it.com/centos-stream-all/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="IT" preference="81">https://it1.mirror.vhosting-it.com/centos-stream-all/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="IT" preference="80">http://it2.mirror.vhosting-it.com/centos-stream-all/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="IT" preference="80">https://it2.mirror.vhosting-it.com/centos-stream-all/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="RU" preference="79">http://ftp.nsc.ru/pub/centos-9/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="RU" preference="79">https://ftp.nsc.ru/pub/centos-9/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="MD" preference="78">http://mirror.mangohost.net/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="MD" preference="78">https://mirror.mangohost.net/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="DE" preference="77">https://mirror.scaleuptech.com/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="DE" preference="77">http://mirror.scaleuptech.com/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="GB" preference="76">http://lon.mirror.rackspace.com/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="GB" preference="76">https://lon.mirror.rackspace.com/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="http" type="http" location="SK" preference="75">http://ftp.upjs.sk/pub/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
    <url protocol="https" type="https" location="SK" preference="75">https://ftp.upjs.sk/pub/centos-stream/9-stream/BaseOS/x86_64/os/repodata/repomd.xml</url>
   </resources>
  </file>
 </files>
</metalink>
shanemcd commented 2 years ago

This doesn't seem like an issue with AWX. Have you tried restarting Docker?

cdelgehier commented 2 years ago

Yep sure, on my two computers...

sylvainle commented 2 years ago

I have the same issue with docker-compose install https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md (Ubuntu 22.04 LTS on WSL)

It's an ubuntu 22.04 LTS related issue (cannot access internet from containers)

iptables-legacy was replaced by iptables-nft in 22.04 LTS (https://github.com/docker/docker.github.io/issues/14963)

I switched from iptables-nft to iptables-legacy and it solved the issue

jtmelhorn commented 2 years ago

I got it working on WSL2 after installing Docker Desktop on Windows.

jbradberry commented 2 years ago

At this point it seems like this is an environment issue. Closing.

stfnifllr commented 1 year ago

@jbradberry If this problem is an environmental issue, what should be changed in the environment to solve the problem?

cdelgehier commented 1 year ago

@stfnifllr honestly i use operator on kube...this build never worked

BredoGen commented 1 year ago

@stfnifllr Had this issue on Ubuntu Server 20.04 LTS with docker version 20.10.5.

Upgrading docker to 23.0.4 resolved the issue.