[train] HostAddressOpt not accepting undercore in the hostnames ( allowed by RFC1033)

Bug #1892044 reported by Herve Beraud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.config
Fix Released
Undecided
Daniel Bengtsson

Bug Description

openstack services are failing to start when a hostname with underscord _ is provided

```
2020-08-14 15:42:35.813 8 ERROR nova During handling of the above exception, another exception occurred:
2020-08-14 15:42:35.813 8 ERROR nova
2020-08-14 15:42:35.813 8 ERROR nova Traceback (most recent call last):
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/bin/nova-compute", line 10, in <module>
2020-08-14 15:42:35.813 8 ERROR nova sys.exit(main())
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/nova/cmd/compute.py", line 59, in main
2020-08-14 15:42:35.813 8 ERROR nova service.wait()
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/nova/service.py", line 458, in wait
2020-08-14 15:42:35.813 8 ERROR nova _launcher.wait()
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/oslo_service/service.py", line 392, in wait
2020-08-14 15:42:35.813 8 ERROR nova status, signo = self._wait_for_exit_or_signal()
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/oslo_service/service.py", line 367, in _wait_for_exit_or_signal
2020-08-14 15:42:35.813 8 ERROR nova self.conf.log_opt_values(LOG, logging.DEBUG)
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/oslo_config/cfg.py", line 2589, in log_opt_values
2020-08-14 15:42:35.813 8 ERROR nova _sanitize(opt, getattr(group_attr, opt_name)))
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/oslo_config/cfg.py", line 3134, in __getattr__
2020-08-14 15:42:35.813 8 ERROR nova return self._conf._get(name, self._group)
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/oslo_config/cfg.py", line 2631, in _get
2020-08-14 15:42:35.813 8 ERROR nova value, loc = self._do_get(name, group, namespace)
2020-08-14 15:42:35.813 8 ERROR nova File "/usr/lib/python3.6/site-packages/oslo_config/cfg.py", line 2705, in _do_get
2020-08-14 15:42:35.813 8 ERROR nova raise ConfigFileValueError(message)
2020-08-14 15:42:35.813 8 ERROR nova oslo_config.cfg.ConfigFileValueError: Value for option live_migration_inbound_addr from LocationInfo(location=<Locations.user: (4, True)>, detail='/etc/nova/nova.conf') is not valid: overcloud-novacompute_edge1-0.internalapi.localdomain is not a valid host address
2020-08-14 15:42:35.813 8 ERROR nova

# podman exec -u 0 -ti nova_libvirt rpm -qa | grep oslo-config
python3-oslo-config-6.11.2-0.20200221150642.22c286c.el8ost.noarch

# grep overcloud-novacompute_edge1-0.internalapi.localdomain /etc/hosts
172.16.12.80 overcloud-novacompute_edge1-0.internalapi.localdomain overcloud-novacompute_edge1-0.internalapi

# grep overcloud-novacompute_edge1-0.internalapi.localdomain /etc/hosts
172.16.12.80 overcloud-novacompute_edge1-0.internalapi.localdomain overcloud-novacompute_edge1-0.internalapi
```

# How to reproduce
1. add a hostname with underscord in the config file, for example

/etc/nova/nova.conf
live_migration_inbound_addr = overcloud-novacompute_edge1-0.internalapi.localdomain

ensure hostname is in etc/hosts

2. restart the service

# Details

While a hostname may not contain other characters, such as the underscore character (_), other DNS names may contain the underscore.[1][2][3] This restriction was lifted by RFC 2181. Systems such as DomainKeys and service records use the underscore.

Within the RFC 1033 [3] the following characters are recommended for use in a host name (besides the dot separator):

"A-Z", "a-z", "0-9", dash and underscore

[1] http://domainkeys.sourceforge.net/underscore.html
[2] https://www.ietf.org/rfc/rfc1912.txt
[3] https://www.ietf.org/rfc/rfc1033.txt

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/746723

Changed in oslo.config:
assignee: nobody → Herve Beraud (herveberaud)
status: New → In Progress
Changed in oslo.config:
assignee: Herve Beraud (herveberaud) → Daniel Bengtsson (damani42)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (master)

Reviewed: https://review.opendev.org/746723
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75
Submitter: Zuul
Branch: master

commit 6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75
Author: Hervé Beraud <email address hidden>
Date: Tue Aug 18 15:30:04 2020 +0200

    Add a new type HostDomain.

    HostDomain is like HostAddress with the support of
    _ character - RFC1033

    openstack services are failing to start when a hostname with underscore
    _ is provided.

    Example:

    ```
    overcloud-novacompute_edge1-0.internalapi.localdomain
    overcloud-novacompute_edge1-0.internalapi
    ```

    Nova use `HostAddressOpt` to define `live_migration_inbound_addr`,
    and if a hostname with underscore is present in the config file
    then the service fail to start.

    Example:

    ```
    /etc/nova/nova.conf
    live_migration_inbound_addr =
    overcloud-novacompute_edge1-0.internalapi.localdomain
    ```

    FQDN is a domain name that specifies its exact
    location in the tree hierarchy of the Domain Name System (DNS).

    Underscore are allowed by RFC1033 [1][2][3]. Indeed, while a hostname may not
    contain other characters, such as the underscore character (_), other
    DNS names may contain the underscore.[1][2].
    Systems such as DomainKeys and service records use the underscore.

    These changes allow us to use underscore with the `HostDomain`.

    [1] https://www.ietf.org/rfc/rfc1912.txt
    [2] https://www.ietf.org/rfc/rfc1033.txt
    [3] http://domainkeys.sourceforge.net/underscore.html

    Co-authored-by: Daniel Bengtsson <email address hidden>
    Change-Id: I0a0670207f96a987996d329e5efa9a5eb2ce000c
    Closes-Bug: #1892044

Changed in oslo.config:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/759411

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (stable/victoria)

Reviewed: https://review.opendev.org/759411
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=f37bcc779347c9e0d1e37258a6d072b718edf7f7
Submitter: Zuul
Branch: stable/victoria

commit f37bcc779347c9e0d1e37258a6d072b718edf7f7
Author: Hervé Beraud <email address hidden>
Date: Tue Aug 18 15:30:04 2020 +0200

    Add a new type HostDomain.

    HostDomain is like HostAddress with the support of
    _ character - RFC1033

    openstack services are failing to start when a hostname with underscore
    _ is provided.

    Example:

    ```
    overcloud-novacompute_edge1-0.internalapi.localdomain
    overcloud-novacompute_edge1-0.internalapi
    ```

    Nova use `HostAddressOpt` to define `live_migration_inbound_addr`,
    and if a hostname with underscore is present in the config file
    then the service fail to start.

    Example:

    ```
    /etc/nova/nova.conf
    live_migration_inbound_addr =
    overcloud-novacompute_edge1-0.internalapi.localdomain
    ```

    FQDN is a domain name that specifies its exact
    location in the tree hierarchy of the Domain Name System (DNS).

    Underscore are allowed by RFC1033 [1][2][3]. Indeed, while a hostname may not
    contain other characters, such as the underscore character (_), other
    DNS names may contain the underscore.[1][2].
    Systems such as DomainKeys and service records use the underscore.

    These changes allow us to use underscore with the `HostDomain`.

    [1] https://www.ietf.org/rfc/rfc1912.txt
    [2] https://www.ietf.org/rfc/rfc1033.txt
    [3] http://domainkeys.sourceforge.net/underscore.html

    Co-authored-by: Daniel Bengtsson <email address hidden>
    Change-Id: I0a0670207f96a987996d329e5efa9a5eb2ce000c
    Closes-Bug: #1892044
    (cherry picked from commit 6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/761181

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (stable/ussuri)

Reviewed: https://review.opendev.org/761181
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=1fcb3e8acd3c229c74c87d80fd183cfc2432bace
Submitter: Zuul
Branch: stable/ussuri

commit 1fcb3e8acd3c229c74c87d80fd183cfc2432bace
Author: Hervé Beraud <email address hidden>
Date: Tue Aug 18 15:30:04 2020 +0200

    Add a new type HostDomain.

    HostDomain is like HostAddress with the support of
    _ character - RFC1033

    openstack services are failing to start when a hostname with underscore
    _ is provided.

    Example:

    ```
    overcloud-novacompute_edge1-0.internalapi.localdomain
    overcloud-novacompute_edge1-0.internalapi
    ```

    Nova use `HostAddressOpt` to define `live_migration_inbound_addr`,
    and if a hostname with underscore is present in the config file
    then the service fail to start.

    Example:

    ```
    /etc/nova/nova.conf
    live_migration_inbound_addr =
    overcloud-novacompute_edge1-0.internalapi.localdomain
    ```

    FQDN is a domain name that specifies its exact
    location in the tree hierarchy of the Domain Name System (DNS).

    Underscore are allowed by RFC1033 [1][2][3]. Indeed, while a hostname may not
    contain other characters, such as the underscore character (_), other
    DNS names may contain the underscore.[1][2].
    Systems such as DomainKeys and service records use the underscore.

    These changes allow us to use underscore with the `HostDomain`.

    [1] https://www.ietf.org/rfc/rfc1912.txt
    [2] https://www.ietf.org/rfc/rfc1033.txt
    [3] http://domainkeys.sourceforge.net/underscore.html

    Co-authored-by: Daniel Bengtsson <email address hidden>
    Change-Id: I0a0670207f96a987996d329e5efa9a5eb2ce000c
    Closes-Bug: #1892044
    (cherry picked from commit 6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75)
    (cherry picked from commit f37bcc779347c9e0d1e37258a6d072b718edf7f7)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.config (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/762112

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.config (stable/train)

Reviewed: https://review.opendev.org/762112
Committed: https://git.openstack.org/cgit/openstack/oslo.config/commit/?id=9b1ccea642f0769cb6c49bf814ddab62ca5d8180
Submitter: Zuul
Branch: stable/train

commit 9b1ccea642f0769cb6c49bf814ddab62ca5d8180
Author: Hervé Beraud <email address hidden>
Date: Tue Aug 18 15:30:04 2020 +0200

    Add a new type HostDomain.

    HostDomain is like HostAddress with the support of
    _ character - RFC1033

    openstack services are failing to start when a hostname with underscore
    _ is provided.

    Example:

    ```
    overcloud-novacompute_edge1-0.internalapi.localdomain
    overcloud-novacompute_edge1-0.internalapi
    ```

    Nova use `HostAddressOpt` to define `live_migration_inbound_addr`,
    and if a hostname with underscore is present in the config file
    then the service fail to start.

    Example:

    ```
    /etc/nova/nova.conf
    live_migration_inbound_addr =
    overcloud-novacompute_edge1-0.internalapi.localdomain
    ```

    FQDN is a domain name that specifies its exact
    location in the tree hierarchy of the Domain Name System (DNS).

    Underscore are allowed by RFC1033 [1][2][3]. Indeed, while a hostname may not
    contain other characters, such as the underscore character (_), other
    DNS names may contain the underscore.[1][2].
    Systems such as DomainKeys and service records use the underscore.

    These changes allow us to use underscore with the `HostDomain`.

    [1] https://www.ietf.org/rfc/rfc1912.txt
    [2] https://www.ietf.org/rfc/rfc1033.txt
    [3] http://domainkeys.sourceforge.net/underscore.html

    Co-authored-by: Daniel Bengtsson <email address hidden>
    Change-Id: I0a0670207f96a987996d329e5efa9a5eb2ce000c
    Closes-Bug: #1892044
    (cherry picked from commit 6480356928c9ae6169ea1e5a5b5f1df3d6e0dc75)
    (cherry picked from commit f37bcc779347c9e0d1e37258a6d072b718edf7f7)
    (cherry picked from commit 1fcb3e8acd3c229c74c87d80fd183cfc2432bace)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.config 8.4.0

This issue was fixed in the openstack/oslo.config 8.4.0 release.

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.