HA hooks failed if https enabled and no os-x-network is set

Bug #1385162 reported by Xiang Hui
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystone (Juju Charms Collection)
Fix Released
Critical
Edward Hope-Morley

Bug Description

This error happened on the scenario: keystone HA + SSL + No network splits

test yaml for keystone:
    admin-password: openstack
    admin-token: ubuntutesting
    https-service-endpoints: 'True'
    use-https: 'yes'
    vip: '10.0.3.100'

juju deploy test.yaml -n 3 keystone

An error will be reported as below:
2014-10-23 10:25:01 INFO ha-relation-changed Traceback (most recent call last):
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/ha-relation-changed", line 382, in <module>
2014-10-23 10:25:01 INFO ha-relation-changed main()
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/ha-relation-changed", line 376, in main
2014-10-23 10:25:01 INFO ha-relation-changed hooks.execute(sys.argv)
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/core/hookenv.py", line 508, in execute
2014-10-23 10:25:01 INFO ha-relation-changed self._hooks[hook_name]()
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/core/host.py", line 268, in wrapped_f
2014-10-23 10:25:01 INFO ha-relation-changed f(*args)
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/ha-relation-changed", line 309, in ha_changed
2014-10-23 10:25:01 INFO ha-relation-changed CONFIGS.write_all()
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 261, in write_all
2014-10-23 10:25:01 INFO ha-relation-changed [self.write(k) for k in self.templates.iterkeys()]
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 250, in write
2014-10-23 10:25:01 INFO ha-relation-changed _out = self.render(config_file)
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 221, in render
2014-10-23 10:25:01 INFO ha-relation-changed ctxt = self.templates[config_file].context()
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 88, in context
2014-10-23 10:25:01 INFO ha-relation-changed _ctxt = context()
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/keystone_context.py", line 33, in __call__
2014-10-23 10:25:01 INFO ha-relation-changed return super(ApacheSSLContext, self).__call__()
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/contrib/openstack/context.py", line 604, in __call__
2014-10-23 10:25:01 INFO ha-relation-changed for cn in self.canonical_names():
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/keystone_context.py", line 64, in canonical_names
2014-10-23 10:25:01 INFO ha-relation-changed vip):
2014-10-23 10:25:01 INFO ha-relation-changed File "/var/lib/juju/agents/unit-keystone-0/charm/hooks/charmhelpers/contrib/network/ip.py", line 111, in is_address_in_network
2014-10-23 10:25:01 INFO ha-relation-changed network = netaddr.IPNetwork(network)
2014-10-23 10:25:01 INFO ha-relation-changed File "/usr/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 907, in __init__
2014-10-23 10:25:01 INFO ha-relation-changed implicit_prefix, flags)
2014-10-23 10:25:01 INFO ha-relation-changed File "/usr/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 802, in parse_ip_network
2014-10-23 10:25:01 INFO ha-relation-changed raise TypeError('unexpected type %s for addr arg' % type(addr))
2014-10-23 10:25:01 INFO ha-relation-changed TypeError: unexpected type <type 'NoneType'> for addr arg
2014-10-23 10:25:01 ERROR juju.worker.uniter uniter.go:482 hook failed: exit status 1

from code hooks/keystone_context.py
"
                for vip in vips:
                    if is_address_in_network(config(network_type), vip):
                        addresses.append(vip)
"
funciton is_address_in_network() is default called with config(network_type) param that caused hook failed if no network_type(os_x_network) is set.

Related branches

Xiang Hui (xianghui)
tags: added: openstack
Changed in keystone (Juju Charms Collection):
assignee: nobody → Xiang Hui (xianghui)
status: New → In Progress
importance: Undecided → Medium
tags: added: cts
tags: added: backport-potential
Xiang Hui (xianghui)
summary: - ha-relation-changed failed if set https-service-endpoints=true
+ hooks failed if https enabled and no os-x-network is set
description: updated
James Page (james-page)
Changed in keystone (Juju Charms Collection):
importance: Medium → Critical
Xiang Hui (xianghui)
summary: - hooks failed if https enabled and no os-x-network is set
+ HA hooks failed if https enabled and no os-x-network is set
description: updated
Changed in keystone (Juju Charms Collection):
status: In Progress → Fix Committed
Changed in keystone (Juju Charms Collection):
assignee: Xiang Hui (xianghui) → Edward Hope-Morley (hopem)
James Page (james-page)
Changed in keystone (Juju Charms Collection):
milestone: none → 15.01
James Page (james-page)
Changed in keystone (Juju Charms Collection):
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.