Bug 1368597

Summary: Clicking 'Edit Load Balancer' in LBaaS v2 UI results in error
Product: Red Hat OpenStack Reporter: Jon Jozwiak <jjozwiak>
Component: openstack-neutron-lbaasAssignee: Nir Magnezi <nmagnezi>
Status: CLOSED WONTFIX QA Contact: Toni Freger <tfreger>
Severity: medium Docs Contact:
Priority: low    
Version: 9.0 (Mitaka)CC: amuller, apevec, cgoncalves, lhh, nyechiel
Target Milestone: ---Keywords: Reopened, Triaged, ZStream
Target Release: 9.0 (Mitaka)Flags: nmagnezi: needinfo-
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1461004 (view as bug list) Environment:
Last Closed: 2018-11-21 17:07:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1461004    

Description Jon Jozwiak 2016-08-19 21:24:42 UTC
Description of problem:
In Horizon in RHEL OSP 9 (Mitaka) when I click on 'Edit Load Balancer' within the Load Balancers v2 tab, I get an error message as follows: 

Danger: An error occurred.  Please try again later.  

Version-Release number of selected component (if applicable):
RHEL OSP 9 (Mitaka)

openstack-neutron-lbaas-ui-1.0.1-0.20160606131231.b85927d.el7ost.noarch
python-neutron-lbaas-8.0.0-1.el7ost.noarch
openstack-neutron-lbaas-8.0.0-1.el7ost.noarch
openstack-dashboard-theme-9.0.1-1.el7ost.noarch
openstack-dashboard-9.0.1-1.el7ost.noarch

How reproducible:
This occurs consistently 

Steps to Reproduce:
1. Use the CLI to create a load balancer with pool, members, listener, etc
2. Validate load balancer is balancing traffic between 2 VMs
3. Log into Horizon Dashboard
4. Click on project tab in upper left hand corner
5. Click Network -> Load Balancers V2 
6. Click the 'Edit Load Balancer' button for your load balancer

Actual results:
An error box pops up:
Danger: An error occurred.  Please try again later. 

Expected results:
I'd expect it to let me edit the load balancer

Additional info:

Below is the output in /var/log/horizon/horizon.log

2016-08-19 21:16:59,435 5945 ERROR horizon.workflows.base Problem instantiating action class.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/horizon/workflows/base.py", line 370, in action
    context)
  File "/usr/lib/python2.7/site-packages/neutron_lbaas_dashboard/dashboards/project/loadbalancersv2/workflows/update_lb.py", line 48, in __init__
    self.fields['address'].initial = context['address']
KeyError: 'address'
2016-08-19 21:16:59,438 5945 ERROR django.request Internal Server Error: /dashboard/project/loadbalancersv2/0fdfbaf9-95f9-4291-af16-305bec8cb6f9/update
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 164, in get_response
    response = response.render()
  File "/usr/lib/python2.7/site-packages/django/template/response.py", line 158, in render
    self.content = self.rendered_content
  File "/usr/lib/python2.7/site-packages/django/template/response.py", line 135, in rendered_content
    content = template.render(context, self._request)
  File "/usr/lib/python2.7/site-packages/django/template/backends/django.py", line 74, in render
    return self.template.render(context)
  File "/usr/lib/python2.7/site-packages/django/template/base.py", line 210, in render
    return self._render(context)
  File "/usr/lib/python2.7/site-packages/django/template/base.py", line 202, in _render
    return self.nodelist.render(context)
  File "/usr/lib/python2.7/site-packages/django/template/base.py", line 905, in render
    bit = self.render_node(node, context)
  File "/usr/lib/python2.7/site-packages/django/template/base.py", line 919, in render_node
    return node.render(context)
  File "/usr/lib/python2.7/site-packages/django/template/defaulttags.py", line 574, in render
    six.iteritems(self.extra_context)}
  File "/usr/lib/python2.7/site-packages/django/template/defaulttags.py", line 573, in <dictcomp>
    values = {key: val.resolve(context) for key, val in
  File "/usr/lib/python2.7/site-packages/django/template/base.py", line 648, in resolve
    obj = self.var.resolve(context)
  File "/usr/lib/python2.7/site-packages/django/template/base.py", line 789, in resolve
    value = self._resolve_lookup(context)
  File "/usr/lib/python2.7/site-packages/django/template/base.py", line 849, in _resolve_lookup
    current = current()
  File "/usr/lib/python2.7/site-packages/horizon/workflows/base.py", line 720, in get_entry_point
    step._verify_contributions(self.context)
  File "/usr/lib/python2.7/site-packages/horizon/workflows/base.py", line 394, in _verify_contributions
    field = self.action.fields.get(key, None)
  File "/usr/lib/python2.7/site-packages/horizon/workflows/base.py", line 370, in action
    context)
  File "/usr/lib/python2.7/site-packages/neutron_lbaas_dashboard/dashboards/project/loadbalancersv2/workflows/update_lb.py", line 48, in __init__
    self.fields['address'].initial = context['address']
KeyError: 'address'

Comment 2 Assaf Muller 2016-09-13 20:01:47 UTC

*** This bug has been marked as a duplicate of bug 1368601 ***

Comment 3 Nir Magnezi 2016-09-14 13:52:18 UTC
Jon,

Can you please share some details about your setup? (So I can debug the issue).
How was it deployed, rpm versions, how was LBaaS configured (by the installer? manually?), etc.

Please also attach relevant logs and configuration files.

Comment 4 Jon Jozwiak 2016-09-26 16:01:19 UTC
I built the environment with a packstack all in one build.  Then I added LBaaS v2 as follows: 

yum -y install openstack-neutron-lbaas haproxy

# In /etc/neutron/neutron.conf, add lbaasv2 to service plugins.
service_plugins = neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2

# In [service_providers] section of /etc/neutron/neutron.conf, add the load balancer with haproxy backend:
service_provider=LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

# Set the interface driver to openvswitch (or linuxbridge if applicable)
openstack-config --set /etc/neutron/lbaas_agent.ini DEFAULT interface_driver openvswitch

# Ensure the device_driver is commented out if it was previously defined for v1
sed -i -e 's/^device_driver/#device_driver/g' /etc/neutron/

# Run the database migration
neutron-db-manage --subproject neutron-lbaas upgrade head
systemctl disable neutron-lbaas-agent
systemctl stop neutron-lbaas-agent
systemctl restart neutron-server
systemctl enable neutron-lbaasv2-agent
systemctl start neutron-lbaasv2-agent

# Enable the v2 UI 
yum -y install openstack-neutron-lbaas-ui

# Ensure the following section in /etc/openstack-dashboard/local_settings:
OPENSTACK_NEUTRON_NETWORK = {
 ...
    'enable_lb': True,
 ...
}

systemctl restart httpd

Comment 6 Assaf Muller 2018-11-21 17:07:26 UTC
Closed due to low prioritization. It doesn't make sense to invest in LBaaS v2 UI at this point, as we focus on Octavia on OSP 13+.