Clustering can fail if leader does not present download url

Bug #1753980 reported by Liam Young on 2018-03-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Designate-Bind Charm
High
Liam Young

Bug Description

If a non-leader attempts to download a zone file but the leader has not yet presented a download url then the charm can fail with the following error:

09:32:06 2018-03-07 09:32:04 INFO juju-log cluster:6: Invoking reactive handler: reactive/designate_bind_handlers.py:68:update_zones_from_peer
09:32:06 2018-03-07 09:32:04 ERROR juju-log cluster:6: Hook error:
09:32:06 Traceback (most recent call last):
09:32:06 File "/usr/local/lib/python3.5/dist-packages/charms/reactive/__init__.py", line 72, in main
09:32:06 bus.dispatch(restricted=restricted_mode)
09:32:06 File "/usr/local/lib/python3.5/dist-packages/charms/reactive/bus.py", line 375, in dispatch
09:32:06 _invoke(other_handlers)
09:32:06 File "/usr/local/lib/python3.5/dist-packages/charms/reactive/bus.py", line 351, in _invoke
09:32:06 handler.invoke()
09:32:06 File "/usr/local/lib/python3.5/dist-packages/charms/reactive/bus.py", line 173, in invoke
09:32:06 self._action(*args)
09:32:06 File "/var/lib/juju/agents/unit-designate-bind-0/charm/reactive/designate_bind_handlers.py", line 74, in update_zones_from_peer
09:32:06 designate_bind.retrieve_zones(hacluster)
09:32:06 File "lib/charm/openstack/designate_bind.py", line 112, in retrieve_zones
09:32:06 DesignateBindCharm.singleton.retrieve_zones(cluster_relation)
09:32:06 File "lib/charm/openstack/designate_bind.py", line 448, in retrieve_zones
09:32:06 self.wget_file(url, ZONE_DIR)
09:32:06 File "/usr/local/lib/python3.5/dist-packages/charmhelpers/core/decorators.py", line 40, in _retry_on_exception_inner_2
09:32:06 return f(*args, **kwargs)
09:32:06 File "lib/charm/openstack/designate_bind.py", line 420, in wget_file
09:32:06 subprocess.check_call(cmd, cwd=target_dir)
09:32:06 File "/usr/lib/python3.5/subprocess.py", line 576, in check_call
09:32:06 retcode = call(*popenargs, **kwargs)
09:32:06 File "/usr/lib/python3.5/subprocess.py", line 557, in call
09:32:06 with Popen(*popenargs, **kwargs) as p:
09:32:06 File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
09:32:06 restore_signals, start_new_session)
09:32:06 File "/usr/lib/python3.5/subprocess.py", line 1490, in _execute_child
09:32:06 restore_signals, start_new_session, preexec_fn)
09:32:06 TypeError: Can't convert 'NoneType' object to str implicitly

Liam Young (gnuoy) on 2018-03-07
Changed in charm-designate-bind:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Liam Young (gnuoy)

Fix proposed to branch: master
Review: https://review.openstack.org/550429

Changed in charm-designate-bind:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/550429
Committed: https://git.openstack.org/cgit/openstack/charm-designate-bind/commit/?id=e95b02a465f97f8170d04fb2ee498440a8a2b525
Submitter: Zuul
Branch: master

commit e95b02a465f97f8170d04fb2ee498440a8a2b525
Author: Liam Young <email address hidden>
Date: Wed Mar 7 10:37:40 2018 +0000

    Do not try and download zones for empty url

    If the leader has updated the sync time but not yet published
    a src url then the charm can attempt to download the zones from
    an empty url

    Change-Id: If50872887c9bf993f1524c6bb1e3cad03eda5809
    Closes-Bug: #1753980

Changed in charm-designate-bind:
status: In Progress → Fix Committed
Ryan Beisner (1chb1n) on 2018-03-09
Changed in charm-designate-bind:
milestone: none → 18.02
Ryan Beisner (1chb1n) on 2018-03-09
Changed in charm-designate-bind:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers