Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect #118

Open
lukaszkorecki opened this issue Apr 18, 2012 · 6 comments
Open

Can't connect #118

lukaszkorecki opened this issue Apr 18, 2012 · 6 comments

Comments

@lukaszkorecki
Copy link
Contributor

It looks like an EventMachine/SSL problem, somewhat related to this issue.

So I made a little change to ext.rb:

diff --git a/lib/earthquake/ext.rb b/lib/earthquake/ext.rb                           
index 7a8a00d..c6cd966 100644                                                        
--- a/lib/earthquake/ext.rb                                                          
+++ b/lib/earthquake/ext.rb                                                          
@@ -5,12 +5,12 @@ module Twitter                                                     
       @reconnect_callback.call(timeout, @reconnect_retries) if @reconnect_callback  

       if timeout == 0                                                               
-        reconnect @options[:host], @options[:port]                                  
         start_tls if @options[:ssl]                                                 
+        reconnect @options[:host], @options[:port]                                  
       else                                                                          
         EventMachine.add_timer(timeout) do                                          
-          reconnect @options[:host], @options[:port]                                
           start_tls if @options[:ssl]                                               
+          reconnect @options[:host], @options[:port]                                
         end                                                                         
       end                                                                           
     end                                                                             

(before that earthquake would just crash with the same error as in the mentioned EM issue)

...and now I get this:

 │vagrant > lukasz: bin/earthquake [ruby-1.9.3@earthquake]  master ~/Projects/earthquake              
 │                 _   _                       _                                                      
 │  ___  __ _ _ __| |_| |__   __ _ _   _  __ _| | _____                                               
 │ / _ \/ _` | '__| __| '_ \ / _` | | | |/ _` | |/ / _ \                                              
 │|  __/ (_| | |  | |_| | | | (_| | |_| | (_| |   <  __/                                              
 │ \___|\__,_|_|   \__|_| |_|\__, |\__,_|\__,_|_|\_\___|                                              
 │                              |_|               v0.9.0                                              
 │                                                                                                    
 │1) open:                                                                                            
 https://api.twitter.com/oauth/authorize?oauth_token=csNTygR3B5ow8bT4QllWseqLAOABbqmyU9NeGpvcw        
 │Failure in opening                                                                                  
 https://api.twitter.com/oauth/authorize?oauth_token=csNTygR3B5ow8bT4QllWseqLAOABbqmyU9NeGpvcw        
 with                                                                                                 
 │options {}: Unable to find a browser command. If this is unexpected, Please                         
 rerun with environment variable LAUNCHY_DE                                                           
 │BUG=true or the '-d' commandline option and file a bug at                                           
 https://github.com/copiousfreetime/launchy/issues/new                                                
 │2) Enter the PIN: 6174205                                                                           
 │Saving 'token' and 'secret' to '/home/lukasz/.earthquake/config'                                    
 │⚡ earthquake: error: invalid status code: 401.                                                      
 │earthquake: reconnecting in: 10 seconds                                                             
 │earthquake: reconnecting in: 20 seconds                                                             
 │earthquake: reconnecting in: 40 seconds                                                             
 │earthquake: reconnecting in: 80 seconds                                                             
 │earthquake: reconnecting in: 160 seconds                                                            
 │earthquake: reconnecting in: 320 seconds                                                            

OS: Debian Squeeze
Ruby 1.9.3 and 1.9.2
Earthquake version 0.8.5 and up

@pengwynn
Copy link

I've had no luck on 1.9.3. I'm running earthquake on 1.9.2 with a rvm wrapper:

rvm wrapper ruby-1.9.2@earthquake twitter earthquake

@lukaszkorecki
Copy link
Contributor Author

I'm getting the same error on Debian with ruby 1.9.2 (I've updated the main as well). On OSX it works just fine.

@no6v
Copy link
Collaborator

no6v commented Apr 19, 2012

Just FYI, I'm using Debian GNU/Linux unstable (x86_64),
and with ruby-trunk (updating per few days), 1.9.3p125, 1.9.2p290.
Everything works good for me at least with the followings:

  • almost minimal gemset on rvm
  • simplest config (only :token and :secret)
  • no plugins
  • (of cource) master HEAD of earthquake.gem :).

@no6v
Copy link
Collaborator

no6v commented Apr 20, 2012

This occured in (too ?) old environment. Hope this helps.

⚡ earthquake: reconnecting in: 10 seconds
terminate called after throwing an instance of 'std::runtime_error'
  what():  call SetTlsParms before calling StartTls
Aborted
$ ruby1.9.1 -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i486-linux]

@cola-zero
Copy link

I have same problem.
Here is my environments.
https://gist.github.com/2437661

@cola-zero
Copy link

I found the source of this problem.
If version of libssl is 1.0.*, earthquake (EventMachine) can't access to server using https.
Then, the error occurred because it try to reconnect immediately. Notification for reconnecting are shown.

I could fix this error by install openssl via rvm and re-install ruby, as shown in README.
https://gist.github.com/2576093
This is what I did.

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

No branches or pull requests

4 participants