Ubuntu /etc/hosts fix bug

Bug #1862739 reported by Radosław Piliszek
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
High
Radosław Piliszek
Rocky
Fix Released
High
Radosław Piliszek
Stein
Fix Released
High
Radosław Piliszek
Train
Fix Released
High
Radosław Piliszek
Ussuri
Fix Released
High
Radosław Piliszek

Bug Description

As reported by devfaz and others, our Ubuntu fix was missed a bit:
https://github.com/noris-network/kolla-ansible/commit/3058f601c9b593b7455cc5a383c86270afe2cd26

ansible_nodename is not guaranteed to be fqdn.

Revision history for this message
Radosław Piliszek (yoctozepto) wrote :

MAAS does not do this - only install from the "live server" medium confirmed to add this entry.

summary: - MAAS (Ubuntu) /etc/hosts fix bug
+ Ubuntu /etc/hosts fix bug
description: updated
Revision history for this message
Radosław Piliszek (yoctozepto) wrote :

Ubuntu, unlike CentOS, keeps only hostname part in /etc/hostname and hence retrieved from `hostname` (nodename) is missing domain part.

Revision history for this message
Radosław Piliszek (yoctozepto) wrote :

Correction: both new MAAS and new Ubuntu server installer do this.

Revision history for this message
Radosław Piliszek (yoctozepto) wrote :
Revision history for this message
Radosław Piliszek (yoctozepto) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

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

Changed in kolla-ansible:
assignee: nobody → Radosław Piliszek (yoctozepto)
status: New → In Progress
Revision history for this message
Khawar Munir Abbasi (ekhawmu) wrote :

I am still facing same problem while installing stable train release AIO deployment. I applied above patch and re-run bootstrap-servers playbook.

Ubuntu 18.04 LTS
Linux kernel 4.15.0-88

here is my /etc/hosts

# BEGIN ANSIBLE GENERATED HOSTS
192.168.10.56 myhost
# END ANSIBLE GENERATED HOSTS
127.0.0.1 localhost

LOGS
cat /var/log/kolla/rabbitmq/startup_err
Protocol 'inet_tcp': register/listen error:

error is
RUNNING HANDLER [rabbitmq : Waiting for rabbitmq to start on first node] ********************************************************************************************************************************************************************
fatal: [myhost]: FAILED! => {"changed": true, "cmd": "docker exec rabbitmq rabbitmqctl wait /var/lib/rabbitmq/mnesia/rabbitmq.pid", "delta": "0:00:00.373410", "end": "2020-02-25 16:45:11.801988", "msg": "non-zero return code", "rc": 137, "start": "2020-02-25 16:45:11.428578", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

Revision history for this message
Khawar Munir Abbasi (ekhawmu) wrote :

It gets fixed by enabling ipv6

disable ipv6 by adding the following to /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0

sysctl -p

Revision history for this message
Radosław Piliszek (yoctozepto) wrote :

Khawar, it's a different issue.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/707364
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=adbe115e39ef2320e2e1ab57f97d5191282951d7
Submitter: Zuul
Branch: master

commit adbe115e39ef2320e2e1ab57f97d5191282951d7
Author: Radosław Piliszek <email address hidden>
Date: Wed Feb 12 12:08:28 2020 +0100

    Use more permissive regex to remove the offending 127.0.1.1

    line from /etc/hosts

    Ubuntu always uses 127.0.1.1 for that with some tricky sauce
    around `hostname` depending on whether it contains '.' or not.
    And when I mean `hostname` it's the one returned by `hostname`
    command with no arguments.

    ansible_hostname is always a single word so we can match on that.

    I did not want to remove just any 127.0.1.1 in case someone
    is using it for other purposes. :-)

    Change-Id: I8bd3d42a5e3bd0f63336ed60a0af90d52b1650d6
    Closes-bug: #1862739

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/train)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/710127

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

Reviewed: https://review.opendev.org/710126
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=87a5063bd23e54a6fdad741790f1961f2ffb84fc
Submitter: Zuul
Branch: stable/train

commit 87a5063bd23e54a6fdad741790f1961f2ffb84fc
Author: Radosław Piliszek <email address hidden>
Date: Wed Feb 12 12:08:28 2020 +0100

    Use more permissive regex to remove the offending 127.0.1.1

    line from /etc/hosts

    Ubuntu always uses 127.0.1.1 for that with some tricky sauce
    around `hostname` depending on whether it contains '.' or not.
    And when I mean `hostname` it's the one returned by `hostname`
    command with no arguments.

    ansible_hostname is always a single word so we can match on that.

    I did not want to remove just any 127.0.1.1 in case someone
    is using it for other purposes. :-)

    Change-Id: I8bd3d42a5e3bd0f63336ed60a0af90d52b1650d6
    Closes-bug: #1862739
    (cherry picked from commit adbe115e39ef2320e2e1ab57f97d5191282951d7)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/stein)

Reviewed: https://review.opendev.org/710127
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=ac158d19f5d0b5085b8c2fb2ba17cebd164f6582
Submitter: Zuul
Branch: stable/stein

commit ac158d19f5d0b5085b8c2fb2ba17cebd164f6582
Author: Radosław Piliszek <email address hidden>
Date: Wed Feb 12 12:08:28 2020 +0100

    Use more permissive regex to remove the offending 127.0.1.1

    line from /etc/hosts

    Ubuntu always uses 127.0.1.1 for that with some tricky sauce
    around `hostname` depending on whether it contains '.' or not.
    And when I mean `hostname` it's the one returned by `hostname`
    command with no arguments.

    ansible_hostname is always a single word so we can match on that.

    I did not want to remove just any 127.0.1.1 in case someone
    is using it for other purposes. :-)

    Change-Id: I8bd3d42a5e3bd0f63336ed60a0af90d52b1650d6
    Closes-bug: #1862739
    (cherry picked from commit adbe115e39ef2320e2e1ab57f97d5191282951d7)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/711665

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/rocky)

Reviewed: https://review.opendev.org/711665
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=4a7b1dd726ed6015708f63838e470cd9f44e405b
Submitter: Zuul
Branch: stable/rocky

commit 4a7b1dd726ed6015708f63838e470cd9f44e405b
Author: Radosław Piliszek <email address hidden>
Date: Wed Feb 12 12:08:28 2020 +0100

    Use more permissive regex to remove the offending 127.0.1.1

    line from /etc/hosts

    Ubuntu always uses 127.0.1.1 for that with some tricky sauce
    around `hostname` depending on whether it contains '.' or not.
    And when I mean `hostname` it's the one returned by `hostname`
    command with no arguments.

    ansible_hostname is always a single word so we can match on that.

    I did not want to remove just any 127.0.1.1 in case someone
    is using it for other purposes. :-)

    Change-Id: I8bd3d42a5e3bd0f63336ed60a0af90d52b1650d6
    Closes-bug: #1862739
    (cherry picked from commit adbe115e39ef2320e2e1ab57f97d5191282951d7)
    (cherry picked from commit ac158d19f5d0b5085b8c2fb2ba17cebd164f6582)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 7.2.1

This issue was fixed in the openstack/kolla-ansible 7.2.1 release.

Revision history for this message
Lukas M (muhaha) wrote :

Vagrant populate /etc/hosts like https://github.com/hashicorp/vagrant/blob/master/lib/vagrant/util/guest_hosts.rb#L16, so maybe some generic fix would help that more than regexing 127.0.1.1

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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