heroku / legacy-cli

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

SSL error on pg:wait #677

Open pvh opened 11 years ago

pvh commented 11 years ago

pvhbook:DoD pvh$ heroku pg:wait -a event-stream Waiting for database HEROKU_POSTGRESQL_CYAN_URL... / preparing ! 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:       SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A (OpenSSL::SSL::SSLError)
Backtrace:   /usr/local/heroku/ruby/lib/ruby/1.9.1/net/http.rb:799:in `connect'
             /usr/local/heroku/ruby/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
             /usr/local/heroku/ruby/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
             /usr/local/heroku/ruby/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
             /usr/local/heroku/ruby/lib/ruby/1.9.1/net/http.rb:799:in `connect'
             /usr/local/heroku/ruby/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
             /usr/local/heroku/ruby/lib/ruby/1.9.1/net/http.rb:744:in `start'
             /usr/local/heroku/vendor/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
             /usr/local/heroku/vendor/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
             /usr/local/heroku/vendor/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
             /usr/local/heroku/vendor/gems/rest-client-1.6.7/lib/restclient/resource.rb:51:in `get'
             /usr/local/heroku/lib/heroku/client/heroku_postgresql.rb:110:in `block (2 levels) in http_get'
             /usr/local/heroku/lib/heroku/helpers.rb:93:in `retry_on_exception'
             /usr/local/heroku/lib/heroku/client/heroku_postgresql.rb:109:in `block in http_get'
             /usr/local/heroku/lib/heroku/client/heroku_postgresql.rb:91:in `checking_client_version'
             /usr/local/heroku/lib/heroku/client/heroku_postgresql.rb:108:in `http_get'
             /usr/local/heroku/lib/heroku/client/heroku_postgresql.rb:70:in `get_wait_status'
             /usr/local/heroku/lib/heroku/command/pg.rb:254:in `block in wait_for'
             /usr/local/heroku/lib/heroku/command/pg.rb:246:in `block in ticking'
             /usr/local/heroku/lib/heroku/command/pg.rb:245:in `loop'
             /usr/local/heroku/lib/heroku/command/pg.rb:245:in `ticking'
             /usr/local/heroku/lib/heroku/command/pg.rb:253:in `wait_for'
             /usr/local/heroku/lib/heroku/command/pg.rb:150:in `block in wait'
             /usr/local/heroku/lib/heroku/command/pg.rb:149:in `each'
             /usr/local/heroku/lib/heroku/command/pg.rb:149:in `wait'
             /usr/local/heroku/lib/heroku/command.rb:207:in `run'
             /Users/pvh/.heroku/plugins/heroku-sudo/lib/heroku/sudo.rb:37:in `run'
             /Users/pvh/.heroku/plugins/heroku-sudo/lib/heroku/command/sudo.rb:30:in `index'
             /usr/local/heroku/lib/heroku/command.rb:207:in `run'
             /usr/local/heroku/lib/heroku/cli.rb:28:in `start'
             /usr/bin/heroku:24:in `<main>'

Command:     heroku pg:wait -a event-stream
Plugins:     heroku-config
             heroku-multikernel
             heroku-orgs
             heroku-otp
             heroku-pg-extras
             heroku-pg-transfer
             heroku-pgupgrade
             heroku-production-check
             heroku-routing
             heroku-snitch
             heroku-values

Version:     heroku-toolbelt/2.34.0 (x86_64-darwin10.8.0) ruby/1.9.3
ddollar commented 11 years ago

This seems to be an issue in the Heroku Postgres client. We should figure out how to avoid duping all of the exception handling from heroku.rb /cc @will @geemus

will commented 11 years ago

I don't get that error, what causes it?

ddollar commented 11 years ago

Looks like an unhandled network exception, probably a timeout?

geemus commented 11 years ago

Seems likely to be socket level, intermittent networking error, though I'm somewhat less familiar with net/http errors. That said, it is coming from rest_client via postgres_client, so it isn't really related to heroku.rb so far as I can tell. It might be worth doing retries on errors like this (alla idempotent flag in excon) to smooth over things, especially if it really is an intermittent timeout.