Std python neutronclient 2.3.7 module fails to authenticate with contrail-provisioned-keystone

Bug #1367208 reported by Vedamurthy Joshi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R1.1
Fix Committed
High
Ignatious Johnson Christopher
R1.30
Fix Committed
High
Ignatious Johnson Christopher
R2.0
Fix Committed
Undecided
Ignatious Johnson Christopher
Trunk
Fix Committed
High
Ignatious Johnson Christopher

Bug Description

R1.10 34

This is an issue specific to juniper distribution of openstack.
The keystone public_endpoint is left as default causing it be set to http://localhost:5000/

The standard python neutronclient first tries to use the URL derived from public_endpoint and fails.

(.venv)ubuntu@vjoshi-ubuntu-build1:~/jenkins/workspace/havana_Single_node_Tempest$ neutron -v net-list
DEBUG: keystoneclient.session REQ: curl -i -X GET http://10.204.216.47:5000/v2.0/ -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG: keystoneclient.session RESP: [200] {'date': 'Tue, 09 Sep 2014 07:51:24 GMT', 'content-type': 'application/json', 'content-length': '612', 'vary': 'X-Auth-Token', 'connection': 'keep-alive'}
RESP BODY: {"version": {"status": "stable", "updated": "2013-03-06T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}, {"base": "application/xml", "type": "application/vnd.openstack.identity-v2.0+xml"}], "id": "v2.0", "links": [{"href": "http://localhost:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/", "type": "text/html", "rel": "describedby"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf", "type": "application/pdf", "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: neutronclient.neutron.v2_0.network.ListNetwork 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://localhost:5000/v2.0/tokens
ERROR: neutronclient.shell ('Connection aborted.', error(111, 'Connection refused'))
Traceback (most recent call last):
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/shell.py", line 696, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/shell.py", line 90, in run_command
    return cmd.run(known_args)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/common/command.py", line 34, in run
    return super(OpenStackCommand, self).run(parsed_args)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/cliff/display.py", line 91, in run
    column_names, data = self.take_action(parsed_args)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/common/command.py", line 40, in take_action
    return self.get_data(parsed_args)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/neutron/v2_0/__init__.py", line 676, in get_data
    data = self.retrieve_list(parsed_args)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/neutron/v2_0/__init__.py", line 622, in retrieve_list
    neutron_client = self.get_client()
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/neutron/v2_0/__init__.py", line 398, in get_client
    return self.app.client_manager.neutron
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/common/clientmanager.py", line 40, in __get__
    self._handle = self.factory(instance)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/neutron/client.py", line 36, in make_client
    instance.initialize()
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/common/clientmanager.py", line 115, in initialize
    httpclient.authenticate()
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/neutronclient/client.py", line 318, in authenticate
    interface=self.interface)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/session.py", line 497, in get_endpoint
    return auth.get_endpoint(self, **kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/auth/identity/base.py", line 150, in get_endpoint
    service_catalog = self.get_access(session).service_catalog
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/auth/identity/base.py", line 96, in get_access
    self.auth_ref = self.get_auth_ref(session)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/auth/identity/v2.py", line 74, in get_auth_ref
    authenticated=False, log=False)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/session.py", line 398, in post
    return self.request(url, 'POST', **kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/utils.py", line 318, in inner
    return func(*args, **kwargs) File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/session.py", line 324, in request
    resp = self._send_request(url, method, redirect, log, **kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/session.py", line 350, in _send_request
    resp = self.session.request(method, url, **kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/keystoneclient/session.py", line 65, in request
    return requests.request(*args, **kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/sessions.py", line 448, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/sessions.py", line 554, in send
    r = adapter.send(request, **kwargs)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/adapters.py", line 359, in send
    timeout=timeout
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
    _pool=self, _stacktrace=stacktrace)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/retry.py", line 245, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 516, in urlopen
    body=body, headers=headers)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 516, in urlopen
    body=body, headers=headers)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 308, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python2.7/httplib.py", line 958, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 992, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 776, in send
    self.connect()
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 146, in connect
    conn = self._new_conn()
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 125, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/home/ubuntu/jenkins/workspace/havana_Single_node_Tempest/.venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/connection.py", line 87, in create_connection
    raise err
ProtocolError: ('Connection aborted.', error(111, 'Connection refused'))
DEBUG: neutronclient.shell clean_up ListNetwork
DEBUG: neutronclient.shell Got an error: ('Connection aborted.', error(111, 'Connection refused'))
('Connection aborted.', error(111, 'Connection refused'))
(.venv)ubuntu@vjoshi-ubuntu-build1:~/jenkins/workspace/havana_Single_node_Tempest$

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

Reviewed: https://review.opencontrail.org/3528
Committed: http://github.org/Juniper/contrail-provisioning/commit/516cc6a26487675a5d1eb914f390a84bf00e26b6
Submitter: Zuul
Branch: R1.10

commit 516cc6a26487675a5d1eb914f390a84bf00e26b6
Author: Ignatious Johnson <email address hidden>
Date: Tue Oct 7 16:49:49 2014 -0700

Fix bug 1367208
 neutronclient >= 2.3.7 requires public_endpoint and admin_endpoint in the keystone.conf,
 if not defaults to localhost.

Change-Id: I82d6f242161d7c25a8430826bbe01739370bbbc7

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

Reviewed: https://review.opencontrail.org/3624
Committed: http://github.org/Juniper/contrail-provisioning/commit/aa68646697e90c54d02c89810de1a74ea59e141f
Submitter: Zuul
Branch: R1.30

commit aa68646697e90c54d02c89810de1a74ea59e141f
Author: Ignatious Johnson <email address hidden>
Date: Thu Oct 9 14:42:24 2014 -0700

Porting bug fixes 1367208, 1374282 from R1.20 to R1.30.
Fix bug 1367208
 neutronclient >= 2.3.7 requires public_endpoint and admin_endpoint in the keystone.conf,
 if not defaults to localhost.

Fix bug 1374282
Using CONTROLLER instead of locahost for glance and cinder endpoints.

Change-Id: I82d6f242161d7c25a8430826bbe01739370bbbc7

Revision history for this message
Ashish Ranjan (aranjan-n) wrote :

Looking at this file.. The fix seems to be done as part of bigger commit on mainline and is present in R2.0 and trunk.

https://github.com/Juniper/contrail-provisioning/blob/master/contrail_provisioning/openstack/scripts/keystone-server-setup.sh

Marking the scope invalid for 1.20 and trunk.

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.