Required attribute 'lb_method' not specified when creating a LBaaSv2

Bug #1616094 reported by Turbo Fredriksson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Invalid
Undecided
Unassigned
neutron
Expired
Undecided
Unassigned
python-neutronclient
Expired
Undecided
Unassigned

Bug Description

When creating a LBaaS v2 loadbalancer, listener and pool, I get:

----- s n i p -----
2016-08-23 14:04:32 [pool]: CREATE_FAILED BadRequest: resources.pool: Failed to parse request. Required attribute 'lb_method' not specified
----- s n i p -----

The test stack:

----- s n i p -----
heat_template_version: 2015-04-30
description: Loadbalancer template

resources:
  lbaas:
    type: OS::Neutron::LBaaS::LoadBalancer
    properties:
      name: lbaas-test
      description: lbaas-test
      vip_subnet: subnet-97

  listener:
    type: OS::Neutron::LBaaS::Listener
    properties:
      name: listener-test
      description: listener-test
      loadbalancer: { get_resource: lbaas }
      protocol: TCP
      protocol_port: 666

  pool:
    type: OS::Neutron::LBaaS::Pool
    properties:
      name: hapool-test
      description: hapool-test
      listener: { get_resource: listener }
      protocol: TCP
      lb_algorithm: LEAST_CONNECTIONS
----- s n i p -----

Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

Actually, this might be a Neutron issue:

/var/log/neutron/neutron-server.log:2016-08-23 15:04:32.388 23382 INFO neutron.api.v2.resource [req-e61fb2a5-cb68-4cfb-8eaa-04b0d1647a5e 4b0e25c70d2b4ad6ba4c50250f2f0b0b 04ee0e71babe4fd7aa16c3f64a8fca89 - - -] create failed (client error): Failed to parse request. Required attribute 'lb_method' not specified

description: updated
Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

This is Neutron LBaaS v2 on Mitaka (Neutron v8.0.0) and Debian GNU/Linux Sid.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

The error stems from a client-side issue: the request is not formatted properly because the server does not recognize the attribute lb_method.

lb_method is on LBaaS v1 which is being deleted [1]. LBaaS v2 has no such attribute [2]

[1] https://review.openstack.org/#/c/286381/18/neutron_lbaas/extensions/loadbalancer.py
[2] https://github.com/openstack/neutron-lbaas/blob/master/neutron_lbaas/extensions/loadbalancerv2.py#L182

Changed in neutron:
status: New → Invalid
status: Invalid → Incomplete
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Can you provide full logs? I am not sure I understand where is this lb_method coming from in the request.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

If you are using LBaaS v2, lb_method is clearly not available so I wonder if your HEAT template is still submitting an LBaaS v1 request.

Revision history for this message
Rabi Mishra (rabi) wrote : Re: [Bug 1616094] Re: Required attribute 'lb_method' not specified when creating a LBaaSv2

I think the error is the other way round. It's looking for 'lb_method'
attribute and failing. Is there a chance you're using lbaas v2 heat
resources with lbaas v1? We've functional test[1] with lbaas v2 at the gate
running without any issues.

[1]
https://git.openstack.org/cgit/openstack/heat/tree/heat_integrationtests/functional/test_lbaasv2.py

Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

I'm using the stack in the initial comment! Nothing more, noting less!

    heat stack-create -f test.yaml --poll 5 test-lbaas

Revision history for this message
Rabi Mishra (rabi) wrote :

I am not talking about the template. What version of lbaas service is
running in your deployment? Can you create a pool using neutron cli command
"neutron lbaas-pool-create" ?

On Wed, Aug 24, 2016 at 3:56 PM, Turbo Fredriksson <
<email address hidden>> wrote:

> I'm using the stack in the initial comment! Nothing more, noting less!
>
> heat stack-create -f test.yaml --poll 5 test-lbaas
>
> --
> You received this bug notification because you are subscribed to heat.
> Matching subscriptions: test
> https://bugs.launchpad.net/bugs/1616094
>
> Title:
> Required attribute 'lb_method' not specified when creating a LBaaSv2
>
> Status in heat:
> New
> Status in neutron:
> Incomplete
>
> Bug description:
> When creating a LBaaS v2 loadbalancer, listener and pool, I get:
>
> ----- s n i p -----
> 2016-08-23 14:04:32 [pool]: CREATE_FAILED BadRequest: resources.pool:
> Failed to parse request. Required attribute 'lb_method' not specified
> ----- s n i p -----
>
> The test stack:
>
> ----- s n i p -----
> heat_template_version: 2015-04-30
> description: Loadbalancer template
>
> resources:
> lbaas:
> type: OS::Neutron::LBaaS::LoadBalancer
> properties:
> name: lbaas-test
> description: lbaas-test
> vip_subnet: subnet-97
>
> listener:
> type: OS::Neutron::LBaaS::Listener
> properties:
> name: listener-test
> description: listener-test
> loadbalancer: { get_resource: lbaas }
> protocol: TCP
> protocol_port: 666
>
> pool:
> type: OS::Neutron::LBaaS::Pool
> properties:
> name: hapool-test
> description: hapool-test
> listener: { get_resource: listener }
> protocol: TCP
> lb_algorithm: LEAST_CONNECTIONS
> ----- s n i p -----
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/heat/+bug/1616094/+subscriptions
>

--
Regards,
Rabi Misra

Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

Sorry for the delay, but it's been _HOT_ (!!!) here in London the last couple of days :)

No, I can't create it using the "neutron" command either :(

----- s n i p -----
# neutron lbaas-loadbalancer-create --name test-lb subnet-97
Created a new loadbalancer:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| admin_state_up | True |
| description | |
| id | 349d9824-1692-40a0-a4be-afaef11edd5c |
| listeners | |
| name | test-lb |
| operating_status | OFFLINE |
| pools | |
| provider | haproxy |
| provisioning_status | PENDING_CREATE |
| tenant_id | 04ee0e71babe4fd7aa16c3f64a8fca89 |
| vip_address | 10.97.0.130 |
| vip_port_id | 137d1707-33c6-4f7f-8fc2-123543fa68e5 |
| vip_subnet_id | 9fdea89b-4fab-4b3e-b501-10bae5db289e |
+---------------------+--------------------------------------+
# neutron lbaas-loadbalancer-list
+--------------------------------------+---------+-------------+---------------------+----------+
| id | name | vip_address | provisioning_status | provider |
+--------------------------------------+---------+-------------+---------------------+----------+
| 349d9824-1692-40a0-a4be-afaef11edd5c | test-lb | 10.97.0.130 | ACTIVE | haproxy |
+--------------------------------------+---------+-------------+---------------------+----------+
# neutron lbaas-pool-create --name test-pool --loadbalancer test-lb --lb-algorithm LEAST_CONNECTIONS --protocol TCP
Failed to parse request. Required attribute 'lb_method' not specified
Neutron server returns request_ids: ['req-d3370b8c-bc25-4aa2-8421-6d8daddadf39']
#
----- s n i p -----

And the log say:

----- s n i p -----
==> /var/log/neutron/neutron-server.log <==
2016-08-29 13:55:46.629 4134 INFO neutron.wsgi [req-4ae6aee3-0dc4-459f-b358-470b89e8a40c 4b0e25c70d2b4ad6ba4c50250f2f0b0b 04ee0e71babe4fd7aa16c3f64a8fca89 - - -] 10.0.4.1 - - [29/Aug/2016 13:55:46] "GET /v2.0/lbaas/loadbalancers.json?fields=id&name=test-lb HTTP/1.1" 200 586 0.195469
2016-08-29 13:55:46.639 4134 INFO neutron.api.v2.resource [req-d3370b8c-bc25-4aa2-8421-6d8daddadf39 4b0e25c70d2b4ad6ba4c50250f2f0b0b 04ee0e71babe4fd7aa16c3f64a8fca89 - - -] create failed (client error): Failed to parse request. Required attribute 'lb_method' not specified
2016-08-29 13:55:46.640 4134 INFO neutron.wsgi [req-d3370b8c-bc25-4aa2-8421-6d8daddadf39 4b0e25c70d2b4ad6ba4c50250f2f0b0b 04ee0e71babe4fd7aa16c3f64a8fca89 - - -] 10.0.4.1 - - [29/Aug/2016 13:55:46] "POST /v2.0/lbaas/pools.json HTTP/1.1" 400 365 0.005967
----- s n i p -----

Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :
Changed in python-neutronclient:
assignee: nobody → Reedip (reedip-banerjee)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

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

Changed in python-neutronclient:
status: New → In Progress
Rabi Mishra (rabi)
Changed in heat:
status: New → Invalid
Revision history for this message
Turbo Fredriksson (turbo-bayour) wrote :

After some more debugging, it seems like it's a problem in

  https://github.com/openstack/neutron/blob/stable/mitaka/neutron/api/v2/attributes.py#L940-L941

Putting a LOG.debug() in there, I see the debug! So it seems like it's THERE the problem is.

This, the "fill_default_value()" is called from

  https://github.com/openstack/neutron/blob/master/neutron/api/v2/base.py#L678

Revision history for this message
Akihiro Motoki (amotoki) wrote :

Hmm... I tried stable/mitaka neutron and lbaas with devstack. Haproxy for LBaaS v2 is used.
I could not reproduce the issue reported in #9. I successfully created a loadbalancer pool.
Does anyone reproduce the issue?
http://paste.openstack.org/show/567117/

$ pip list | grep neutron
neutron (8.2.1.dev52, /opt/stack/neutron)
neutron-lbaas (8.2.1.dev2, /opt/stack/neutron-lbaas)
neutron-lib (0.0.2)
python-neutronclient (4.1.1)

LBaaS specific configuration in local.conf are:
enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas stable/mitaka
NEUTRON_LBAAS_SERVICE_PROVIDERV2="LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default"
enable_service q-lbaasv2

Revision history for this message
Akihiro Motoki (amotoki) wrote :

I succeeded to create a stack with the template in the bug description.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The proposed neutronclient change is related but it is not the cause of this issue. Resetting the status to "Incomplete" as the condition to reproduce the issue is not clear.

Changed in python-neutronclient:
status: In Progress → Incomplete
assignee: Reedip (reedip-banerjee) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-neutronclient because there has been no activity for 60 days.]

Changed in python-neutronclient:
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
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.