justinweiss / robut

A simple plugin-enabled HipChat bot
171 stars 48 forks source link

Can't connect #26

Closed matelich closed 12 years ago

matelich commented 12 years ago

It seems I'm timing out trying to establish the SSL connection.

# Require your plugins here
require 'robut/plugin/twss'
require 'robut/plugin/calc'
require 'robut/plugin/ping'
require 'robut/storage/yaml_store'

# Add the plugin classes to the Robut plugin list.
# Plugins are handled in the order that they appear in this array.
Robut::Plugin.plugins << Robut::Plugin::TWSS
Robut::Plugin.plugins << Robut::Plugin::Calc 
Robut::Plugin.plugins << Robut::Plugin::Ping

# Configure the robut jabber connection and you're good to go!
Robut::Connection.configure do |config|
  # Note that the jid must end with /bot if you don't want robut to 
  # spam the channel, as described by the last bullet point on this 
  # page: https://www.hipchat.com/help/category/xmpp
  config.jid = 'xxx@chat.hipchat.com/bot'
  config.password = 'xxx'
  config.nick = 'xxx'
  config.room = 'xxx@conf.hipchat.com'

  # Some plugins require storage
  Robut::Storage::YamlStore.file = ".robut"
  config.store = Robut::Storage::YamlStore

  # Add a logger if you want to debug the connection
  config.logger = Logger.new(STDOUT)
end
g:\eddynet\projects\dev_utilities\robut>robut
D, [2012-07-02T11:26:23.258337 #13000] DEBUG -- : Debugging mode enabled.
W, [2012-07-02T11:26:23.258337 #13000]  WARN -- : Warnings mode enabled.
D, [2012-07-02T11:26:23.259338 #13000] DEBUG -- : RESOLVING:
    _xmpp-client._tcp.chat.hipchat.com (SRV)
D, [2012-07-02T11:26:24.762424 #13000] DEBUG -- : CONNECTING:
    chat.hipchat.com:5222
D, [2012-07-02T11:26:24.859429 #13000] DEBUG -- : SENDING:
    <stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='chat.hipchat.com' xml:lang=
'en' version='1.0' >
D, [2012-07-02T11:26:24.954435 #13000] DEBUG -- : RECEIVED:
    <stream:stream from='chat.hipchat.com' id='578cb95a5c9985e6' xmlns:stream='http://etherx.jabber.org/streams' version
='1.0' xmlns='jabber:client'/>
D, [2012-07-02T11:26:24.955435 #13000] DEBUG -- : RECEIVED:
    <stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>
D, [2012-07-02T11:26:24.955435 #13000] DEBUG -- : FEATURES: received
D, [2012-07-02T11:26:24.956435 #13000] DEBUG -- : PROCESSING:
    <stream:features xmlns='jabber:client'><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></str
eam:features> (REXML::Element)
D, [2012-07-02T11:26:24.956435 #13000] DEBUG -- : TRYING stanzacbs...
D, [2012-07-02T11:26:24.956435 #13000] DEBUG -- : TRYING message/iq/presence/cbs...
D, [2012-07-02T11:26:24.957435 #13000] DEBUG -- : FEATURES: waiting...
D, [2012-07-02T11:26:24.957435 #13000] DEBUG -- : FEATURES: waiting finished
D, [2012-07-02T11:26:24.958435 #13000] DEBUG -- : SENDING:
    <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
D, [2012-07-02T11:26:25.059441 #13000] DEBUG -- : RECEIVED:
    <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
D, [2012-07-02T11:26:25.060441 #13000] DEBUG -- : TLSv1: OpenSSL handshake in progress
D, [2012-07-02T11:28:55.041019 #13000] DEBUG -- : TLSv1: restarting parser
D, [2012-07-02T11:28:55.041019 #13000] DEBUG -- : SENDING:
    <stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' to='chat.hipchat.com' xml:lang=
'en' version='1.0' >
W, [2012-07-02T11:28:55.042019 #13000]  WARN -- : EXCEPTION:
    Jabber::ServerDisconnected
    Server Disconnected!
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:68:in `block in parse'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `call'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `block in handle'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `each'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `handle'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:95:in `parse'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:79:in `parse'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in `block in start'
W, [2012-07-02T11:28:55.043019 #13000]  WARN -- : Exception caught in Parser thread! (Jabber::ServerDisconnected)
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:68:in `block in parse'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `call'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `block in handle'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `each'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:195:in `handle'
    G:/Ruby193/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:95:in `parse'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:79:in `parse'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in `block in start'
W, [2012-07-02T11:28:55.044019 #13000]  WARN -- : EXCEPTION:
    IOError
    stream closed
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `write'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `<<'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `block in send_data'
    <internal:prelude>:10:in `synchronize'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:344:in `send_data'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:378:in `send'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:88:in `start'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:173:in `starttls'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:109:in `accept_features'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:79:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:57:in `block in connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:55:in `each'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:55:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/lib/robut/connection.rb:118:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/bin/robut:9:in `<top (required)>'
    G:/Ruby193/bin/robut:23:in `load'
    G:/Ruby193/bin/robut:23:in `<main>'
W, [2012-07-02T11:28:55.046019 #13000]  WARN -- : Exception caught while sending! (IOError)
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `write'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `<<'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `block in send_data'
    <internal:prelude>:10:in `synchronize'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:344:in `send_data'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:378:in `send'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:88:in `start'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:173:in `starttls'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:109:in `accept_features'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/connection.rb:79:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:70:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:57:in `block in connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:55:in `each'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:55:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/lib/robut/connection.rb:118:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/bin/robut:9:in `<top (required)>'
    G:/Ruby193/bin/robut:23:in `load'
    G:/Ruby193/bin/robut:23:in `<main>'
D, [2012-07-02T11:28:55.048019 #13000] DEBUG -- : STARTTLS:
    Failure: stream closed
D, [2012-07-02T11:28:55.049019 #13000] DEBUG -- : SENDING:
    <iq id='1189' type='set' xmlns='jabber:client'><query xmlns='jabber:iq:auth'><username>xxx</username><diges
t>7231e1ecba661b473fee5ac3df2b504bd456e513</digest><resource>bot</resource></query></iq>
W, [2012-07-02T11:28:55.050019 #13000]  WARN -- : EXCEPTION:
    IOError
    closed stream
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `write'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `<<'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `block in send_data'
    <internal:prelude>:10:in `synchronize'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:344:in `send_data'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:375:in `send'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:432:in `send_with_id'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:241:in `auth_nonsasl'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:114:in `auth'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/lib/robut/connection.rb:119:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/bin/robut:9:in `<top (required)>'
    G:/Ruby193/bin/robut:23:in `load'
    G:/Ruby193/bin/robut:23:in `<main>'
W, [2012-07-02T11:28:55.051020 #13000]  WARN -- : Exception caught while sending! (IOError)
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `write'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `<<'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `block in send_data'
    <internal:prelude>:10:in `synchronize'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:344:in `send_data'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:375:in `send'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:432:in `send_with_id'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:241:in `auth_nonsasl'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:114:in `auth'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/lib/robut/connection.rb:119:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/bin/robut:9:in `<top (required)>'
    G:/Ruby193/bin/robut:23:in `load'
    G:/Ruby193/bin/robut:23:in `<main>'
D, [2012-07-02T11:28:55.053020 #13000] DEBUG -- : IOError: closed stream
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `write'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `<<'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `block in send_data'
    <internal:prelude>:10:in `synchronize'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:344:in `send_data'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:375:in `send'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:432:in `send_with_id'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:241:in `auth_nonsasl'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:114:in `auth'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/lib/robut/connection.rb:119:in `connect'
    G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/bin/robut:9:in `<top (required)>'
    G:/Ruby193/bin/robut:23:in `load'
    G:/Ruby193/bin/robut:23:in `<main>'
G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:118:in `rescue in auth': closed stream (Jabber::Clie
ntAuthenticationFailure)
        from G:/Ruby193/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:108:in `auth'
        from G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/lib/robut/connection.rb:119:in `connect'
        from G:/Ruby193/lib/ruby/gems/1.9.1/gems/robut-0.3.0/bin/robut:9:in `<top (required)>'
        from G:/Ruby193/bin/robut:23:in `load'
        from G:/Ruby193/bin/robut:23:in `<main>'
matelich commented 12 years ago

Huh, similar complaint at https://github.com/ln/xmpp4r/issues/15

justinweiss commented 12 years ago

Did this ever get resolved for you? I think this is an issue with xmpp4r on Windows.

matelich commented 12 years ago

No I didn't ever figure it out. Then our IT dept rejected our use of Hipchat, so I guess you can close this since I won't be able to test a fix.

Thanks for following up.

On Mon, Sep 24, 2012 at 11:05 AM, Justin Weiss notifications@github.comwrote:

Did this ever get resolved for you? I think this is an issue with xmpp4r on Windows.

— Reply to this email directly or view it on GitHubhttps://github.com/justinweiss/robut/issues/26#issuecomment-8828311.