Discussion:
[Openstack] Using Nova client with SSH SOCKS proxy
Adrian Smith
2014-05-16 15:41:42 UTC
Permalink
To access my controller I need to go through a intermediary box.

I've created a local SOCKS proxy by ssh'ing to this intermediary with
the parameters -D 13392.

I then set the environment variable,
export HTTP_PROXY=http://localhost:13392

But using "nova list" just gives an error,
$ nova list
ERROR: HTTPConnectionPool(host='localhost', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')

Should this work? Am I doing something wrong?

Adrian
Clark, Robert Graham
2014-05-16 16:05:42 UTC
Permalink
Is localhost listed in your /etc/hosts ?

Maybe try with HTTP_PROXY=http://127.0.0.1:13392 - just in case.
Post by Adrian Smith
To access my controller I need to go through a intermediary box.
I've created a local SOCKS proxy by ssh'ing to this intermediary with
the parameters -D 13392.
I then set the environment variable,
export HTTP_PROXY=http://localhost:13392
But using "nova list" just gives an error,
$ nova list
ERROR: HTTPConnectionPool(host='localhost', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')
Should this work? Am I doing something wrong?
Adrian
_______________________________________________
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Adrian Smith
2014-05-16 16:10:42 UTC
Permalink
Yes,

$ grep localhost /etc/hosts
# localhost is used to configure the loopback interface
127.0.0.1 localhost
::1 localhost
fe80::1%lo0 localhost
Post by Clark, Robert Graham
Is localhost listed in your /etc/hosts ?
Maybe try with HTTP_PROXY=http://127.0.0.1:13392 - just in case.
Post by Adrian Smith
To access my controller I need to go through a intermediary box.
I've created a local SOCKS proxy by ssh'ing to this intermediary with
the parameters -D 13392.
I then set the environment variable,
export HTTP_PROXY=http://localhost:13392
But using "nova list" just gives an error,
$ nova list
ERROR: HTTPConnectionPool(host='localhost', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')
Should this work? Am I doing something wrong?
Adrian
_______________________________________________
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Adrian Smith
2014-05-16 16:12:42 UTC
Permalink
I tried with 127.0.0.1 but the same error,

$ nova list
ERROR: HTTPConnectionPool(host='127.0.0.1', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')
Post by Adrian Smith
Yes,
$ grep localhost /etc/hosts
# localhost is used to configure the loopback interface
127.0.0.1 localhost
::1 localhost
fe80::1%lo0 localhost
Post by Clark, Robert Graham
Is localhost listed in your /etc/hosts ?
Maybe try with HTTP_PROXY=http://127.0.0.1:13392 - just in case.
Post by Adrian Smith
To access my controller I need to go through a intermediary box.
I've created a local SOCKS proxy by ssh'ing to this intermediary with
the parameters -D 13392.
I then set the environment variable,
export HTTP_PROXY=http://localhost:13392
But using "nova list" just gives an error,
$ nova list
ERROR: HTTPConnectionPool(host='localhost', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')
Should this work? Am I doing something wrong?
Adrian
_______________________________________________
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Andriy Yurchuk
2014-05-16 16:24:48 UTC
Permalink
Hi!

SOCKS proxy is not an HTTP proxy so setting HTTP_PROXY environment variable won't work. Rather try something like tsocks: http://tsocks.sourceforge.net/index.php
Post by Adrian Smith
Yes,
$ grep localhost /etc/hosts
# localhost is used to configure the loopback interface
127.0.0.1 localhost
::1 localhost
fe80::1%lo0 localhost
Post by Clark, Robert Graham
Is localhost listed in your /etc/hosts ?
Maybe try with HTTP_PROXY=http://127.0.0.1:13392 - just in case.
Post by Adrian Smith
To access my controller I need to go through a intermediary box.
I've created a local SOCKS proxy by ssh'ing to this intermediary with
the parameters -D 13392.
I then set the environment variable,
export HTTP_PROXY=http://localhost:13392
But using "nova list" just gives an error,
$ nova list
ERROR: HTTPConnectionPool(host='localhost', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')
Should this work? Am I doing something wrong?
Adrian
_______________________________________________
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack at lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Adrian Smith
2014-05-16 19:05:55 UTC
Permalink
Thanks guys. I got it working using proxychains (tsocks isn't readily
available under brew on OSX).
Post by Andriy Yurchuk
Hi!
SOCKS proxy is not an HTTP proxy so setting HTTP_PROXY environment variable won't work. Rather try something like tsocks: http://tsocks.sourceforge.net/index.php
Post by Adrian Smith
Yes,
$ grep localhost /etc/hosts
# localhost is used to configure the loopback interface
127.0.0.1 localhost
::1 localhost
fe80::1%lo0 localhost
Post by Clark, Robert Graham
Is localhost listed in your /etc/hosts ?
Maybe try with HTTP_PROXY=http://127.0.0.1:13392 - just in case.
Post by Adrian Smith
To access my controller I need to go through a intermediary box.
I've created a local SOCKS proxy by ssh'ing to this intermediary with
the parameters -D 13392.
I then set the environment variable,
export HTTP_PROXY=http://localhost:13392
But using "nova list" just gives an error,
$ nova list
ERROR: HTTPConnectionPool(host='localhost', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')
Should this work? Am I doing something wrong?
Adrian
_______________________________________________
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack at lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Dean Troyer
2014-05-16 16:17:08 UTC
Permalink
Post by Adrian Smith
To access my controller I need to go through a intermediary box.
I've created a local SOCKS proxy by ssh'ing to this intermediary with
the parameters -D 13392.
I then set the environment variable,
export HTTP_PROXY=http://localhost:13392
But using "nova list" just gives an error,
$ nova list
ERROR: HTTPConnectionPool(host='localhost', port=13392): Max retries
exceeded with url: http://x.x.x.x:5000/v2.0/tokens (Caused by <class
'httplib.BadStatusLine'>: '')
Should this work? Am I doing something wrong?
The nova client lib uses requests/urllib3 for HTTP, they do not support
SOCKS proxies out of the box. There have been some forks/patches to add
that to requests or urllib3, we have not tested those.

dt
--
Dean Troyer
dtroyer at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140516/734c90d2/attachment.html>
Loading...