Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

'Installing Heroku Toolbelt v4' fails #1758

Closed
gmahajan31 opened this issue Oct 1, 2015 · 19 comments
Closed

'Installing Heroku Toolbelt v4' fails #1758

gmahajan31 opened this issue Oct 1, 2015 · 19 comments

Comments

@gmahajan31
Copy link

When I run the heroku command, it is trying to update the heroku toolbelt to v4. But it fails with a timeout exception. Here is a complete log.

$ heroku
Installing Heroku Toolbelt v4...heroku login ! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       connect timeout reached (Excon::Errors::Timeout)
Command:     heroku update
Version:     heroku-toolbelt/3.42.15 (x86_64-darwin10.8.0) ruby/1.9.3
Error ID:    87c0baba236b40679ff8217bffa33ee7


More information in /Users/abc/.heroku/error.log

Can someone guide me on what steps to take?

@learning
Copy link

learning commented Oct 7, 2015

I got this error too.

Error:       read timeout reached (Excon::Errors::Timeout)
Command:     heroku login
Version:     heroku-toolbelt/3.42.15 (x86_64-darwin10.8.0) ruby/1.9.3
Error ID:    da10bfd8f16540959bc4d102e5965ddb

error log:

Heroku client internal error.
read timeout reached
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/socket.rb:299:in `raise_timeout_error'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/socket.rb:178:in `rescue in read_nonblock'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/socket.rb:165:in `read_nonblock'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/socket.rb:35:in `read'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/response.rb:140:in `parse'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/middlewares/response_parser.rb:6:in `response_call'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:372:in `response'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb:236:in `request'
/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb:229:in `get'
/usr/local/heroku/lib/heroku/jsplugin.rb:129:in `setup'
/usr/local/heroku/lib/heroku/cli.rb:23:in `start'
/usr/local/bin/heroku:24:in `<main>'

And I try to debug it...

# Generic non-persistent HTTP methods
HTTP_VERBS.each do |method|
  module_eval <<-DEF, __FILE__, __LINE__ + 1
    def #{method}(url, params = {}, &block)
      puts url # print the url
      new(url, params).request(:method => :#{method}, &block)
    end
  DEF
end

I found this url cause the error:
https://api.rollbar.com/api/1/item/

The params body is

{
  "access_token": "488f0c3af3d6450cb5b5827c8099dbff",
  "data": {
    "platform": "client",
    "environment": "production",
    "code_version": "3.42.15",
    "client": {
      "platform": "x86_64-darwin10.8.0",
      "ruby": "1.9.3"
    },
    "request": {
      "command": "login"
    },
    "body": {
      "trace": {
        "frames": [{
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/ssl_socket.rb",
          "lineno": 120,
          "method": "connect_nonblock"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/ssl_socket.rb",
          "lineno": 120,
          "method": "initialize"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb",
          "lineno": 387,
          "method": "new"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb",
          "lineno": 387,
          "method": "socket"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb",
          "lineno": 106,
          "method": "request_call"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/middlewares/decompress.rb",
          "lineno": 11,
          "method": "request_call"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/middlewares/mock.rb",
          "lineno": 47,
          "method": "request_call"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/middlewares/instrumentor.rb",
          "lineno": 22,
          "method": "request_call"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/middlewares/base.rb",
          "lineno": 15,
          "method": "request_call"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/middlewares/base.rb",
          "lineno": 15,
          "method": "request_call"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/middlewares/base.rb",
          "lineno": 15,
          "method": "request_call"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon/connection.rb",
          "lineno": 233,
          "method": "request"
        }, {
          "filename": "/usr/local/heroku/vendor/gems/excon-0.45.4/lib/excon.rb",
          "lineno": 231,
          "method": "get"
        }, {
          "filename": "/usr/local/heroku/lib/heroku/jsplugin.rb",
          "lineno": 129,
          "method": "setup"
        }, {
          "filename": "/usr/local/heroku/lib/heroku/cli.rb",
          "lineno": 23,
          "method": "start"
        }, {
          "filename": "/usr/local/bin/heroku",
          "lineno": 24,
          "method": "<main>"
        }],
        "exception": {
          "class": "Excon::Errors::SocketError",
          "message": "SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (OpenSSL::SSL::SSLError)"
        }
      }
    }
  }
}

There's no connection problem when access to https://api.rollbar.com/api/1/item/

$ curl https://api.rollbar.com/api/1/item/
{
  "err": 1,
  "message": "access token required"
}%

@jdx
Copy link
Contributor

jdx commented Oct 8, 2015

There should be a 60 second timeout when connecting. Is it taking that long?

@learning
Copy link

learning commented Oct 9, 2015

Yes, every time is timeout, toolbelt 3.42.15 works well, but what's wrong with v4?

@learning
Copy link

learning commented Oct 9, 2015

Hey @gmahajan31 , I add this to /usr/local/heroku/lib/heroku/jsplugin.rb before line 129, and now toolbelt v4 has been installed.

Excon.defaults[:read_timeout] = 3600

@jdx
Copy link
Contributor

jdx commented Oct 9, 2015

I suppose I could increase the timeout a bit, but that's a pretty high time. Any idea how long it took to connect on your connection? This file is served over cloudfront so it's a bit strange it took that long.

@jdx
Copy link
Contributor

jdx commented Oct 9, 2015

You could run time curl https://cli-assets.heroku.com/master/4.25.2-beb750a/darwin/amd64/heroku-cli > /dev/null

@learning
Copy link

Maybe it's cause by cloudfront? Are they deploy some nodes in China or Asia? My location is Beijing, China.

But, toolbelt v3 works fine...

time curl https://cli-assets.heroku.com/master/4.25.2-beb750a/darwin/amd64/heroku-cli > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8183k  100 8183k    0     0   464k      0  0:00:17  0:00:17 --:--:--  606k
curl  > /dev/null  0.06s user 0.08s system 0% cpu 17.643 total

@jdx
Copy link
Contributor

jdx commented Oct 10, 2015

The next release will have a longer timeout for this request

@TimAstier
Copy link

I am also in Beijing, China and have the same timeout error
Edit: It worked this morning

@jdx jdx closed this as completed Oct 13, 2015
@jdx
Copy link
Contributor

jdx commented Oct 13, 2015

Timeout increased

@saadbinakhlaq
Copy link

I am still getting this error, I have increased the timeout but still there are errors, I did increase the timeout in jsplugin.rb file, but no success

    opts = excon_opts.merge(
      :middlewares  => Excon.defaults[:middlewares] + [Excon::Middleware::Decompress],
      :read_timeout => 3600,
    )

@jdx
Copy link
Contributor

jdx commented Oct 16, 2015

Is it taking a full hour?

@saadbinakhlaq
Copy link

Hey @dickeyxxx I tried once again and finally it did get upgraded. Thanks

@liango2
Copy link

liango2 commented Dec 7, 2015

I am in Nanjing, China and I got this error too.

F:\l\c\c\c>heroku create --stack cedar
heroku-cli: Installing Toolbelt v4...connect timeout reached
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/socket.rb:139:in `rescue in block in connect'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/socket.rb:119:in `block in connect'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/socket.rb:110:in `each'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/socket.rb:110:in `connect'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/ssl_socket.rb:148:in `connect'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/socket.rb:28:in `initialize'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/ssl_socket.rb:8:in `initialize'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/connection.rb:387:in `new'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/connection.rb:387:in `socket'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/connection.rb:106:in `request_call'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/middlewares/mock.rb:47:in `request_call'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/middlewares/base.rb:15:in `request_call'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/middlewares/base.rb:15:in `request_call'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/middlewares/base.rb:15:in `request_call'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon/connection.rb:233:in `request'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.45.4/lib/excon.rb:229:in `get'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/heroku-3.42.24/lib/heroku/jsplugin.rb:231:in `manifest'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/heroku-3.42.24/lib/heroku/jsplugin.rb:244:in `url'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/heroku-3.42.24/lib/heroku/jsplugin.rb:139:in `setup'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/heroku-3.42.24/lib/heroku/cli.rb:24:in `start'
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/heroku-3.42.24/bin/heroku:17:in `<top (required)>'
C:/RailsInstaller/Ruby2.1.0/bin/heroku:23:in `load'
C:/RailsInstaller/Ruby2.1.0/bin/heroku:23:in `<main>'
 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       connect timeout reached (Excon::Errors::Timeout)
    Command:     heroku create --stack cedar
    HTTP Proxy:  http://localhost:8580
    Version:     heroku-gem/3.42.24 (i386-mingw32) ruby/2.1.5


    More information in C:/Users/liango/.heroku/error.log

@neekey
Copy link

neekey commented Jan 5, 2016

Location Hangzhou China, seems like it needs hours to download:

time curl https://cli-assets.heroku.com/master/4.25.2-beb750a/darwin/amd64/heroku-cli > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 8183k    0 51814    0     0    433      0  5:22:33  0:01:59  5:20:34     0

@jdx
Copy link
Contributor

jdx commented Jan 5, 2016

There isn't anything we can do to deliver that file more quickly, it's already served by a CDN.

@rneha725
Copy link

rneha725 commented Apr 7, 2016

Delhi, India
Same error:

Error: connect timeout reached (Excon::Errors::Timeout)
Command: heroku login
HTTP Proxy: http://172.6.1.1:8080
HTTPS Proxy: https://172.6.1.1:8080
Version: heroku/toolbelt/3.42.45 (i386-mingw32) ruby/2.1.7

@saadbinakhlaq
Copy link

@rneha725 did you increate the timeout in jsplugin.rb

    opts = excon_opts.merge(
      :middlewares  => Excon.defaults[:middlewares] + [Excon::Middleware::Decompress],
      :read_timeout => 3600,
    )

@ransombriggs
Copy link
Contributor

@rneha725 If increasing the timeout does not help, you may want to have your sysadmin check your proxy logs, the proxy server is another place at which this could happen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants