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

Trouble connecting to HipChat #1144

Closed
1 of 5 tasks
mfin opened this issue Dec 11, 2017 · 5 comments
Closed
1 of 5 tasks

Trouble connecting to HipChat #1144

mfin opened this issue Dec 11, 2017 · 5 comments

Comments

@mfin
Copy link

mfin commented Dec 11, 2017

In order to let us help you better, please fill out the following fields as best you can:

I am...

  • Reporting a bug
  • Suggesting a new feature
  • Requesting help with running my bot
  • Requesting help writing plugins
  • Here about something else

I am running...

  • Errbot version: 5.1.3
  • OS version: Linux mfinzgar 4.14.4-1-ARCH Trivial improvements #1 SMP PREEMPT Tue Dec 5 19:10:06 UTC 2017 x86_64 GNU/Linux
  • Python version: 3.6.3
  • Using a virtual environment: yes

Issue description

I have trouble connecting to HipChat. Below is my configuration file and an error I get.

Steps to reproduce

BOT_ADMINS = ('11111_2222222@chat.hipchat.com')  

BOT_IDENTITY = {
    'username': '11111_3333333@chat.hipchat.com',
    'password': 'thisismypassword',
    'token':'herecomesatoken',
    'server': ('chat.hipchat.com', 5222)
}

CHATROOM_PRESENCE = ('11111_spam_room',)
CHATROOM_FN = 'Errbot'

Additional info

13:57:17 DEBUG    errbot.plugins.Trola      Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.Bitcoin    Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.ACLs       Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.Backup     Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.ChatRoom   Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.CommandNot Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.Flows      Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.Health     Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.Help       Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.Plugins    Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.Utils      Logger for plugin initialized...
13:57:17 DEBUG    errbot.plugins.VersionChe Logger for plugin initialized...
13:57:17 INFO     errbot                    webhooks:  Flag to bind /echo to                           echo
13:57:17 DEBUG    errbot.plugins.Webserver  Logger for plugin initialized...
13:57:17 DEBUG    errbot.bootstrap          Start serving commands from the hipchat backend
13:57:17 DEBUG    sleekxmpp.xmlstream.xmlst Waiting 1.915218741814067 seconds before connecting.
13:57:19 DEBUG    sleekxmpp.xmlstream.resol DNS: Querying chat.hipchat.com for AAAA records.
13:57:19 DEBUG    sleekxmpp.xmlstream.resol DNS: No AAAA records for chat.hipchat.com
13:57:19 DEBUG    sleekxmpp.xmlstream.resol DNS: Querying chat.hipchat.com for A records.
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst Connecting to 52.55.198.252:5222
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: connected
13:57:19 DEBUG    sleekxmpp.thirdparty.stat  ==== TRANSITION disconnected -> connected
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst Starting HANDLER THREAD
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst Loading event runner
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): <stream:stream to='chat.hipchat.com' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <stream:stream version="1.0" from="chat.hipchat.com" id="43ba97e9e7229328">
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls></stream:features>
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls>
13:57:19 DEBUG    sleekxmpp.xmlstream.xmlst RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
13:57:19 DEBUG    sleekxmpp.features.featur Starting TLS
13:57:19 INFO     sleekxmpp.xmlstream.xmlst Negotiating TLS
13:57:19 INFO     sleekxmpp.xmlstream.xmlst Using SSL version: TLSv1
13:57:20 DEBUG    sleekxmpp.xmlstream.xmlst CERT: -----BEGIN CERTIFICATE-----
MIIFQTCCBCmgAwIBAgIQAiPgwGQ6wwaieYWXAri85TANBgkqhkiG9w0BAQsFADBw
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMS8wLQYDVQQDEyZEaWdpQ2VydCBTSEEyIEhpZ2ggQXNz
dXJhbmNlIFNlcnZlciBDQTAeFw0xNzExMDkwMDAwMDBaFw0yMDAxMTUxMjAwMDBa
MFIxCzAJBgNVBAYTAkFVMQ8wDQYDVQQHEwZTeWRuZXkxGjAYBgNVBAoTEUF0bGFz
c2lhbiBQdHkgTHRkMRYwFAYDVQQDDA0qLmhpcGNoYXQuY29tMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAui0EYOtlFN0X3182v7LqsBO1Pq+dbb37PXmd
J8Xu3JHeiOrOe6MNSJ0sIbBR8CS2Apc/HESmoRpg6A7yC5hnC8jqQ+NgdGobamuC
SHMsxnZ0ghlXkdmeCsvYSWLdOL3/vIthm3NoPMCwM9jv6ND0h8PuX8Y9XvKib4El
BsBJzby2pZcp5TrnnOcji+zGBeR9FX35BOPbhWFEEhX8WMLw/LQbbcXrswoZRRm/
Qh7tzya0KQJUFaMMVnF81jDGQlu1lFYNN9lTiuOxkQB+TmemHgETZDnmWjZvnthD
mKiEFz/YDcjAOO3VRo2S1ZWl8r1QzOGTH2vPiI3D1TyaiU9+cQIDAQABo4IB8zCC
Ae8wHwYDVR0jBBgwFoAUUWj/kK8CB3U8zNllZGKiErhZcjswHQYDVR0OBBYEFFty
kx2vGpmJ25q2pcnyIT8PUVNaMCUGA1UdEQQeMByCDSouaGlwY2hhdC5jb22CC2hp
cGNoYXQuY29tMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYI
KwYBBQUHAwIwdQYDVR0fBG4wbDA0oDKgMIYuaHR0cDovL2NybDMuZGlnaWNlcnQu
Y29tL3NoYTItaGEtc2VydmVyLWc2LmNybDA0oDKgMIYuaHR0cDovL2NybDQuZGln
aWNlcnQuY29tL3NoYTItaGEtc2VydmVyLWc2LmNybDBMBgNVHSAERTBDMDcGCWCG
SAGG/WwBATAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2VydC5jb20v
Q1BTMAgGBmeBDAECAjCBgwYIKwYBBQUHAQEEdzB1MCQGCCsGAQUFBzABhhhodHRw
Oi8vb2NzcC5kaWdpY2VydC5jb20wTQYIKwYBBQUHMAKGQWh0dHA6Ly9jYWNlcnRz
LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFNIQTJIaWdoQXNzdXJhbmNlU2VydmVyQ0Eu
Y3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggEBAJsoT8M3gUEwDw4x
jGbFDu3iKLkNREII0QZrVU8qmavywYmh+ghS7yGIPv03F2Tlp1OmuvQPCd4EKkgc
zqmCmvr7nsH5ZJJB1FvUoU2bhUJgN2TPvTpZQjPbunNM/4+M2DFxUGuefAH1Bp0S
kWo3tWH+oUoiMxqlEcySGw7QOhVSYhf8sXHihkkxSERHsPVAEZIGtyrSiM0PxLzR
e7L1OS7ejhKcXLbUT4FFg2z5+6BQVROO0jHB5WJxIBPq5nwHPoyefldhu9LrOnM5
Y7CS3+IABN4LfH4mwJ38pVbRJ8qYRlJcmCAd5vngtc/l1EHtxJTEGwdAIxeXx8pc
ETjO8PI=
-----END CERTIFICATE-----

13:57:20 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: ssl_cert
13:57:20 ERROR    sleekxmpp.basexmpp        time data '171109000000Z' does not match format '%Y%m%d%H%M%SZ'
Traceback (most recent call last):
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
    if not self.__read_xml():
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
    self.__spawn_event(xml)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
    handler.prerun(stanza_copy)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
    self.run(payload, True)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
    if self.xmpp.start_tls():
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 889, in start_tls
    cert.verify(self._expected_server_name, self._der_cert)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 133, in verify
    not_before, not_after = extract_dates(raw_cert)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 111, in extract_dates
    not_before = datetime.strptime(not_before, '%Y%m%d%H%M%SZ')
  File "/usr/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "/usr/lib/python3.6/_strptime.py", line 362, in _strptime
    (data_string, format))
ValueError: time data '171109000000Z' does not match format '%Y%m%d%H%M%SZ'
13:57:20 DEBUG    sleekxmpp.xmlstream.xmlst reconnecting...
13:57:20 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: session_end
13:57:20 DEBUG    sleekxmpp.xmlstream.xmlst SEND (IMMED): </stream:stream>
13:57:20 INFO     sleekxmpp.xmlstream.xmlst Waiting for </stream:stream> from server
13:57:24 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: socket_error
13:57:24 DEBUG    sleekxmpp.xmlstream.xmlst Event triggered: disconnected
@mfin
Copy link
Author

mfin commented Dec 14, 2017

I've been digging deeper and I've come to the conclusion that sleekxmpp==1.3.3 breaks Hipchat support, their certificate reports dates in two digit format. So, I've installed sleekxmpp==1.3.2 and I've come to this.

14:02:36 ERROR    sleekxmpp.basexmpp        <TagSet object at 0x7fca147e4ba8 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7fca1478ab38 tagSet <TagSet object at 0x7fca38f3a320 tags 0:0:4> encoding iso-8859-1>
Traceback (most recent call last):
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1490, in _process
    if not self.__read_xml():
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1562, in __read_xml
    self.__spawn_event(xml)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1630, in __spawn_event
    handler.prerun(stanza_copy)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
    self.run(payload, True)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
    if self.xmpp.start_tls():
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 887, in start_tls
    cert.verify(self._expected_server_name, self._der_cert)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 142, in verify
    cert_names = extract_names(raw_cert)
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/sleekxmpp/xmlstream/cert.py", line 73, in extract_names
    asn1Spec=OctetString())[0]
  File "/home/matjaz/Play/hipchat-bot/env/lib/python3.6/site-packages/pyasn1/codec/ber/decoder.py", line 1318, in __call__
    '%s not in asn1Spec: %r' % (tagSet, asn1Spec)
pyasn1.error.PyAsn1Error: <TagSet object at 0x7fca147e4ba8 tags 0:32:16> not in asn1Spec: <OctetString schema object at 0x7fca1478ab38 tagSet <TagSet object at 0x7fca38f3a320 tags 0:0:4> encoding iso-8859-1>

@zoni
Copy link
Member

zoni commented Dec 21, 2017

That looks like etingof/pyasn1#112. Unfortunately these are bugs in the underlying libraries we use and so not something we can directly fix.

@rah003
Copy link

rah003 commented Dec 26, 2017

I can confirm that downgrading sleekxmpp==1.3.2, pyasn1==0.3.7 and pyasn1-modules==0.1.5 makes everything work again.

@andrewthetechie
Copy link
Contributor

@sijis
Copy link
Contributor

sijis commented Jan 5, 2019

A solution seems present, however, the hipchat service is being shutdown in about 5 weeks.

Atlassian is providing instructions (https://www.atlassian.com/partnerships/slack/migration) how migrate to Slack.

We do have a functional Slack backend to support those organizations migrating.

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

5 participants