"IOError: closed stream" error when authenticating on xmpp4r_facebook

453 Views Asked by At

This is quite strange since it used to work, and now it doesn't. If it was 'Not Authorized' error, it would have been easy, but with "IOError: closed stream", I am stumped.

I thought it may have been due to expired token, but access token gets updated whenever user signs in with Facebook.

Since encountering errors, I tried step-by-step and found out it happens when auth_sasl method is called.

1.9.3p194 :073 > c = Jabber::Client.new(Jabber::JID.new("-[FB_ID]@chat.facebook.com"))
[output omitted]
1.9.3p194 :074 > c.connect
[output omitted]
1.9.3p194 :079 > c.is_connected?
=> true 
1.9.3p194 :080 > c.auth_sasl(Jabber::SASL::XFacebookPlatform.new(c, [FB_KEY], [TOKEN], [FB_SECRET]), nil)
IOError: closed stream
    from /Users/yangtheman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:318:in `syswrite'
    from /Users/yangtheman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:318:in `do_write'
    from /Users/yangtheman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:383:in `<<'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `block in send_data'
    from <internal:prelude>:10:in `synchronize'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:344:in `send_data'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:378:in `send'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r_facebook-0.1.1/lib/xmpp4r_facebook.rb:11:in `initialize'
    from (irb):80:in `new'
    from (irb):80
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
1.9.3p194 :081 > c.is_connected?
=> false 

Can anyone please shed some light on why this could be happening? Anyone else having the same or similar problem?

EDIT: I turned on the debug, and the following is the "error" message I received. Again, it seems like many people have the same problem, but there isn't any solution or explanation to the problem I could find. Big :(.

<subject>Sorry, your account isn&apos;t available</subject><body>Your account is temporarily unavailable. Regain access by logging into your account from a web browser.</body></message>

Any help would be much appreciated!

Thanks,

1

There are 1 best solutions below

1
On

Been struggling with the same issue on multiple OS's & clients - definitely server-side issue, but not getting any response from FB on the issue. Issue started presenting after I enabled 2FA in FB - not sure if it's the root-cause. Chat is important, but the little "security" provided by FB is more so.