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

jabber-plugin 1.28 cannot resolve host with javax.naming.NameNotFoundException: DNS name not found

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • jabber-plugin
    • None
    • os: debian 7
      jenkins: 1.587

      i upgrade jenkins from 1.535 to 1.587 but cannot send jabber message
      System log is:

      Nov 08, 2014 10:21:57 AM WARNING hudson.plugins.jabber.im.transport.JabberIMConnection createConnection
      org.jivesoftware.smack.SmackException: javax.naming.NameNotFoundException: DNS name not found [response code 3]; remaining name '_xmpp-client._tcp.jabber.peykasa.ir'
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:405)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:811)
      at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:396)
      at hudson.plugins.jabber.im.transport.JabberIMConnection.createConnection(JabberIMConnection.java:409)
      at hudson.plugins.jabber.im.transport.JabberIMConnection.connect(JabberIMConnection.java:189)
      at hudson.plugins.jabber.im.transport.JabberIMConnectionProvider.createConnection(JabberIMConnectionProvider.java:42)
      at hudson.plugins.im.IMConnectionProvider.create(IMConnectionProvider.java:65)
      at hudson.plugins.im.IMConnectionProvider.access$600(IMConnectionProvider.java:22)
      at hudson.plugins.im.IMConnectionProvider$ConnectorRunnable.run(IMConnectionProvider.java:183)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: javax.naming.NameNotFoundException: DNS name not found [response code 3]; remaining name '_xmpp-client._tcp.jabber.peykasa.ir'
      at com.sun.jndi.dns.DnsClient.checkResponseCode(DnsClient.java:651)
      at com.sun.jndi.dns.DnsClient.isMatchResponse(DnsClient.java:569)
      at com.sun.jndi.dns.DnsClient.doUdpQuery(DnsClient.java:418)
      at com.sun.jndi.dns.DnsClient.query(DnsClient.java:207)
      at com.sun.jndi.dns.Resolver.query(Resolver.java:81)
      at com.sun.jndi.dns.DnsContext.c_getAttributes(DnsContext.java:434)
      at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(ComponentDirContext.java:235)
      at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:141)
      at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:129)
      at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:142)
      at org.jivesoftware.smack.util.dns.javax.JavaxResolver.lookupSRVRecords(JavaxResolver.java:83)
      at org.jivesoftware.smack.util.DNSUtil.resolveDomain(DNSUtil.java:153)
      at org.jivesoftware.smack.util.DNSUtil.resolveXMPPDomain(DNSUtil.java:111)
      at org.jivesoftware.smack.ConnectionConfiguration.maybeResolveDns(ConnectionConfiguration.java:600)
      at org.jivesoftware.smack.XMPPConnection.maybeResolveDns(XMPPConnection.java:573)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:402)
      ... 9 more

          [JENKINS-25505] jabber-plugin 1.28 cannot resolve host with javax.naming.NameNotFoundException: DNS name not found

          kutzi added a comment -

          What are the previous and current version of the jabber-plugin (the plugin doesn't get automatically updated if Jenkins is)?
          Is _xmpp-client._tcp.jabber.peykasa.ir the correct name of your Jabber server? What happens if you try to resolve the name (i.e. nslookup) from the shell on the Jenkins host?

          kutzi added a comment - What are the previous and current version of the jabber-plugin (the plugin doesn't get automatically updated if Jenkins is)? Is _xmpp-client._tcp.jabber.peykasa.ir the correct name of your Jabber server? What happens if you try to resolve the name (i.e. nslookup) from the shell on the Jenkins host?

          jabber-plugin version is 1.28
          The jabber server address is jabber.peykasa.ir
          and _xmpp-client._tcp.jabber.peykasa.ir cannot be resolved by using ping command.
          Below response belongs to ping command:

          "ping _xmpp-client._tcp.jabber.peykasa.ir
          ping: unknown host _xmpp-client._tcp.jabber.peykasa.ir"

          I'm pretty sure this problem has happened after upgrading jenkins to this version.
          So I will be thankful if you consider this issue and try to solve my problem though.

          Thanks in advance.

          Mohammad Biabani added a comment - jabber-plugin version is 1.28 The jabber server address is jabber.peykasa.ir and _xmpp-client._tcp.jabber.peykasa.ir cannot be resolved by using ping command. Below response belongs to ping command: "ping _xmpp-client._tcp.jabber.peykasa.ir ping: unknown host _xmpp-client._tcp.jabber.peykasa.ir" I'm pretty sure this problem has happened after upgrading jenkins to this version. So I will be thankful if you consider this issue and try to solve my problem though. Thanks in advance.

          kutzi added a comment -

          I'd suspect that the DNS SRV setup for your XMPP server might not be correct. Check e.g. http://blog.teemu.im/2008/12/14/setting-your-srv-records-straight-for-xmpp/

          Have you ruled out that nothing else in the infrastructure has changed?
          Can you connect with a different XMPP client from the Jenkins host?

          kutzi added a comment - I'd suspect that the DNS SRV setup for your XMPP server might not be correct. Check e.g. http://blog.teemu.im/2008/12/14/setting-your-srv-records-straight-for-xmpp/ Have you ruled out that nothing else in the infrastructure has changed? Can you connect with a different XMPP client from the Jenkins host?

          kutzi added a comment -

          Also possible that Smack API 4.x broke something which was working previously...
          Does maybe your Jabber server use the older _jabber._tcp. name?
          This seems to be broken in Smack 4.x. See https://github.com/igniterealtime/Smack/commit/2eb13f48d2a72af9f0e88c5b2d8a9881a655fa1b#commitcomment-8506196

          kutzi added a comment - Also possible that Smack API 4.x broke something which was working previously... Does maybe your Jabber server use the older _jabber._tcp. name? This seems to be broken in Smack 4.x. See https://github.com/igniterealtime/Smack/commit/2eb13f48d2a72af9f0e88c5b2d8a9881a655fa1b#commitcomment-8506196

          kutzi added a comment -

          kutzi added a comment - Smack issue tracked in https://igniterealtime.org/issues/browse/SMACK-616

          kutzi added a comment -

          This build of the plugin uses a version of the Smack library which could fix the issue:
          https://dl.dropboxusercontent.com/u/25863594/jabber.hpi

          Would be great if you could test it

          kutzi added a comment - This build of the plugin uses a version of the Smack library which could fix the issue: https://dl.dropboxusercontent.com/u/25863594/jabber.hpi Would be great if you could test it

          kutzi added a comment -

          Mohammad, any update on this?
          If you don't have the time/resources to test it, please let me at least know.

          kutzi added a comment - Mohammad, any update on this? If you don't have the time/resources to test it, please let me at least know.

          Rafael Pivetta Balbuena added a comment - - edited

          Kutzi,
          I am using smack 4.0.5 in my project, and tested jars of version 4.0.6-SNAPSHOT and worked.

          But, using openfire is required to disable the security in code, because I dont know how to disable security in openfire 3.9.3

          Example works fine.
          ConnectionConfiguration config = new ConnectionConfiguration ("localhost");
          config.setSecurityMode (SecurityMode.disabled);
          XMPPConnection con = new XMPPTCPConnection (config);
          con.connect();

          Anyone have an example of how to generate and import certificate in openfire or other xmpp server and a code sample using SSL and Smack?

          The code and exception:
          XMPPConnection con = new XMPPTCPConnection ("localhost");
          con.connect();

          WARNING: Exception while resovling SRV records for localhost. Consider adding '_xmpp-(server|client)._tcp' DNS SRV Records
          javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
          Nov 23, 2014 10:40:05 PM org.jivesoftware.smack.tcp.PacketWriter writePackets
          WARNING: Exception writing closing stream element
          java.net.SocketException: Socket closed
          at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:121)
          at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
          at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
          at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
          at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
          at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
          at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
          at java.io.BufferedWriter.flush(BufferedWriter.java:254)
          at org.jivesoftware.smack.tcp.PacketWriter.writePackets(PacketWriter.java:190)
          at org.jivesoftware.smack.tcp.PacketWriter.access$000(PacketWriter.java:40)
          at org.jivesoftware.smack.tcp.PacketWriter$1.run(PacketWriter.java:77)

          Thanks.

          Rafael Pivetta Balbuena added a comment - - edited Kutzi, I am using smack 4.0.5 in my project, and tested jars of version 4.0.6-SNAPSHOT and worked. But, using openfire is required to disable the security in code, because I dont know how to disable security in openfire 3.9.3 Example works fine. ConnectionConfiguration config = new ConnectionConfiguration ("localhost"); config.setSecurityMode (SecurityMode.disabled); XMPPConnection con = new XMPPTCPConnection (config); con.connect(); Anyone have an example of how to generate and import certificate in openfire or other xmpp server and a code sample using SSL and Smack? The code and exception: XMPPConnection con = new XMPPTCPConnection ("localhost"); con.connect(); WARNING: Exception while resovling SRV records for localhost. Consider adding '_xmpp-(server|client)._tcp' DNS SRV Records javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Nov 23, 2014 10:40:05 PM org.jivesoftware.smack.tcp.PacketWriter writePackets WARNING: Exception writing closing stream element java.net.SocketException: Socket closed at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:121) at java.net.SocketOutputStream.write(SocketOutputStream.java:159) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291) at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) at java.io.BufferedWriter.flush(BufferedWriter.java:254) at org.jivesoftware.smack.tcp.PacketWriter.writePackets(PacketWriter.java:190) at org.jivesoftware.smack.tcp.PacketWriter.access$000(PacketWriter.java:40) at org.jivesoftware.smack.tcp.PacketWriter$1.run(PacketWriter.java:77) Thanks.

          Same problem here with "Jabber notifier 1.30" and "Jenkins 1.590".
          Thanks.

          Louis-Félix Tessier added a comment - Same problem here with "Jabber notifier 1.30" and "Jenkins 1.590". Thanks.

          kutzi added a comment -

          Fixed in upcoming release 1.31

          kutzi added a comment - Fixed in upcoming release 1.31

            kutzi kutzi
            mbbn Mohammad Biabani
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: