Trying to
use cf through a proxy, I’m getting the following error. Weird that the initial
CC API request goes through but apparently not the UAA's one. Any Idea ?
C:\code\cf_aprl_2013\vcap-java-client\cloudfoundry-client-lib\target\generated-test-resources>cf -t --debug --http-proxy http://127.0.0.1:3128 --https-proxy=http://127.0.0.1:3128 login
target: http://api.run.pivotal.io
>>>
REQUEST: GET http://api.run.pivotal.io/info
REQUEST_HEADERS:
Accept : application/json
Content-Length : 0
RESPONSE: [200]
RESPONSE_HEADERS:
age : 0
cache-control : proxy-revalidate
connection : Keep-Alive
content-length : 258
content-type : application/json;charset=utf-8
date : Wed, 19 Jun 2013 15:05:33 GMT
proxy-connection : Keep-Alive
server : nginx
x-frame-options : sameorigin
x-vcap-request-id : afe1d1d9-e9ba-4302-96bd-e4ae95377c77
x-xss-protection : 1; mode=block
RESPONSE_BODY:
{
"name": "vcap",
"build": "2222",
"support": "http://support.cloudfoundry.com",
"version": 2,
"description": "Cloud Foundry sponsored by Pivotal",
"authorization_endpoint": "https://login.run.pivotal.io",
"token_endpoint": "https://uaa.run.pivotal.io",
"allow_debug": true
}
<<<
CF::UAA::BadTarget: error: getaddrinfo: Hote inconnu.
For more information, see ~/.cf/crash
c:/RubyHome/gems/cf-uaa-lib-1.3.10/lib/uaa/http.rb:161:in `rescue in net_http_request': error: getaddrinfo: H¶te inconnu
. (CF::UAA::BadTarget)
from c:/RubyHome/gems/cf-uaa-lib-1.3.10/lib/uaa/http.rb:141:in `net_http_request'
from c:/RubyHome/gems/cf-uaa-lib-1.3.10/lib/uaa/http.rb:129:in `request'
from c:/RubyHome/gems/cf-uaa-lib-1.3.10/lib/uaa/http.rb:111:in `http_get'
from c:/RubyHome/gems/cf-uaa-lib-1.3.10/lib/uaa/http.rb:81:in `json_get'
from c:/RubyHome/gems/cf-uaa-lib-1.3.10/lib/uaa/misc.rb:58:in `server'
from c:/RubyHome/gems/cfoundry-2.1.0/lib/cfoundry/uaaclient.rb:16:in `block in prompts'
from c:/RubyHome/gems/cfoundry-2.1.0/lib/cfoundry/uaaclient.rb:127:in `wrap_uaa_errors'
from c:/RubyHome/gems/cfoundry-2.1.0/lib/cfoundry/uaaclient.rb:15:in `prompts'
from c:/RubyHome/gems/cfoundry-2.1.0/lib/cfoundry/concerns/login_helpers.rb:6:in `login_prompts'
from c:/RubyHome/gems/cf-3.0.0/lib/cf/cli/start/login.rb:24:in `login'
from c:/RubyHome/gems/mothership-0.5.1/lib/mothership/base.rb:66:in `run'
from c:/RubyHome/gems/mothership-0.5.1/lib/mothership/command.rb:72:in `block in invoke'
from c:/RubyHome/gems/mothership-0.5.1/lib/mothership/command.rb:86:in `instance_exec'
from c:/RubyHome/gems/mothership-0.5.1/lib/mothership/command.rb:86:in `invoke'
from c:/RubyHome/gems/mothership-0.5.1/lib/mothership/base.rb:55:in `execute'
from c:/RubyHome/gems/cf-3.0.0/lib/cf/cli.rb:156:in `block (2 levels) in execute'
from c:/RubyHome/gems/cf-3.0.0/lib/cf/cli.rb:163:in `save_token_if_it_changes'
from c:/RubyHome/gems/cf-3.0.0/lib/cf/cli.rb:155:in `block in execute'
from c:/RubyHome/gems/cf-3.0.0/lib/cf/cli.rb:101:in `wrap_errors'
from c:/RubyHome/gems/cf-3.0.0/lib/cf/cli.rb:151:in `execute'
from c:/RubyHome/gems/mothership-0.5.1/lib/mothership.rb:45:in `start'
from c:/RubyHome/gems/cf-3.0.0/bin/cf:13:in `<top (required)>'
from c:/RubyHome/bin/cf:23:in `load'
from c:/RubyHome/bin/cf:23:in `<main>'
Errno::ENOENT: No such file or directory - getaddrinfoFor more information, see ~/.cf/crashhoracio, i recommend a platform neutral ruby tool like rbenv that is able to download and install ruby 2.0 for you. if ruby 2.0 worked around the proxy issue on windows, there is a good chance it will work on ubuntu too.
here is one that has been tried on ubuntu 10.04. note the comments for issues that still need to be worked around.
https://gist.github.com/jnx/1256593
here is a series of steps for 12.04:
http://www.stehem.net/2012/05/08/how-to-install-ruby-with-rbenv-on-ubuntu-12-04.html
once you have rbenv installed, then you can install an rbenv plugin like ruby-build that will download updated versions of ruby for you. https://github.com/sstephenson/ruby-build.
for example, on my system:
jamesbayer$ rbenv install -list
Available versions:
1.8.6-p383
1.8.6-p420
1.8.7-p249
1.8.7-p302
1.8.7-p334
1.8.7-p352
1.8.7-p357
1.8.7-p358
1.8.7-p370
1.8.7-p371
1.9.1-p378
1.9.1-p430
1.9.2-p0
1.9.2-p180
1.9.2-p290
1.9.2-p318
1.9.2-p320
1.9.3-dev
1.9.3-p0
1.9.3-p125
1.9.3-p194
1.9.3-p286
1.9.3-p327
1.9.3-p362
1.9.3-p374
1.9.3-p385
1.9.3-p392
1.9.3-p429
1.9.3-preview1
1.9.3-rc1
2.0.0-dev
2.0.0-p0
2.0.0-p195
2.0.0-preview1
2.0.0-preview2
2.0.0-rc1
2.0.0-rc2
2.1.0-dev
jruby-1.5.6
jruby-1.6.3
jruby-1.6.4
jruby-1.6.5
jruby-1.6.5.1
jruby-1.6.6
jruby-1.6.7
jruby-1.6.7.2
jruby-1.6.8
jruby-1.7.0
jruby-1.7.0-preview1
jruby-1.7.0-preview2
jruby-1.7.0-rc1
jruby-1.7.0-rc2
jruby-1.7.1
jruby-1.7.2
jruby-1.7.3
jruby-1.7.4
maglev-1.0.0
maglev-1.1.0-dev
mruby-dev
rbx-1.2.4
rbx-2.0.0-dev
rbx-2.0.0-rc1
ree-1.8.6-2009.06
ree-1.8.7-2009.09
ree-1.8.7-2009.10
ree-1.8.7-2010.01
ree-1.8.7-2010.02
ree-1.8.7-2011.03
ree-1.8.7-2011.12
ree-1.8.7-2012.01
ree-1.8.7-2012.02
topaz-dev
jamesbayer$ rbenv install 2.0.0-p195
Downloading ruby-2.0.0-p195.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p195.tar.gz
...
then once the ruby is installed, then:
rbenv rehash
rbenv system 2.0.0-p195
ruby --version
let us know if this works please, we want to update our proxy instructions for everyone.
horacio@horacioXXXXXXX:$ ruby --version
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]horacio@horacioXXXXXXX:$ cf login Errno::ENOENT: No such file or directory - getaddrinfoFor more information, see ~/.cf/crashcf-3.0.0/lib/cf/cli.rb:288:in `initialize'
cf-3.0.0/lib/cf/cli.rb:288:in `new'
cf-3.0.0/lib/cf/cli.rb:288:in `sane_target_url'
cf-3.0.0/lib/cf/cli.rb:309:in `client_target'
cf-3.0.0/lib/cf/cli.rb:377:in `client'
cf-3.0.0/lib/cf/cli.rb:163:in `save_token_if_it_changes'
cf-3.0.0/lib/cf/cli.rb:155:in `block in execute'
cf-3.0.0/lib/cf/cli.rb:101:in `wrap_errors'
cf-3.0.0/lib/cf/cli.rb:151:in `execute'
mothership-0.5.1/lib/mothership.rb:45:in `start'
cf-3.0.0/bin/cf:13:in `<top (required)>'
/usr/local/bin/cf:23:in `load'
/usr/local/bin/cf:23:in `<main>
The " use of a proxy server for handling cf requests " issue has been resolved and to the obtain this fix , please install or upgrade to the latest CF gem using ' gem update cf / gem install cf ' .
As Marie documented here : http://docs.cloudfoundry.com/docs/using/managing-apps/cf/index.html#proxy
You can specify both --http-proxy and --https-proxy to ensure that all communication associated with a cf command can be completed via the proxy server.
For example, to run the cf apps command behind a proxy server, enter this command, substituting the appropriate URLs:
cf apps --http-proxy myproxy.myproxydomain:8080 --https-proxy myproxy.myproxydomain:443
If your proxy server requires a username and password, to run the cf apps command behind a proxy server, enter this command,substituting the appropriate URLs, your username, and your password:
cf apps --http-proxy myusername:mypassword@myproxy.myproxydomain:8080 --https-proxy username:password@myproxy.myproxydomain:443
Instead of api.run.pivotal.io as seen below.
cf apps --http-proxy myproxy.myproxydomain:8080 --https-proxy myproxy.myproxydomain:443
As suggested in my previous comment, I would test to understand if the proxy setup is working before posting a bug. Here are a few test cases that you can try:
1. Try to ping ' google.com ' and check if you are getting a response.
2. Do a tra
" Based on the error message below, I believe that this might be a network issue. Once the proxy settings are set in your system, Can you test to see if any of your requests are going through the proxy server and verify if the proxy server is able to reach the internet. you can also try doing a tcpdump or a wireshark capture to analyze the network traffic appropriately.
I believe these steps will help you do a sanity check of your proxy setup and once all of this works then you can narrow down the issue to 'cf' and open a bug.
Thanks,
Bala