bootstrap-aio fails with 'dict object' has no attribute 'interface'

Bug #1851248 reported by James Denton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
James Denton

Bug Description

On certain systems, the bootstrap-aio.sh script may fail with the following error:

TASK [systemd_service : Create TEMP run dir] *************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "'dict object' has no attribute 'interface'"}

PLAY RECAP ***********************************************************************************************************************************
localhost : ok=103 changed=48 unreachable=0 failed=1 skipped=37 rescued=0 ignored=0

Running "ansible -c local -m setup localhost" and rerunning the script will resolve the issue.

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

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

Changed in openstack-ansible:
assignee: nobody → James Denton (james-denton)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.opendev.org/692837
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=9f9bfae7e6c15fd324a6473941c2780738e2c0b0
Submitter: Zuul
Branch: master

commit 9f9bfae7e6c15fd324a6473941c2780738e2c0b0
Author: James Denton <email address hidden>
Date: Mon Nov 4 15:01:47 2019 +0000

    Run setup module prior to bootstrapping aio

    On some systems, the aio bootstrap script will fail due to an issue with fact
    gathering. This patch runs the setup module prior to the bootstrap process.

    Reference: Eavesdrop IRC Logs - openstack-ansible.2018-11-23.log.html
    URL: https://pasted.tech/l/418bb8177f794d3f

    Change-Id: I52a7ebb946cc068013a0f7dbbc43989abf1cbd02
    Closes-Bug: #1851248

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

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

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

Reviewed: https://review.opendev.org/692962
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=1a1f093177438e125864390b00dd348245d03459
Submitter: Zuul
Branch: stable/train

commit 1a1f093177438e125864390b00dd348245d03459
Author: James Denton <email address hidden>
Date: Mon Nov 4 15:01:47 2019 +0000

    Run setup module prior to bootstrapping aio

    On some systems, the aio bootstrap script will fail due to an issue with fact
    gathering. This patch runs the setup module prior to the bootstrap process.

    Reference: Eavesdrop IRC Logs - openstack-ansible.2018-11-23.log.html
    URL: https://pasted.tech/l/418bb8177f794d3f

    Change-Id: I52a7ebb946cc068013a0f7dbbc43989abf1cbd02
    Closes-Bug: #1851248
    (cherry picked from commit 9f9bfae7e6c15fd324a6473941c2780738e2c0b0)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 20.0.0.0rc2

This issue was fixed in the openstack/openstack-ansible 20.0.0.0rc2 release candidate.

Revision history for this message
Sam Stoelinga (sammiestoel) wrote :

The fix didn't work for me. I just hit this issue in stable/ussuri and confirmed that the fix that was released was applied.

Revision history for this message
Sam Stoelinga (sammiestoel) wrote :

I'm running on Ubuntu 20.04

Revision history for this message
Sam Stoelinga (sammiestoel) wrote :

I had to run `scripts/bootstrap-aio.sh` a second time which fixed the issue.

Revision history for this message
Laszlo Laszlo (laszlolaszlo80) wrote :

I ran second time the 'scripts/bootstrap-aio.sh' but did not solve the issue on Ubuntu 20.04 and
root@aoi:/opt/openstack-ansible# git describe --abbrev=0 --tags
21.2.2

Revision history for this message
Laszlo Laszlo (laszlolaszlo80) wrote :

TASK [systemd_service : Create TEMP run dir] *********************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "'dict object' has no attribute 'interface'"}

Revision history for this message
Laszlo Laszlo (laszlolaszlo80) wrote :

/etc/ansible/roles/systemd_service/tasks/main.yml
- name: Create TEMP run dir
  file:
    path: "/var/run/{{ item.service_name | replace(' ', '_') }}"
    state: directory
    owner: "{{ item.systemd_user_name | default(systemd_user_name) }}"
    group: "{{ item.systemd_group_name | default(systemd_group_name) }}"
    mode: "02755"
  with_items: "{{ systemd_services }}"
  tags:
    - systemd-service

This task fail

Revision history for this message
Laszlo Laszlo (laszlolaszlo80) wrote :

I did not set default gateway on primary ethernet interface because I use proxy to connect to Internet. After I set gateway4 in netplan yml script ran fine. So you have to set default gateway.

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Please provide more wider output, because this role is included a lot of times and used throughout the project.
My guess would be that it's failing during this include https://opendev.org/openstack/openstack-ansible/src/branch/master/tests/roles/bootstrap-host/tasks/prepare_networking.yml#L183

And I can imagine this happening in case smth is weird with the host networking where you're trying to run AIO. For example, ansible_default_ipv4.interface is not defined and https://opendev.org/openstack/openstack-ansible/src/branch/master/tests/roles/bootstrap-host/defaults/main.yml#L108 may cause this error then.

You can try setting bootstrap_host_public_interface variable in user_variables.yml to the interface name you're using as a public interface.

I just tested this with clean ubuntu 20.04 VM and haven't faced any issues:
TASK [systemd_service : Create TEMP run dir] **********************************************************************************************************************************************************************************************************************************
changed: [localhost] => (item={'service_name': 'networking-post-up', 'config_overrides': {'Unit': {'Description': 'networking-post-up', 'After': 'network-online.target', 'Wants': 'network-online.target'}, 'Service': {'RemainAfterExit': True}}, 'service_type': 'oneshot', 'execstarts': ['-/sbin/iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE', '-/sbin/ethtool -K br-mgmt gso off sg off tso off tx off', '-/sbin/ethtool -K br-vxlan gso off sg off tso off tx off', '-/sbin/ethtool -K br-storage gso off sg off tso off tx off', '-/sbin/ethtool -K br-vlan gso off sg off tso off tx off', '-/sbin/ethtool -K br-dbaas gso off sg off tso off tx off', '-/sbin/ethtool -K br-lbaas gso off sg off tso off tx off', '-/sbin/ip link set eth12 up', '-/sbin/ip link set br-vlan-veth up', '-/sbin/ethtool -K eth12 gso off sg off tso off tx off', '-/sbin/ip link set eth13 up', '-/sbin/ip link set br-dbaas-veth up', '-/sbin/ethtool -K eth13 gso off sg off tso off tx off', '-/sbin/ip link set eth14 up', '-/sbin/ip link set br-lbaas-veth up', '-/sbin/ethtool -K eth14 gso off sg off tso off tx off'], 'execstops': ['/sbin/iptables -t nat -D POSTROUTING -o ens3 -j MASQUERADE'], 'enabled': True, 'state': 'started'})

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.