heroku / legacy-cli

Heroku CLI
https://cli.heroku.com
MIT License
1.37k stars 380 forks source link

error installing heroku toolbelt, bad URI(is not URI?): http://proxy.server.com:portnumber #1866

Open TerryQu3k opened 8 years ago

TerryQu3k commented 8 years ago

Hi, I couldn't install heroku toolbelt

It throws me error saying that bad URI(is not URI?): http://proxy.server.com:portnumber

I paste the error.log

Heroku client internal error.
bad URI(is not URI?): http://proxy.server.com:portnumber
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:66:in `split'
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:72:in `parse'
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/common.rb:226:in `parse'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:430:in `setup_proxy'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:61:in `initialize'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:126:in `new'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:126:in `new'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:229:in `get'
/usr/local/heroku/lib/heroku/jsplugin.rb:209:in `manifest'
/usr/local/heroku/lib/heroku/jsplugin.rb:222:in `url'
/usr/local/heroku/lib/heroku/jsplugin.rb:139:in `setup'
/usr/local/heroku/lib/heroku/cli.rb:24:in `start'
/usr/bin/heroku:25:in `<main>'
Heroku client internal error.
bad URI(is not URI?): http://proxy.server.com:portnumber
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:66:in `split'
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:72:in `parse'
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/common.rb:226:in `parse'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:430:in `setup_proxy'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:61:in `initialize'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:126:in `new'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:126:in `new'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:229:in `get'
/usr/local/heroku/lib/heroku/jsplugin.rb:209:in `manifest'
/usr/local/heroku/lib/heroku/jsplugin.rb:222:in `url'
/usr/local/heroku/lib/heroku/jsplugin.rb:139:in `setup'
/usr/local/heroku/lib/heroku/cli.rb:24:in `start'
/usr/bin/heroku:25:in `<main>'
Heroku client internal error.
bad URI(is not URI?): http://proxy.server.com:portnumber
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:66:in `split'
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/rfc3986_parser.rb:72:in `parse'
/home/jerry/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/uri/common.rb:226:in `parse'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:430:in `setup_proxy'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:61:in `initialize'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:126:in `new'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:126:in `new'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:229:in `get'
/usr/local/heroku/lib/heroku/jsplugin.rb:209:in `manifest'
/usr/local/heroku/lib/heroku/jsplugin.rb:222:in `url'
/usr/local/heroku/lib/heroku/jsplugin.rb:139:in `setup'
/usr/local/heroku/lib/heroku/cli.rb:24:in `start'
/usr/bin/heroku:25:in `<main>'
ransombriggs commented 8 years ago

@TerryQu3k It appears that you are trying to configure an http proxy from these instructions. You need to replace http://proxy.server.com:portnumber with the proxy server configuration your network administrator has given you. Or if you do not have a proxy server, make sure that you do not have the proxy server environment variables set.

rheaditi commented 8 years ago

Hi Guys, I'm facing the same issue. My workplace uses a proxy server. I've configured the proxy according to the instructions mentioned here.

The server I've set up is correct because it works with Git (for windows). I've tried setting them to proxy.server.com:port_number for which I get uninitialized constant Excon::Errors::ProxyParseError (NameError)

And also tried username@proxy.server.com:port_number (which I'm using for Git, and it is working; I get bad URI(is not URI?): username@proxy.server.com:port_number (URI::InvalidURIError) :disappointed:

Any help appreciated.

ransombriggs commented 8 years ago

@rheaditi Could you verify that the proxy server is prefixed with http or https?

rheaditi commented 8 years ago

@ransombriggs Hi, I hadn't tried that. Upon prefixing http:// and https:// respectively to HTTP_PROXY and HTTPS_PROXY I get the following messages:

  1. With username: Error: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (OpenSSL::SSL::SSLError) (Excon::Error::Socket) Command: heroku login HTTP Proxy: http://username@proxy.example.com:80 HTTPS Proxy: https://username@proxy.example.com:80 Version: heroku/toolbelt/3.43.9 (i386-mingw32) ruby/2.1.7
  2. Without username Error: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (OpenSSL::SSL::SSLError) (Excon::Error::Socket) Command: heroku login HTTP Proxy: http://proxy.example.com:80 HTTPS Proxy: https://proxy.example.com:80 Version: heroku/toolbelt/3.43.9 (i386-mingw32) ruby/2.1.7
ransombriggs commented 8 years ago

@rheaditi Does your proxy rewrite certificates? If so, could you try setting SSL_CERT_FILE to the certificate authority provided by your proxy server? Also, looking at your HTTPS_PROXY test, it appears that you manually specified port 80, are you sure that is correct?

rheaditi commented 8 years ago

@ransombriggs

  1. I am not sure about the certificate rewriting & unaware of how to check if it does do that. Although my SSL_CERT_FILE is set to point to a local version of this file as required for Jekyll following this guide.
  2. The port is correct AFAIK as I am using the exact same host, domain & port combination for the proxy settings in git and this works. Removing the port number gives me heroku-cli: Installing CLI... Error: connect_write timeout reached
ransombriggs commented 8 years ago

@rheaditi Could you try unsetting SSL_CERT_FILE temporarily in the command prompt and see if it works then?

rheaditi commented 8 years ago

@ransombriggs I get the same error as before:

Error: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (OpenSSL::SSL::SSLError) (Excon::Error::Socket)
Command: heroku login
HTTP Proxy: http://proxy.example.com:80
HTTPS Proxy: https://proxy.example.com:80
Version: heroku/toolbelt/3.43.9 (i386-mingw32) ruby/2.1.7
ransombriggs commented 8 years ago

@rheaditi I was looking at the jekyll instructions you referenced earlier, and I was wondering if you could test two things for me. Does the test that they suggest work for github & heroku?

ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
ruby -rnet/https -e "Net::HTTP.get URI('https://api.heroku.com')"
rheaditi commented 8 years ago

@ransombriggs So I hadn't tested that in a while, especially not behind the proxy server at work. It doesn't function behind the proxy..

user@machine MINGW64 /c
$ echo $HTTP_PROXY
http://[username]@proxy.server.com:80

user@machine MINGW64 /c
$ echo $HTTPS_PROXY
https://[username]@proxy.server.com:80

user@machine MINGW64 /c
$ ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `initialize': getaddrinfo: No such host is known.  (SocketError)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `open'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `block in connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:878:in `connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:852:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:583:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:478:in `get_response'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:455:in `get'
        from -e:1:in `<main>'

user@machine MINGW64 /c
$ ruby -rnet/http -e "Net::HTTP.get URI('http://github.com')"
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `initialize': getaddrinfo: No such host is known.  (SocketError)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `open'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `block in connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:878:in `connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:852:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:583:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:478:in `get_response'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:455:in `get'
        from -e:1:in `<main>'

user@machine MINGW64 /c
$ echo $SSL_CERT_FILE
C:\Users\[username]\cacert.pem

user@machine MINGW64 /c
$ ruby -rnet/http -e "Net::HTTP.get URI('http://api.heroku.com')"
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `initialize': getaddrinfo: No such host is known.  (SocketError)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `open'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `block in connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:878:in `connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:852:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:583:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:478:in `get_response'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:455:in `get'
        from -e:1:in `<main>'

user@machine MINGW64 /c
$ ruby -rnet/https -e "Net::HTTP.get URI('https://api.heroku.com')"
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `initialize': getaddrinfo: No such host is known.  (SocketError)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `open'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:879:in `block in connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/timeout.rb:73:in `timeout'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:878:in `connect'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:852:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:583:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:478:in `get_response'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/net/http.rb:455:in `get'