Ask Your Question

unable to establish connection to localhost

asked 2015-10-06 11:55:53 -0500

faabiioo gravatar image


I have searched for an answer here, but I could not figure out a solution to my problem. I have my project on OpenStack with some instances running. I can easily access them through ssh.

I want to use python SDK to access Openstack APIs, but first I tried with CLI. Following the OpenStack CLI user-guide, I installed today the novel python-openstackclient and others needed. Then I downloaded my and sourced it, and then tried to establish a connection: every command I attempt to execute (openstack service list, openstack image list, glance image-list, etc.) always fails with the same error: ERROR (ConnectionRefused): unable to establish connection to http://localhost:5000/v2.0/tokens.

Am I missing something here? Why is it trying to connect to localhost, even though in my openrc the specified URL is different:

$ echo $OS_AUTH_URL

If I run the command openstack --debug user list I get the following output:

Using parameters {'username': 'USERNAME', 'password': 'PASSWORD', 'project_name': 'PROJECT', 'project_id': 'PROJECT_ID', 'auth_url': ''}
Get auth_ref
REQ: curl -g -i -X GET -H "Accept: application/json" -H "User-Agent: python-openstackclient"
Starting new HTTP connection (1):
"GET /v2.0 HTTP/1.1" 200 612
RESP: [200] Date: Tue, 06 Oct 2015 16:38:00 GMT Vary: X-Auth-Token Content-Length: 612 Content-Type: application/json 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": "", "type": "text/html", "rel": "describedby"}, {"href": "", "type": "application/pdf", "rel": "describedby"}]}}

Making authentication request to http://localhost:5000/v2.0/tokens
Starting new HTTP connection (1): localhost
Request to http://localhost:5000/v2.0/tokens timed out (HTTP 408)
Traceback (most recent call last):

At the beginning it succeeds to connect to the correct address, then in the response body appears this "href": "http://localhost:5000/v2.0/", "rel": "self", and then it makes an authentication request to localhost.

I'm sure I misunderstood some things about configuration and authentication, but I don't seem to find out what. Can someone help me with this trouble?

Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-11-09 07:23:03 -0500

atze.devries gravatar image

updated 2015-11-09 07:28:08 -0500

Having the exact same issue over here. Even if i just run

curl url.of.openstack:5000/v2.0

it returns

{"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": "", "type": "text/html", "rel": "describedby"}, {"href": "", "type": "application/pdf", "rel": "describedby"}]}}%


edit /etc/keystone/keystone.conf


public_endpoint = http://localhost:%(public_port)s/


public_endpoint =
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2015-10-06 09:48:13 -0500

Seen: 5,094 times

Last updated: Nov 09 '15