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

Jabber plugin does not resolve xmpp DNS SRV records correctly (_xmpp-client._tcp, _xmpp-server._tcp)

    XMLWordPrintable

Details

    Description

      We have a setup where user@domain.com addresses should connect to xmpp-client.domain.com server but Jabber plugin seems to ignore the SRV records:

      Y:\>nslookup -type=srv _xmpp-client._tcp.cyfrowypolsat.pl
      Server:  cpdc01.polsatc
      Address:  192.168.81.1
      
      _xmpp-client._tcp.cyfrowypolsat.pl      SRV service location:
                priority       = 5
                weight         = 0
                port           = 5222
                svr hostname   = xmpp-client.cyfrowypolsat.pl
      

      But judging from the Jenkins log, the Jabber plugin tries to connect to cyfrowypolsat.pl:5222 instead of xmpp-client.cyfrowypolsat.pl:5222:

      Jul 29, 2011 11:47:33 AM hudson.plugins.jabber.im.transport.JabberIMConnection connect
      WARNING: Exception of original (without legacy SSL) connection attempt: 
        -- caused by: XMPPError connecting to cyfrowypolsat.pl:5222.: remote-server-error(502) XMPPError connecting to cyfrowypolsat.pl:5222.
        -- caused by: java.net.SocketException: Operation not permitted
      

      I can workaround this bug by setting 'Server' configuration option to 'xmpp-client.cyfrowypolsat.pl' but then Jabber notifier plugin creates wrong Jabber IDs of users for notification purposes: mminicki@xmpp-client.cyfrowypolsat.pl instead of correct mminicki@cyfrowypolsat.pl:

      (...)
      Jabber notifier plugin: Sending notification to: crm@conference.cyfrowypolsat.pl
      Notifying fixers
      Jabber notifier plugin: Sending notification to fixer: mminicki@xmpp-client.cyfrowypolsat.pl
      

      There is a Smack Util for resolving those SRV records:

      http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/smack/util/DNSUtil.html

      Attachments

        1. jabber.hpi
          904 kB
        2. jabber.hpi
          904 kB

        Activity

          kutzi kutzi added a comment -

          Part of the problem is that it was (and still is) possible to specify the Jabber ID in the config without the @xyz part.
          It would be surely better to disallow this, so that the servicename has always to be specified, but then I have to think about how to handle old configurations which don't have that info.

          kutzi kutzi added a comment - Part of the problem is that it was (and still is) possible to specify the Jabber ID in the config without the @xyz part. It would be surely better to disallow this, so that the servicename has always to be specified, but then I have to think about how to handle old configurations which don't have that info.

          Notification looks good now, kutzi. Thanks!

          Sending e-mails to: crm@cyfrowypolsat.pl mminicki@cyfrowypolsat.pl
          Jabber notifier plugin: Notifying suspects
          Jabber notifier plugin: Sending notification to suspect: mminicki@cyfrowypolsat.pl
          Jabber notifier plugin: Notifying culprits
          Finished: FAILURE
          

          PS: That's the last build I will be able to verify as I'm leaving my workplace now. Thanks again.

          valgoerad Michał Minicki added a comment - Notification looks good now, kutzi. Thanks! Sending e-mails to: crm@cyfrowypolsat.pl mminicki@cyfrowypolsat.pl Jabber notifier plugin: Notifying suspects Jabber notifier plugin: Sending notification to suspect: mminicki@cyfrowypolsat.pl Jabber notifier plugin: Notifying culprits Finished: FAILURE PS: That's the last build I will be able to verify as I'm leaving my workplace now. Thanks again.
          kutzi kutzi added a comment -

          Thanks fo testing!
          BTW: I agree that the plugin needs some refactoring - especially in the connection handling part - but I've always feared that I would break existing behaviour with that.

          kutzi kutzi added a comment - Thanks fo testing! BTW: I agree that the plugin needs some refactoring - especially in the connection handling part - but I've always feared that I would break existing behaviour with that.

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnection.java
          src/main/java/hudson/plugins/jabber/im/transport/JabberPublisher.java
          src/main/java/hudson/plugins/jabber/im/transport/JabberPublisherDescriptor.java
          src/test/java/hudson/plugins/jabber/im/transport/JabberServiceNameVsHostNameTest.java
          http://jenkins-ci.org/commit/jabber-plugin/2f2dbb076534a8201452fa41b3183edb79b0f582
          Log:
          [FIXED JENKINS-10523] DNS lookup for Jabber hostname by servicename didn't work

          Compare: https://github.com/jenkinsci/jabber-plugin/compare/59c928c...2f2dbb0

          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 src/main/java/hudson/plugins/jabber/im/transport/JabberPublisher.java src/main/java/hudson/plugins/jabber/im/transport/JabberPublisherDescriptor.java src/test/java/hudson/plugins/jabber/im/transport/JabberServiceNameVsHostNameTest.java http://jenkins-ci.org/commit/jabber-plugin/2f2dbb076534a8201452fa41b3183edb79b0f582 Log: [FIXED JENKINS-10523] DNS lookup for Jabber hostname by servicename didn't work Compare: https://github.com/jenkinsci/jabber-plugin/compare/59c928c...2f2dbb0
          dogfood dogfood added a comment -

          Integrated in plugins_jabber #93
          [FIXED JENKINS-10523] DNS lookup for Jabber hostname by servicename didn't work

          Christoph Kutzinski :
          Files :

          • src/main/java/hudson/plugins/jabber/im/transport/JabberPublisher.java
          • src/test/java/hudson/plugins/jabber/im/transport/JabberServiceNameVsHostNameTest.java
          • src/main/java/hudson/plugins/jabber/im/transport/JabberPublisherDescriptor.java
          • src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnection.java
          dogfood dogfood added a comment - Integrated in plugins_jabber #93 [FIXED JENKINS-10523] DNS lookup for Jabber hostname by servicename didn't work Christoph Kutzinski : Files : src/main/java/hudson/plugins/jabber/im/transport/JabberPublisher.java src/test/java/hudson/plugins/jabber/im/transport/JabberServiceNameVsHostNameTest.java src/main/java/hudson/plugins/jabber/im/transport/JabberPublisherDescriptor.java src/main/java/hudson/plugins/jabber/im/transport/JabberIMConnection.java

          People

            kutzi kutzi
            valgoerad Michał Minicki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: