when MAASConfigIncomplete is raised set the unit in blocked state

Bug #1790559 reported by Felipe Reyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack HA Cluster Charm
Fix Released
Undecided
Felipe Reyes

Bug Description

When MAASConfigIncomplete() is raised the unit should be set in blocked state and the message should be set in the workload message

unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined Traceback (most recent call last):
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined File "/var/lib/juju/agents/unit-ceph-rgw-ha-2/charm/hooks/ha-relation-joined", line 490, in <module>
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined hooks.execute(sys.argv)
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined File "/var/lib/juju/agents/unit-ceph-rgw-ha-2/charm/hooks/charmhelpers/core/hookenv.py", line 847, in execute
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined self._hooks[hook_name]()
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined File "/var/lib/juju/agents/unit-ceph-rgw-ha-2/charm/hooks/ha-relation-joined", line 266, in ha_relation_changed
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined if validate_dns_ha():
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined File "/var/lib/juju/agents/unit-ceph-rgw-ha-2/charm/hooks/utils.py", line 699, in validate_dns_ha
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined raise MAASConfigIncomplete(msg)
unit-ceph-rgw-ha-2: 00:52:24 DEBUG unit.ceph-rgw-ha/2.ha-relation-joined utils.MAASConfigIncomplete: DNS HA is requested but the maas_url or maas_credentials settings are not set
unit-ceph-rgw-ha-2: 00:52:24 ERROR juju.worker.uniter.operation hook "ha-relation-joined" failed: exit status 1

$ juju status
Model Controller Cloud/Region Version SLA Timestamp
radosgw c1 stsstack/stsstack 2.4.1 unsupported 00:52:34Z

App Version Status Scale Charm Store Rev OS Notes
ceph-mon 10.2.10 active 1 ceph-mon jujucharms 339 ubuntu
ceph-osd 10.2.10 active 3 ceph-osd jujucharms 363 ubuntu
ceph-rgw 10.2.10 active 3 ceph-radosgw jujucharms 293 ubuntu
ceph-rgw-ha error 3 hacluster jujucharms 66 ubuntu
keystone 9.3.0 active 1 keystone jujucharms 373 ubuntu
mysql 5.6.37-26.21 active 1 percona-cluster jujucharms 307 ubuntu

Unit Workload Agent Machine Public address Ports Message
ceph-mon/0* active idle 0 10.5.0.7 Unit is ready and clustered
ceph-osd/0 active idle 1 10.5.0.11 Unit is ready (1 OSD)
ceph-osd/1* active idle 2 10.5.0.10 Unit is ready (1 OSD)
ceph-osd/2 active idle 3 10.5.0.12 Unit is ready (1 OSD)
ceph-rgw/0* active idle 4 10.5.0.17 80/tcp Unit is ready
  ceph-rgw-ha/0* error idle 10.5.0.17 hook failed: "hanode-relation-changed"
ceph-rgw/1 active idle 5 10.5.0.8 80/tcp Unit is ready
  ceph-rgw-ha/2 error idle 10.5.0.8 hook failed: "ha-relation-joined"
ceph-rgw/2 active idle 6 10.5.0.15 80/tcp Unit is ready
  ceph-rgw-ha/1 error idle 10.5.0.15 hook failed: "hanode-relation-changed"
keystone/0* active idle 7 10.5.0.13 5000/tcp Unit is ready
mysql/0* active idle 8 10.5.0.3 3306/tcp Unit is ready

bundle: http://paste.ubuntu.com/p/W8q9NrrBzJ/

Felipe Reyes (freyes)
Changed in charm-hacluster:
assignee: nobody → Felipe Reyes (freyes)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-hacluster (master)

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

Changed in charm-hacluster:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-hacluster (master)

Reviewed: https://review.openstack.org/599474
Committed: https://git.openstack.org/cgit/openstack/charm-hacluster/commit/?id=2f4a815856e52a15b90db23fb227fdb9205c146a
Submitter: Zuul
Branch: master

commit 2f4a815856e52a15b90db23fb227fdb9205c146a
Author: Felipe Reyes <email address hidden>
Date: Mon Sep 3 22:56:20 2018 -0300

    Catch MAASConfigIncomplete and set workload message

    validate_dns_ha() shouldn't have the side effect of setting the workload
    status and message, so now it will raise MAASConfigIncomplete with a
    message and ha_relation_changed() is catching the exception, setting the
    workload in blocked status and short circuiting the hook execution until
    the user set maas_url and maas_credentials.

    Change-Id: I3f1bc6571d2461cb65f384f042423cfe33f4d2f8
    Closes-Bug: 1790559

Changed in charm-hacluster:
status: In Progress → Fix Committed
David Ames (thedac)
Changed in charm-hacluster:
milestone: none → 19.04
David Ames (thedac)
Changed in charm-hacluster:
status: Fix Committed → Fix Released
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.