Incorrect handling of cached_hostset

Bug #1927698 reported by Andrey Pavlov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Nova Cloud Controller Charm
Fix Released
Medium
Alex Kavanagh

Bug Description

During lifecycle of nova-cloud-controller I have next stacktrace in its log

2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 Traceback (most recent call last):
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/cloud-compute-relation-changed", line 1402, in <module>
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 main()
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/cloud-compute-relation-changed", line 1394, in main
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 hooks.execute(sys.argv)
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/charmhelpers/core/hookenv.py", line 945, in execute
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 self._hooks[hook_name]()
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/cloud-compute-relation-changed", line 695, in cloud_compute_relation_changed
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 update_ssh_keys_and_notify_compute_units(rid=None, unit=None)
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/cloud-compute-relation-changed", line 740, in update_ssh_keys_and_notify_compute_units
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 update_ssh_key(rid=rid, unit=unit)
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/cloud-compute-relation-changed", line 853, in update_ssh_key
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 resolved_hosts = ncc_utils.resolve_hosts_for(private_address, hostname)
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/nova_cc_utils.py", line 1350, in resolve_hosts_for
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 return cached_hostset + hostname
2021-05-07 03:46:17 WARNING unit.nova-cloud-controller/0.cloud-compute-relation-changed logger.go:60 TypeError: can only concatenate list (not "str") to list

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

In order to help to diagnose the issue please could you provide:

1. a Juju bundle for the system + logs from the relevant services.

OR

2. Juju version
3. Ubuntu version
4. charms versions

Optionally a juju crashdump would be very useful. Thanks.

Changed in charm-nova-cloud-controller:
status: New → Incomplete
Revision history for this message
Andrey Pavlov (apavlov-e) wrote :
Revision history for this message
Andrey Pavlov (apavlov-e) wrote :
Revision history for this message
Andrey Pavlov (apavlov-e) wrote :
Revision history for this message
Andrey Pavlov (apavlov-e) wrote :

Please let me know what is juju crash dump and where it can be found.
Please let me know if something else is required.

Just a note - we started to catch this issue a week ago even if we have pinned charms in the bundle. And only in HA setups - All-In-One works well.
Attached bundle is from hybrid setup - OpenStack + K8s. but we also have seen same behaviour in pure OpenStack setup.

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Hi Andrey

Thanks for the additional info. I've now seen the bug in the code and will work on a fix.

juju crashdump is a useful tool that captures all the units/logs/etc. for a running juju model. It's in the snap store here: https://snapcraft.io/juju-crashdump

Changed in charm-nova-cloud-controller:
assignee: nobody → Alex Kavanagh (ajkavanagh)
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-cloud-controller (master)
Changed in charm-nova-cloud-controller:
status: Triaged → In Progress
Revision history for this message
Andrey Pavlov (apavlov-e) wrote :

Thank you Alex!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (master)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/790221
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/e63c68d505ee2eb88a0edef83c4a63a8d827f9f6
Submitter: "Zuul (22348)"
Branch: master

commit e63c68d505ee2eb88a0edef83c4a63a8d827f9f6
Author: Alex Kavanagh <email address hidden>
Date: Fri May 7 12:13:29 2021 +0100

    Fix bug where str is added to cached_hostset list

    The original code was appending a str to a list rather than either
    appending it or adding it as a list of one element. The code avoids
    append to avoid unintentional side-effects.

    Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
    Closes-Bug: #1927698

Changed in charm-nova-cloud-controller:
status: In Progress → Fix Committed
Felipe Reyes (freyes)
Changed in charm-nova-cloud-controller:
milestone: none → 22.04
Changed in charm-nova-cloud-controller:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-cloud-controller (stable/xena)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-cloud-controller (stable/wallaby)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-cloud-controller (stable/victoria)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-cloud-controller (stable/ussuri)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-nova-cloud-controller (stable/train)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/859920
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/91d721f8b2b7e04c29999be7215c9fea2c06af0f
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 91d721f8b2b7e04c29999be7215c9fea2c06af0f
Author: Alex Kavanagh <email address hidden>
Date: Fri May 7 12:13:29 2021 +0100

    Fix bug where str is added to cached_hostset list

    The original code was appending a str to a list rather than either
    appending it or adding it as a list of one element. The code avoids
    append to avoid unintentional side-effects.

    Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
    Closes-Bug: #1927698
    (cherry picked from commit e63c68d505ee2eb88a0edef83c4a63a8d827f9f6)

tags: added: in-stable-xena
tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/859921
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/2988a7f4a32e77abe85af30d7f04747da3461f9d
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 2988a7f4a32e77abe85af30d7f04747da3461f9d
Author: Alex Kavanagh <email address hidden>
Date: Fri May 7 12:13:29 2021 +0100

    Fix bug where str is added to cached_hostset list

    The original code was appending a str to a list rather than either
    appending it or adding it as a list of one element. The code avoids
    append to avoid unintentional side-effects.

    Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
    Closes-Bug: #1927698
    (cherry picked from commit e63c68d505ee2eb88a0edef83c4a63a8d827f9f6)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/859922
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/c2f00d81549e879b17d171b6c7dc98623f45e4c8
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit c2f00d81549e879b17d171b6c7dc98623f45e4c8
Author: Alex Kavanagh <email address hidden>
Date: Fri May 7 12:13:29 2021 +0100

    Fix bug where str is added to cached_hostset list

    The original code was appending a str to a list rather than either
    appending it or adding it as a list of one element. The code avoids
    append to avoid unintentional side-effects.

    Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
    Closes-Bug: #1927698
    (cherry picked from commit e63c68d505ee2eb88a0edef83c4a63a8d827f9f6)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/859923
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/2687b874fe08b4eab6b4a9e39d112c8d37f763a0
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 2687b874fe08b4eab6b4a9e39d112c8d37f763a0
Author: Alex Kavanagh <email address hidden>
Date: Fri May 7 12:13:29 2021 +0100

    Fix bug where str is added to cached_hostset list

    The original code was appending a str to a list rather than either
    appending it or adding it as a list of one element. The code avoids
    append to avoid unintentional side-effects.

    Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
    Closes-Bug: #1927698
    (cherry picked from commit e63c68d505ee2eb88a0edef83c4a63a8d827f9f6)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-nova-cloud-controller (stable/train)

Reviewed: https://review.opendev.org/c/openstack/charm-nova-cloud-controller/+/859924
Committed: https://opendev.org/openstack/charm-nova-cloud-controller/commit/dc6b82845d428fc0b5c94099d19b826bcdaa8099
Submitter: "Zuul (22348)"
Branch: stable/train

commit dc6b82845d428fc0b5c94099d19b826bcdaa8099
Author: Alex Kavanagh <email address hidden>
Date: Fri May 7 12:13:29 2021 +0100

    Fix bug where str is added to cached_hostset list

    The original code was appending a str to a list rather than either
    appending it or adding it as a list of one element. The code avoids
    append to avoid unintentional side-effects.

    Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
    Closes-Bug: #1927698
    (cherry picked from commit e63c68d505ee2eb88a0edef83c4a63a8d827f9f6)

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.