Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-25222

Jenkins does not stay in chatrooms after 1.26 upgrade

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: jabber-plugin
    • Labels:
    • Environment:
      Jenkins 1.565.3 LTS on Windows Server 2008 R2, Jabber 1.26 plugin
    • Similar Issues:

      Description

      After upgrading from Jabber plugin 1.25 to 1.26, our Jenkins server no longer remained logged into the various chatrooms (in our case, HipChat via Jabber/XMPP) for more than a few minutes. The behavior seems to be that it would connect if it had a notification to post (e.g., a build status), but shortly after that would drop offline again, and thus not be available to receive commands (!status, !cb, !botsnack, etc.) that users issued. Upon reconnecting, it would go through all commands issued while it was offline.

      Downgrading to 1.25 has brought back the desired behavior, which was to have Jenkins remain in any chatrooms it has joined and thus be available to receive commands.

        Attachments

          Activity

          medianick Nick Jones created issue -
          Hide
          kutzi kutzi added a comment -

          Can you see something in Jenkins' log file related to this?
          If there's nothing suspicious, would be good if you could enable debug logs (see https://wiki.jenkins-ci.org/display/JENKINS/Jabber+Plugin 'Debugging Problems')

          Show
          kutzi kutzi added a comment - Can you see something in Jenkins' log file related to this? If there's nothing suspicious, would be good if you could enable debug logs (see https://wiki.jenkins-ci.org/display/JENKINS/Jabber+Plugin 'Debugging Problems')
          Hide
          medianick Nick Jones added a comment -

          I'm already logging "hudson.plugins.jabber.im.transport.JabberIMConnection" at the ALL log level, and don't see anything unusual there:

          Trying to connect to XMPP on ******** with SASL
          Rejecting all subscription requests
          Connected to XMPP on ******** using TLS
          Joined groupchat ********

          Show
          medianick Nick Jones added a comment - I'm already logging "hudson.plugins.jabber.im.transport.JabberIMConnection" at the ALL log level, and don't see anything unusual there: Trying to connect to XMPP on ******** with SASL Rejecting all subscription requests Connected to XMPP on ******** using TLS Joined groupchat ********
          Hide
          medianick Nick Jones added a comment -

          @kutzi, do you have any suggestions for other things I can try on 1.26, either to produce more useful logs or to configure it differently? I'm otherwise stuck at 1.25.

          Show
          medianick Nick Jones added a comment - @kutzi, do you have any suggestions for other things I can try on 1.26, either to produce more useful logs or to configure it differently? I'm otherwise stuck at 1.25.
          Hide
          kutzi kutzi added a comment -

          I guess it could have something to do with this:
          http://help.hipchat.com/knowledgebase/articles/64377-xmpp-jabber-support-details
          "Connections are dropped after 150s of inactivity. We suggest sending a single space (" ") as keepalive data every 60 seconds."

          Of course the bot doesn't send a keepalive, as I don't know of any other server which requires this.
          Weird why this seems to work in 1.25

          Show
          kutzi kutzi added a comment - I guess it could have something to do with this: http://help.hipchat.com/knowledgebase/articles/64377-xmpp-jabber-support-details "Connections are dropped after 150s of inactivity. We suggest sending a single space (" ") as keepalive data every 60 seconds." Of course the bot doesn't send a keepalive, as I don't know of any other server which requires this. Weird why this seems to work in 1.25
          Hide
          kutzi kutzi added a comment -

          And you don't see any reconnects in your log file?
          I've just tried to reproduce your issue and see that the bot is disconnected (probably because of the above mentioned timeout), but than immediately reconnecting. Not the desired behaviour of course, but different from what you describe. I see something like this:

          Okt 26, 2014 12:07:54 PM org.jivesoftware.smack.XMPPConnection callConnectionClosedOnErrorListener
          WARNUNG: Connection closed with error
          java.net.SocketException: Connection reset
          at java.net.SocketInputStream.read(SocketInputStream.java:196)
          at java.net.SocketInputStream.read(SocketInputStream.java:122)
          at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
          at sun.security.ssl.InputRecord.read(InputRecord.java:480)
          at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)
          at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:884)
          at sun.security.ssl.AppInputStream.read(AppInputStream.java:102)
          at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
          ...
          INFORMATION: Trying to reconnect
          Okt 26, 2014 12:08:24 PM hudson.plugins.jabber.im.transport.JabberIMConnection createConnection
          INFORMATION: Trying to connect to XMPP on /chat.hipchat.com
          Okt 26, 2014 12:08:30 PM hudson.plugins.jabber.im.transport.JabberIMConnection setupSubscriptionMode
          INFORMATION: Accepting all subscription requests
          Okt 26, 2014 12:08:30 PM hudson.plugins.jabber.im.transport.JabberIMConnection connect
          INFORMATION: Connected to XMPP on null:0/chat.hipchat.com using secure connection
          Okt 26, 2014 12:08:31 PM hudson.plugins.jabber.im.transport.JabberIMConnection connect
          INFORMATION: Joined groupchat xxxx_jenkins@conf.hipchat.com

          Show
          kutzi kutzi added a comment - And you don't see any reconnects in your log file? I've just tried to reproduce your issue and see that the bot is disconnected (probably because of the above mentioned timeout), but than immediately reconnecting. Not the desired behaviour of course, but different from what you describe. I see something like this: Okt 26, 2014 12:07:54 PM org.jivesoftware.smack.XMPPConnection callConnectionClosedOnErrorListener WARNUNG: Connection closed with error java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:196) at java.net.SocketInputStream.read(SocketInputStream.java:122) at sun.security.ssl.InputRecord.readFully(InputRecord.java:442) at sun.security.ssl.InputRecord.read(InputRecord.java:480) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927) at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:884) at sun.security.ssl.AppInputStream.read(AppInputStream.java:102) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) ... INFORMATION: Trying to reconnect Okt 26, 2014 12:08:24 PM hudson.plugins.jabber.im.transport.JabberIMConnection createConnection INFORMATION: Trying to connect to XMPP on /chat.hipchat.com Okt 26, 2014 12:08:30 PM hudson.plugins.jabber.im.transport.JabberIMConnection setupSubscriptionMode INFORMATION: Accepting all subscription requests Okt 26, 2014 12:08:30 PM hudson.plugins.jabber.im.transport.JabberIMConnection connect INFORMATION: Connected to XMPP on null:0/chat.hipchat.com using secure connection Okt 26, 2014 12:08:31 PM hudson.plugins.jabber.im.transport.JabberIMConnection connect INFORMATION: Joined groupchat xxxx_jenkins@conf.hipchat.com
          Hide
          kutzi kutzi added a comment -

          Nick, I've implemented a keep-alive when hipchat.com is used as server.
          Would you like to test ist before I push this as a release?
          https://dl.dropboxusercontent.com/u/25863594/jabber.hpi

          Show
          kutzi kutzi added a comment - Nick, I've implemented a keep-alive when hipchat.com is used as server. Would you like to test ist before I push this as a release? https://dl.dropboxusercontent.com/u/25863594/jabber.hpi
          Hide
          medianick Nick Jones added a comment -

          Thanks! Yes, I'll test it Tuesday, and post results back here.

          Show
          medianick Nick Jones added a comment - Thanks! Yes, I'll test it Tuesday, and post results back here.
          Hide
          medianick Nick Jones added a comment -

          I've just put this custom build in place, and will let you know how it goes.

          Show
          medianick Nick Jones added a comment - I've just put this custom build in place, and will let you know how it goes.
          Hide
          medianick Nick Jones added a comment -

          @kutzi, the release you prepared for me works great. Is this same keepalive in 1.27 (which looks like it fixed the issue with old messages being processed) or will I need to wait for a subsequent release?

          Show
          medianick Nick Jones added a comment - @kutzi, the release you prepared for me works great. Is this same keepalive in 1.27 (which looks like it fixed the issue with old messages being processed) or will I need to wait for a subsequent release?
          Hide
          kutzi kutzi added a comment -

          No it's not in 1.27.
          I'll release 1.28 within the next couple of days

          Show
          kutzi kutzi added a comment - No it's not in 1.27. I'll release 1.28 within the next couple of days
          Hide
          medianick Nick Jones added a comment -

          Fantastic, I'll wait on that to upgrade.

          Show
          medianick Nick Jones added a comment - Fantastic, I'll wait on that to upgrade.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnection.java
          http://jenkins-ci.org/commit/jabber-plugin/cd9eaf5fa28877fc3d2e42339219168ee3f0c0a3
          Log:
          JENKINS-25222 Implement keep-alive for HipChat server

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnection.java http://jenkins-ci.org/commit/jabber-plugin/cd9eaf5fa28877fc3d2e42339219168ee3f0c0a3 Log: JENKINS-25222 Implement keep-alive for HipChat server
          kutzi kutzi made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 159134 ] JNJira + In-Review [ 195995 ]

            People

            Assignee:
            kutzi kutzi
            Reporter:
            medianick Nick Jones
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: