Debian sanity: bootstrap fails validating domain

Bug #1977887 reported by Andre Kantek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Andre Kantek

Bug Description

Issue seen in sanity

"TASK [bootstrap/validate-config : Check if the supplied address is a valid domain name or ip address] ***", "Tuesday 07 June 2022 03:17:29 +0000 (0:00:00.172) 0:00:42.814 ********** ", "changed: [localhost]", "", "TASK [bootstrap/validate-config : Fail if the supplied address is not a valid domain name or ip address] ***", "Tuesday 07 June 2022 03:17:31 +0000 (0:00:01.757) 0:00:44.571 ********** ", "fatal: [localhost]: FAILED! => changed=false ", " msg: tis-lab-registry.cumulus.wrs.com:9001/wrcp-staging/k8s.gcr.io is an invalid address.", "", "PLAY RECAP *********************************************************************"
Triage:

Issue network related; bootstrap fails something like this:
sysadmin@localhost:~$ python /tmp/a.py
Traceback (most recent call last):
  File "/tmp/a.py", line 2, in <module>
    from sysinv.common.utils import is_valid_domain_or_ip
  File "/usr/lib/python3/dist-packages/sysinv/common/utils.py", line 71, in <module>
    from eventlet.green import subprocess
  File "/usr/lib/python3/dist-packages/eventlet/_init_.py", line 10, in <module>
    from eventlet import convenience
  File "/usr/lib/python3/dist-packages/eventlet/convenience.py", line 7, in <module>
    from eventlet.green import socket
  File "/usr/lib/python3/dist-packages/eventlet/green/socket.py", line 21, in <module>
    from eventlet.support import greendns
  File "/usr/lib/python3/dist-packages/eventlet/support/greendns.py", line 411, in <module>
    resolver = ResolverProxy(hosts_resolver=HostsResolver())
  File "/usr/lib/python3/dist-packages/eventlet/support/greendns.py", line 325, in _init_
    self.clear()
  File "/usr/lib/python3/dist-packages/eventlet/support/greendns.py", line 328, in clear
    self._resolver = dns.resolver.Resolver(filename=self._filename)
  File "/usr/lib/python3/dist-packages/dns/resolver.py", line 695, in _init_
    self.read_resolv_conf(filename)
  File "/usr/lib/python3/dist-packages/dns/resolver.py", line 781, in read_resolv_conf
    raise NoResolverConfiguration
dns.resolver.NoResolverConfiguration: Resolver configuration could not be read or specified no nameservers.

There is no dns server in /etc/resolv.conf, even if one is configured in localhost.yml.
sysadmin@localhost:~$ cat /etc/resolv.conf
sysadmin@localhost:~$ cat localhost.yml

admin_password: Li69nux*
admin_username: admin
ansible_become_pass: Li69nux*
dns_servers:

10.20.2.1

This was also seen at the beginning of integration. Now https://review.opendev.org/c/starlingx/tools/+/844460 uncovered this issue again.

Andre Kantek (akantek)
Changed in starlingx:
assignee: nobody → Andre Kantek (akantek)
Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/c/starlingx/ansible-playbooks/+/845022
Committed: https://opendev.org/starlingx/ansible-playbooks/commit/8589ebb2a07745bea3f60d2cfdad5b3f68b7170e
Submitter: "Zuul (22348)"
Branch: master

commit 8589ebb2a07745bea3f60d2cfdad5b3f68b7170e
Author: Andre Fernando Zanella Kantek <email address hidden>
Date: Tue Jun 7 16:01:12 2022 -0300

    Move update of resolv.conf from persist-config to validate-config

    On python3, when importing eventlet.green library a
    verification is done on /etc/resolv.conf to have at least one valid
    nameserver. Since we are on a fresh install and the resolv.conf
    file is clean on the iso as part of
    https://review.opendev.org/c/starlingx/tools/+/844460
    It fails the execution

    It was attempted to solve the first error in
    bootstrap/validate-config/tasks/validate_address.yml with the task
    "Check if the supplied address is a valid domain name or ip address"
    to isolate the code inside sysinv as can be seen on the abandoned
    changes
    https://review.opendev.org/c/starlingx/config/+/845003
    https://review.opendev.org/c/starlingx/ansible-playbooks/+/845015

    But the problem was just postponed to
    bootstrap/store-passwd/tasks/main.yml on the task
    "Store admin password", and this one uses just python libraries.

    So we are just moving the update of resolv.conf from persist-config
    to validate-config as this will not change execution times for
    bootstrap execution and it works for both CentOS and Debian

    With the delivery of
    https://review.opendev.org/c/starlingx/config/+/843012 the task
    "Remove localhost address from resolv.conf" is no longer needed

    Test Plan:
    PASS execution of AIO-SX bootstrap for Debian
    PASS execution of AIO-SX bootstrap on CentOS

    Closes-Bug: 1977887

    Signed-off-by: Andre Fernando Zanella Kantek <email address hidden>
    Change-Id: I63e9dbaa82eb502d52b6f972c7944857e2547494

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.7.0 stx.debian stx.networking
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.