Neutron cann't find resources, got 404 when executing l2-gateway-create command

Bug #1580896 reported by Ravi Shankar S
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-l2gw
New
Undecided
Unassigned

Bug Description

I executed the below l2 gateway command and got the resource not found error.
 neutron l2-gateway-create gw1 --tenant_id $(openstack project list | grep '\sadmin' | awk '{print $2}') --device name=<name>,interface_names=<name>

       I am not sure it is a l2 gateway or neutron client issue.

Debug logs for the l2 gateawy create command:
=============================================

 nvo@nvo-PowerEdge-R620:~/devstack_master/devstack$ neutron l2-gateway-create --tenant_id $(openstack project list | grep '\sadmin' | awk '{print $2}') --device name=172.17.27.168,interface_names="Fo 0/116" gw1
   The resource could not be found.<br /><br />

   Neutron server returns request_ids: ['req-ab68ae99-1f2d-4de5-aa41-35d67e7cce90']
   nvo@nvo-PowerEdge-R620:~/devstack_master/devstack$ netsta -an | grep 35357^C
   nvo@nvo-PowerEdge-R620:~/devstack_master/devstack$ neutron l2-gateway-create --tenant_id $(openstack project list | grep '\sadmin' | awk '{print $2}') --device name=172.17.27.168,interface_names="Fo 0/116" gw1 --debug
   DEBUG: stevedore.extension found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token')
   DEBUG: stevedore.extension found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken')
   DEBUG: stevedore.extension found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode')
   DEBUG: stevedore.extension found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password')
   DEBUG: stevedore.extension found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password')
   DEBUG: stevedore.extension found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword')
   DEBUG: stevedore.extension found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token')
   DEBUG: stevedore.extension found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token')
   DEBUG: stevedore.extension found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password')
   DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
   DEBUG: stevedore.extension found extension EntryPoint.parse('json = cliff.formatters.json_format:JSONFormatter')
   DEBUG: stevedore.extension found extension EntryPoint.parse('shell = cliff.formatters.shell:ShellFormatter')
   DEBUG: stevedore.extension found extension EntryPoint.parse('value = cliff.formatters.value:ValueFormatter')
   DEBUG: stevedore.extension found extension EntryPoint.parse('yaml = cliff.formatters.yaml_format:YAMLFormatter')
   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: networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway.L2GatewayCreate run(Namespace(columns=[], devices=[{u'interface_names': u'Fo 0/116', u'name': u'172.17.27.168'}], formatter='table', max_width=0, name=u'gw1', noindent=False, prefix='', request_format='json', tenant_id=u'2bf4ce09694d4189bfb45b570050e72e', variables=[]))
   DEBUG: keystoneauth.session REQ: curl -g -i -X GET http://172.17.27.230:5000/v2.0 -H "Accept: application/json" -H "User-Agent: keystoneauth1/2.6.0 python-requests/2.10.0 CPython/2.7.6"
   DEBUG: keystoneauth.session RESP: [200] Date: Thu, 12 May 2016 06:44:44 GMT Server: Apache/2.4.7 (Ubuntu) Vary: X-Auth-Token x-openstack-request-id: req-7dfa77e0-2de6-4293-8ddf-18f32d5598c9 Content-Length: 339 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: application/json
   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://172.17.27.230:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

   DEBUG: keystoneauth.identity.v2 Making authentication request to http://172.17.27.230:5000/v2.0/tokens
   DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway_connection = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway_connection')
   DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway')
   DEBUG: keystoneauth.session REQ: curl -g -i -X POST http://172.17.27.230:9696/v2.0/l2-gateways.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}c7fcfa8cd418e8c1f3b778d551baef6639565cbe" -d '{"l2_gateway": {"tenant_id": "2bf4ce09694d4189bfb45b570050e72e", "name": "gw1", "devices": [{"interfaces": [{"name": "Fo 0/116"}], "device_name": "172.17.27.168"}]}}'
   DEBUG: keystoneauth.session RESP: [404] Content-Length: 112 Content-Type: application/json; charset=UTF-8 X-Openstack-Request-Id: req-b0aa591f-8972-4b04-868a-db5929a6adc0 Date: Thu, 12 May 2016 06:44:44 GMT Connection: keep-alive
   RESP BODY: {"message": "The resource could not be found.<br /><br />\n\n\n", "code": "404 Not Found", "title": "Not Found"}

   DEBUG: neutronclient.v2_0.client Error message: {"message": "The resource could not be found.<br /><br />\n\n\n", "code": "404 Not Found", "title": "Not Found"}
   ERROR: neutronclient.shell The resource could not be found.<br /><br />

   Neutron server returns request_ids: ['req-b0aa591f-8972-4b04-868a-db5929a6adc0']
   Traceback (most recent call last):
     File "/opt/stack/python-neutronclient/neutronclient/shell.py", line 877, in run_subcommand
       return run_command(cmd, cmd_parser, sub_argv)
     File "/opt/stack/python-neutronclient/neutronclient/shell.py", line 113, in run_command
       return cmd.run(known_args)
     File "/opt/stack/python-neutronclient/neutronclient/neutron/v2_0/__init__.py", line 403, in run
       return super(NeutronCommand, self).run(parsed_args)
     File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 79, in run
       column_names, data = self.take_action(parsed_args)
     File "/opt/stack/python-neutronclient/neutronclient/common/extension.py", line 72, in take_action
       return self.execute(parsed_args)
     File "/opt/stack/python-neutronclient/neutronclient/common/extension.py", line 75, in execute
       return super(ClientExtensionCreate, self).take_action(parsed_args)
     File "/opt/stack/python-neutronclient/neutronclient/neutron/v2_0/__init__.py", line 486, in take_action
       data = obj_creator(body)
     File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 1813, in _fx
       return self.create_ext(path, body)
     File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 576, in create_ext
       return self.post(path, body=body)
     File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 347, in post
       headers=headers, params=params)
     File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 282, in do_request
       self._handle_fault_response(status_code, replybody, resp)
     File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 257, in _handle_fault_response
       exception_handler_v20(status_code, error_body)
     File "/opt/stack/python-neutronclient/neutronclient/v2_0/client.py", line 84, in exception_handler_v20
       request_ids=request_ids)
   NotFound: The resource could not be found.<br /><br />

   Neutron server returns request_ids: ['req-b0aa591f-8972-4b04-868a-db5929a6adc0']
   nvo@nvo-PowerEdge-R620:~/devstack_master/devstack$

Revision history for this message
Ravi Shankar S (mailravi02) wrote :

Adding the version used for neutron and openstack

nvo@nvo-PowerEdge-R620:~/devstack_master/devstack$ neutron --version
4.2.1

nvo@nvo-PowerEdge-R620:~/devstack_master/devstack$ openstack --version
openstack 2.4.0

Revision history for this message
vikas (vikas-d-m) wrote :

did your l2gateway agent is connected to ovsdb, which has the physical_switch and physical_port entry?
and this should be populated in neutron db in the respective tables.
please verify.

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.