Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3251

SRV resolution broken in legacy MongoClient API

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.10.2
    • Affects Version/s: 3.10.0, 3.10.1
    • Component/s: Cluster Management
    • None
    • Environment:
      Java 1.8.0_201-b09
      Windows 10 (Version 1809, Build 17763.379)

      Maven dependency: 'org.mongodb:mongodb-driver:3.10.0'

      Trying to resolve a mongodb+srv MongoClientURI works in 3.9.0, but fails in 3.10.0 and 3.10.1 with the following stack:

      Unable to find source-code formatter for language: text. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      Apr 01, 2019 4:41:05 PM com.mongodb.diagnostics.logging.JULLogger log
      INFO: Cluster created with settings {hosts=[cluster0-spmuf.mongodb.net:27017], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='Cluster0-shard-0'}
      Apr 01, 2019 4:41:05 PM com.mongodb.diagnostics.logging.JULLogger log
      INFO: Adding discovered server cluster0-spmuf.mongodb.net:27017 to client view of cluster
      Apr 01, 2019 4:41:05 PM com.mongodb.diagnostics.logging.JULLogger log
      INFO: Exception in monitor thread while connecting to server cluster0-spmuf.mongodb.net:27017
      com.mongodb.MongoSocketException: cluster0-spmuf.mongodb.net
              at com.mongodb.ServerAddress.getSocketAddresses(ServerAddress.java:211)
              at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:75)
              at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
              at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:126)
              at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.net.UnknownHostException: cluster0-spmuf.mongodb.net
              at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
              at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
              at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
              at java.net.InetAddress.getAllByName0(InetAddress.java:1277)
              at java.net.InetAddress.getAllByName(InetAddress.java:1193)
              at java.net.InetAddress.getAllByName(InetAddress.java:1127)
              at com.mongodb.ServerAddress.getSocketAddresses(ServerAddress.java:203)
              ... 5 moreApr 01, 2019 4:41:05 PM com.mongodb.diagnostics.logging.JULLogger log
      INFO: No server chosen by com.mongodb.client.internal.MongoClientDelegate$1@1ed4004b from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=cluster0-spmuf.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            john.murphy@mongodb.com John Murphy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: