Project

General

Profile

Bug #285

Unable to make DNS SRV resolution

Added by Frédéric Barthéléry over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
07/22/2010
Due date:
% Done:

0%

Estimated time:
Affected version:
0.1.x
Locale:
Close

Description

On the emulator with android-2.2, Beem cannot make some DNS SRV resolution.
Step to reproduce :
  • try to connect beem on a server that needs DNS SRV resolution like gmail.com
dns-srv.log (9.48 KB) dns-srv.log Logcat containing the stacktrace Frédéric Barthéléry, 07/22/2010 08:01 PM

History

#1 Updated by Michael Picher about 8 years ago

Not sure if this is related... Openfire server, Android 2.1 & 2.2 on Moto DroidX.

With the following DNS configured:

SRV records for 5222 and 5269 setup properly for domain.com (insert your domain there)

_xmpp-client._tcp.domain.com 10 0 5222 server.domain.com

_xmpp-server._tcp.domain.com 10 0 5269 server.domain.com

Host record provided in SRV lookup is server.domain.com

  • beem will not authenticate.

Other XMPP clients authenticating properly (Pidgin, Spark).

If the following DNS is configured:

SRV records for 5222 and 5269 setup properly for server.domain.com

_xmpp-client._tcp.server.domain.com 10 0 5222 server.domain.com

_xmpp-server._tcp.server.domain.com 10 0 5269 server.domain.com

Host record proved in SRV lookup is server.domain.com

  • beem will authenticate.

#2 Updated by Frédéric Barthéléry almost 8 years ago

  • Priority changed from High to Normal
  • Target version changed from 0.1.5 to 0.2

Not very high, the problem seems to happens only on emulator.

#3 Updated by Michael Picher almost 8 years ago

ah, no... happens on any server that has DNS SRV setup...

That's not infrequent... it's only infrequent if you aren't trying to connect to something that uses SRV.

I believe the problem may lie in the smack library as the same problem afflicts spark on windows and they use the smack library too...

#4 Updated by Frédéric Barthéléry almost 8 years ago

When I first post this issue, I was referring to this specific exception which seems to happened only on the emulator :

D/dalvikvm(  340): GC_FOR_MALLOC freed 4721 objects / 300480 bytes in 141ms
W/System.err(  340): java.net.SocketException: Bad address family
W/System.err(  340): at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)
W/System.err(  340): at org.apache.harmony.luni.platform.OSNetworkSystemkSystem.connect(OSNetworkSystem.java:115)
W/System.err(  340): at org.orgapache.harmony.nio.internal.SocketChannelImpl.connect(SocketChannelImpl.java:272)
W/System.err(  340): at org.apache.harmony.nio.internal.PipeImpl$SinkChannelImpl.finishConnect(PipeImpl.java:164)
W/System.err(  340): at org.apache.harmony.nio.internal.PipeImpl.<init>(PipeImpl.java:48)
W/System.errr(  340): at org.apache.harmony.nio.internal.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:51)
W/System.err(  340): at org.apache.apacheharmony.nio.internal.SelectorImpl.<init>(SelectorImpl.java:141)
W/System.err(  340): at org.apache.harmony.nio.internal.SelectorProviderImpl.openPipeSelector(SelectorProviderImpl.java:58)
W/System.err(  340): at java.nioo.channels.Selector.open(Selector.java:48)
W/System.err(  340): at org.xbill.DNS.Client.<init>(Client.java:21)
W/System.err(  340): at org.xbillbill.DNS.UDPClient.<init>(UDPClient.java:47)
W/System.err(  340): at orgrg.xbill.DNS.UDPClient.sendrecv(UDPClient.java:145)
W/System.err(  340): at org.xbill.DNS.SimpleResolver.send(SimpleResolver.java:252)
W/Systemm.err(  340): at org.xbill.DNS.ExtendedResolver$Resolution.start(ExtendedResolverdedResolver.java:95)
W/System.err(  340): at org.xbill.DNS.ExtendedResolverdedResolverolver.send(ExtendedResolver.java:358)
W/System.err(  340): at org.xbilll.DNS.Lookup.lookup(Lookup.java:449)
W/System.err(  340): at org.xbilll.DNS.Lookup.resolve(Lookup.java:501)
W/System.err(  340): at org.xbilll.DNS.Lookup.run(Lookup.java:515)
W/System.err(  340): at org.jivesoftware.smack.util.DNSUtil.resolveSRV(DNSUtil.java:54)

For the most general case, the smack dns SRV resolution works. By example it works well with gmail

;; QUESTION SECTION:
;_xmpp-client._tcp.gmail.com.    IN    SRV

;; ANSWER SECTION:
_xmpp-client._tcp.gmail.com. 86349 IN    SRV    20 0 5222 talk2.l.google.com.
_xmpp-client._tcp.gmail.com. 86349 IN    SRV    20 0 5222 talk3.l.google.com.
_xmpp-client._tcp.gmail.com. 86349 IN    SRV    20 0 5222 talk4.l.google.com.
_xmpp-client._tcp.gmail.com. 86349 IN    SRV    5 0 5222 talk.l.google.com.
_xmpp-client._tcp.gmail.com. 86349 IN    SRV    20 0 5222 talk1.l.google.com.

and with our server:

;; QUESTION SECTION:
;_xmpp-client._tcp.beem-project.com. IN    SRV

;; ANSWER SECTION:
_xmpp-client._tcp.beem-project.com. 86400 IN SRV 10 0 5222 elyzion.net.

#5 Updated by Michael Picher almost 8 years ago

Ok, will have to re-test beem to openfire.

Thanks,
Mike

#6 Updated by Frédéric Barthéléry over 7 years ago

  • Status changed from New to Resolved
  • Target version changed from 0.2 to 0.1.7

#7 Updated by Frédéric Barthéléry over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF