When neutron lbaas agent is not running, 'neutron lb*’ commands must display an error instead of "404 Not Found"

Bug #1440285 reported by Vikram Hosakote
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
octavia
Invalid
Low
Unassigned

Bug Description

When neutron lbaas agent is not running, all the ‘neutron lb*’ commands display "404 Not Found". This makes the user think that something is wrong with the lbaas agent (when it is not even running!).

Instead, when neutron lbaas agent is not running, an error like “Neutron Load Balancer Agent not running” must be displayed so the user knows that the lbaas agent must be started first.

The ‘ps’ command below shows that the neutron lbaas agent is not running.

$ ps aux | grep lb
$

$ neutron lb-healthmonitor-list
404 Not Found
The resource could not be found.

$ neutron lb-member-list
404 Not Found
The resource could not be found.

$ neutron lb-pool-list
404 Not Found
The resource could not be found.

$ neutron lb-vip-list
404 Not Found
The resource could not be found.

$ neutron lbaas-healthmonitor-list
404 Not Found
The resource could not be found.

$ neutron lbaas-listener-list
404 Not Found
The resource could not be found.

$ neutron lbaas-loadbalancer-list
404 Not Found
The resource could not be found.

$ neutron lbaas-pool-list
404 Not Found
The resource could not be found.

$ neutron --version
2.3.11

=============================

Below are the neutron verbose messages that show "404 Not Found".

$ neutron -v lb-healthmonitor-list
DEBUG: keystoneclient.session REQ: curl -g -i -X GET http://192.168.122.205:5000/v2.0/ -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG: keystoneclient.session RESP: [200] content-length: 341 vary: X-Auth-Token keep-alive: timeout=5, max=100 server: Apache/2.4.7 (Ubuntu) connection: Keep-Alive date: Sat, 04 Apr 2015 04:37:54 GMT content-type: application/json x-openstack-request-id: req-95c6d1e1-02a7-4077-8ed2-0cb4f574a397
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://192.168.122.205:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('csv = cliff.formatters.commaseparated:CSVLister')
DEBUG: stevedore.extension found extension EntryPoint.parse('yaml = clifftablib.formatters:YamlFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('json = clifftablib.formatters:JsonFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('html = clifftablib.formatters:HtmlFormatter')
DEBUG: neutronclient.neutron.v2_0.lb.healthmonitor.ListHealthMonitor get_data(Namespace(columns=[], fields=[], formatter='table', max_width=0, page_size=None, quote_mode='nonnumeric', request_format='json', show_details=False, sort_dir=[], sort_key=[]))
DEBUG: keystoneclient.auth.identity.v2 Making authentication request to http://192.168.122.205:5000/v2.0/tokens
DEBUG: keystoneclient.session REQ: curl -g -i -X GET http://192.168.122.205:9696/v2.0/lb/health_monitors.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}23f2a54d0348e6bfc5364565ece4baf2e2148fa8"
DEBUG: keystoneclient.session RESP:
DEBUG: neutronclient.v2_0.client Error message: 404 Not Found

The resource could not be found.

ERROR: neutronclient.shell 404 Not Found

The resource could not be found.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 760, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 100, in run_command
    return cmd.run(known_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 29, in run
    return super(OpenStackCommand, self).run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 91, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 35, in take_action
    return self.get_data(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 691, in get_data
    data = self.retrieve_list(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 654, in retrieve_list
    data = self.call_server(neutron_client, search_opts, parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 626, in call_server
    data = obj_lister(**search_opts)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 102, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 1088, in list_health_monitors
    retrieve_all, **_params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 307, in list
    for r in self._pagination(collection, path, **params):
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 320, in _pagination
    res = self.get(path, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 293, in get
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 270, in retry_request
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 211, in do_request
    self._handle_fault_response(status_code, replybody)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 185, in _handle_fault_response
    exception_handler_v20(status_code, des_error_body)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 83, in exception_handler_v20
    message=message)
NeutronClientException: 404 Not Found

The resource could not be found.

=============================

$ neutron -v lb-member-list
DEBUG: keystoneclient.session REQ: curl -g -i -X GET http://192.168.122.205:5000/v2.0/ -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG: keystoneclient.session RESP: [200] content-length: 341 vary: X-Auth-Token keep-alive: timeout=5, max=100 server: Apache/2.4.7 (Ubuntu) connection: Keep-Alive date: Sat, 04 Apr 2015 04:39:43 GMT content-type: application/json x-openstack-request-id: req-3b906800-0aae-40a1-aca0-08f220f50878
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://192.168.122.205:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('csv = cliff.formatters.commaseparated:CSVLister')
DEBUG: stevedore.extension found extension EntryPoint.parse('yaml = clifftablib.formatters:YamlFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('json = clifftablib.formatters:JsonFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('html = clifftablib.formatters:HtmlFormatter')
DEBUG: neutronclient.neutron.v2_0.lb.member.ListMember get_data(Namespace(columns=[], fields=[], formatter='table', max_width=0, page_size=None, quote_mode='nonnumeric', request_format='json', show_details=False, sort_dir=[], sort_key=[]))
DEBUG: keystoneclient.auth.identity.v2 Making authentication request to http://192.168.122.205:5000/v2.0/tokens
DEBUG: keystoneclient.session REQ: curl -g -i -X GET http://192.168.122.205:9696/v2.0/lb/members.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}480bc62db89194e83942975df576f28c5a463b8d"
DEBUG: keystoneclient.session RESP:
DEBUG: neutronclient.v2_0.client Error message: 404 Not Found

The resource could not be found.

ERROR: neutronclient.shell 404 Not Found

The resource could not be found.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 760, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 100, in run_command
    return cmd.run(known_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 29, in run
    return super(OpenStackCommand, self).run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 91, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 35, in take_action
    return self.get_data(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 691, in get_data
    data = self.retrieve_list(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 654, in retrieve_list
    data = self.call_server(neutron_client, search_opts, parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/neutron/v2_0/__init__.py", line 626, in call_server
    data = obj_lister(**search_opts)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 102, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 1061, in list_members
    **_params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 307, in list
    for r in self._pagination(collection, path, **params):
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 320, in _pagination
    res = self.get(path, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 293, in get
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 270, in retry_request
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 211, in do_request
    self._handle_fault_response(status_code, replybody)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 185, in _handle_fault_response
    exception_handler_v20(status_code, des_error_body)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/v2_0/client.py", line 83, in exception_handler_v20
    message=message)
NeutronClientException: 404 Not Found

The resource could not be found.

Revision history for this message
Vikram Hosakote (vhosakot) wrote :

Reproduced with the latest python-neutronclient in DevStack. Fixing it.

$ neutron --version
2.3.11

Changed in python-neutronclient:
status: New → Confirmed
assignee: nobody → Vikram Hosakote (vhosakot)
tags: added: lbaas
summary: - When neutron lbaas agent is not running, 'neutron lb*’ commands must not
- communicate with neutron-server, and must display an error
+ When neutron lbaas agent is not running, 'neutron lb*’ commands must
+ display an error instead of "404 Not Found"
description: updated
Revision history for this message
Abhijeet Malawade (abhijeet-malawade) wrote :

I am getting this error even after starting lbaas service.

$ neutron --version
2.6.0

 'neutron lb-pool-list' command is returning correct output but 'neutron lbaas-pool-list' is returning 404 error.

$ neutron lb-pool-list
+--------------------------------------+------+----------+-------------+----------+----------------+--------+
| id | name | provider | lb_method | protocol | admin_state_up | status |
+--------------------------------------+------+----------+-------------+----------+----------------+--------+
| 3b17e153-3b7b-40ea-918a-03063e9d3d22 | test | haproxy | ROUND_ROBIN | HTTP | True | ACTIVE |
+--------------------------------------+------+----------+-------------+----------+----------------+--------+

$ neutron lbaas-pool-list
404 Not Found

The resource could not be found.

Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

I am also facing the same problem as Abhijeet.
Seems that there is some issue in launching of lbaas extension.

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

it is not a client side issue.
I will change the affected project to neutron and add tag 'lbaas'.

affects: python-neutronclient → neutron
Revision history for this message
Akihiro Motoki (amotoki) wrote :

lb-pool-list is for Neutron LBaaS v1 API and lbaas-pool-list is for LBaaS v2 API.
In your environment, LBaaS v1 extension is enabled and LBaaS v2 exntension is disabled.
Returning 404 response to non-loaded extensions is the design decision in Neutron at now.

Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :
Changed in neutron:
assignee: Vikram Hosakote (vhosakot) → nobody
Changed in neutron:
assignee: nobody → xiaodongwang (xiaodongwang991481)
Changed in neutron:
importance: Undecided → Low
affects: neutron → octavia
Revision history for this message
Gregory Thiemonge (gthiemonge) wrote : auto-abandon-script

Abandoned after re-enabling the Octavia launchpad.

Changed in octavia:
assignee: xiaodongwang (xiaodongwang991481) → nobody
status: Confirmed → Invalid
tags: added: auto-abandon
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.