TypeError during k8s test run with no public VN

Bug #1711586 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R4.0
Fix Committed
Undecided
Vedamurthy Joshi
Trunk
Fix Committed
Undecided
Vedamurthy Joshi

Bug Description

R4.0.1.0 Continuous Build 23 Ubuntu 16.04.2

I had run k8s sanity without public network created..and saw a number of these tracebacks

08/18/2017 12:53:28 PM [contrail-kube-manager]: public_fip_pool {'project': 'default', 'domain': 'default-domain', 'name': '__fip_pool_public__', 'network': '__public__'} doesn't exists
08/18/2017 12:53:28 PM [contrail-kube-manager]: __default__ [SYS_WARN]: KubeManagerWarningLog: public_fip_pool {'project': 'default', 'domain': 'default-domain', 'name': '__fip_pool_public__', 'network': '__public__'} doesn't exists
08/18/2017 12:53:28 PM [contrail-kube-manager]: VncKubernetes - <type 'exceptions.TypeError'>
Python 2.7.12: /usr/bin/python
Fri Aug 18 12:53:28 2017

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_kubernetes.py in vnc_process(self=<kube_manager.vnc.vnc_kubernetes.VncKubernetes object>)
  376 self.pod_mgr.process(event)
  377 elif kind == 'Service':
  378 self.service_mgr.process(event)
  379 elif kind == 'Namespace':
  380 self.namespace_mgr.process(event)
self = <kube_manager.vnc.vnc_kubernetes.VncKubernetes object>
self.service_mgr = <kube_manager.vnc.vnc_service.VncService object>
self.service_mgr.process = <bound method VncService.process of <kube_manager.vnc.vnc_service.VncService object>>
event = {u'object': {u'apiVersion': u'v1', u'kind': u'Service', u'metadata': {u'creationTimestamp': u'2017-08-18T07:23:27Z', u'name': u'ctest-nginx-svc-28080637', u'namespace': u'ctest-namespace-44187991', u'resourceVersion': u'126113', u'selfLink': u'/api/v1/namespaces/ctest-namespace-44187991/services/ctest-nginx-svc-28080637', u'uid': u'21167dc4-83e6-11e7-96fd-002590c30af2'}, u'spec': {u'clusterIP': u'10.97.23.118', u'externalTrafficPolicy': u'Cluster', u'ports': [{u'nodePort': 32396, u'port': 80, u'protocol': u'TCP', u'targetPort': 80}], u'selector': {u'app': u'http_test'}, u'sessionAffinity': u'None', u'type': u'LoadBalancer'}, u'status': {u'loadBalancer': {}}}, u'type': u'ADDED'}

 /usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py in process(self=<kube_manager.vnc.vnc_service.VncService object>, event={u'object': {u'apiVersion': u'v1', u'kind': u'Service', u'metadata': {u'creationTimestamp': u'2017-08-18T07:23:27Z', u'name': u'ctest-nginx-svc-28080637', u'namespace': u'ctest-namespace-44187991', u'resourceVersion': u'126113', u'selfLink': u'/api/v1/namespaces/ctest-namespace-44187991/services/ctest-nginx-svc-28080637', u'uid': u'21167dc4-83e6-11e7-96fd-002590c30af2'}, u'spec': {u'clusterIP': u'10.97.23.118', u'externalTrafficPolicy': u'Cluster', u'ports': [{u'nodePort': 32396, u'port': 80, u'protocol': u'TCP', u'targetPort': 80}], u'selector': {u'app': u'http_test'}, u'sessionAffinity': u'None', u'type': u'LoadBalancer'}, u'status': {u'loadBalancer': {}}}, u'type': u'ADDED'})
  549 self.vnc_service_add(service_id, service_name,
  550 service_namespace, service_ip, selectors, ports,
  551 service_type, externalIps, loadBalancerIp)
  552 elif event['type'] == 'DELETED':
  553 self.vnc_service_delete(service_id, service_name, service_namespace,
service_type = u'LoadBalancer'
externalIps = None
loadBalancerIp = None

 /usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py in vnc_service_add(self=<kube_manager.vnc.vnc_service.VncService object>, service_id=u'21167dc4-83e6-11e7-96fd-002590c30af2', service_name=u'ctest-nginx-svc-28080637', service_namespace=u'ctest-namespace-44187991', service_ip=u'10.97.23.118', selectors={u'app': u'http_test'}, ports=[{u'nodePort': 32396, u'port': 80, u'protocol': u'TCP', u'targetPort': 80}], service_type=u'LoadBalancer', externalIps=None, loadBalancerIp=None)
  420
  421 self._update_service_public_ip(service_id, service_name,
  422 service_namespace, service_type, externalIps, loadBalancerIp)
  423
  424 if ingress_update:
service_namespace = u'ctest-namespace-44187991'
service_type = u'LoadBalancer'
externalIps = None
loadBalancerIp = None

 /usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py in _update_service_public_ip(self=<kube_manager.vnc.vnc_service.VncService object>, service_id=u'21167dc4-83e6-11e7-96fd-002590c30af2', service_name=u'ctest-nginx-svc-28080637', service_namespace=u'ctest-namespace-44187991', service_type=u'LoadBalancer', external_ips=None, loadBalancerIp=None)
  345 else:
  346 allocated_fip = self._allocate_floating_ips(service_id)
  347 self._update_service_external_ip(service_namespace, service_name, allocated_fip)
  348
  349 return
self = <kube_manager.vnc.vnc_service.VncService object>
self._update_service_external_ip = <bound method VncService._update_service_externa...<kube_manager.vnc.vnc_service.VncService object>>
service_namespace = u'ctest-namespace-44187991'
service_name = u'ctest-nginx-svc-28080637'
allocated_fip = None

 /usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py in _update_service_external_ip(self=<kube_manager.vnc.vnc_service.VncService object>, service_namespace=u'ctest-namespace-44187991', service_name=u'ctest-nginx-svc-28080637', external_ips=None)
  320
  321 def _update_service_external_ip(self, service_namespace, service_name, external_ips):
  322 merge_patch = {'spec': {'externalIPs': [', '.join(external_ips)]}}
  323 self.kube.patch_resource(resource_type="services", resource_name=service_name,
  324 namespace=service_namespace, merge_patch=merge_patch)
merge_patch undefined
external_ips = None
<type 'exceptions.TypeError'>: can only join an iterable
    __class__ = <type 'exceptions.TypeError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.TypeError object>
    __dict__ = {}
    __doc__ = 'Inappropriate argument type.'
    __format__ = <built-in method __format__ of exceptions.TypeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.TypeError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.TypeError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.TypeError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.TypeError object>
    __init__ = <method-wrapper '__init__' of exceptions.TypeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.TypeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.TypeError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.TypeError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.TypeError object>
    __setstate__ = <built-in method __setstate__ of exceptions.TypeError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.TypeError object>
    __str__ = <method-wrapper '__str__' of exceptions.TypeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.TypeError object>
    args = ('can only join an iterable',)
    message = 'can only join an iterable'
The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_kubernetes.py", line 378, in vnc_process
    self.service_mgr.process(event)
  File "/usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py", line 551, in process
    service_type, externalIps, loadBalancerIp)
  File "/usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py", line 422, in vnc_service_add
    service_namespace, service_type, externalIps, loadBalancerIp)
  File "/usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py", line 347, in _update_service_public_ip
    self._update_service_external_ip(service_namespace, service_name, allocated_fip)
  File "/usr/lib/python2.7/dist-packages/kube_manager/vnc/vnc_service.py", line 322, in _update_service_external_ip
    merge_patch = {'spec': {'externalIPs': [', '.join(external_ips)]}}
TypeError: can only join an iterable

summary: - TypeError during k8s test run with no external ip set
+ TypeError during k8s test run with no public VN
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/34764
Submitter: Sachchidanand Vaidya (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/34769
Submitter: Sachchidanand Vaidya (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/34764
Committed: http://github.com/Juniper/contrail-controller/commit/d14b994018ce713c1ad0cca3ededd97de9ba4cc7
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit d14b994018ce713c1ad0cca3ededd97de9ba4cc7
Author: Sachchidanand Vaidya <email address hidden>
Date: Sat Aug 19 18:20:25 2017 -0700

Handle external_ip allocation failure properly

If public network is not defined then allocating public ip for
LoadBalancer Service will fail. If external ip allocation fails
don't update kube-api server.

Closes-Bug: #1711586

Change-Id: I8487e4ad780f9516765040fb6165c3f225112cc4

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/34769
Committed: http://github.com/Juniper/contrail-controller/commit/aeb133f295effe2122820d34a4f23b5d1a29287b
Submitter: Zuul (<email address hidden>)
Branch: master

commit aeb133f295effe2122820d34a4f23b5d1a29287b
Author: Sachchidanand Vaidya <email address hidden>
Date: Sat Aug 19 18:20:25 2017 -0700

Handle external_ip allocation failure properly

If public network is not defined then allocating public ip for
LoadBalancer Service will fail. If external ip allocation fails
don't update kube-api server.

Closes-Bug: #1711586

Change-Id: I8487e4ad780f9516765040fb6165c3f225112cc4

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.