-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.4.3
-
Component/s: Connection Management
-
None
ServerAddress#sameHost does not handle IPV6 addresses correctly.
Was:
IPV6 hosts problems in Replica set configurations.
I use 3.4.3 driver for mongo.
and I set replica 3 servers for mongodb with ipv6 configuration.
1. three mongo servers with IPV4(the replica configurations), it works fine.
2. on the single machine with IPV6 with mongo, it works fine.
but three mongo servers with IPV6(the replica configurations)
and the clients and rs.status() it is normal.
I add the replica configurations with java driver.
this is my Constructor. and I use "[" ,"]" for ipv6.
- MongoClient(List<ServerAddress> seeds, List<MongoCredential> credentialsList, MongoClientOptions options)
but below logs continue and it didn't work.
and I looked the code.
I guess why MultiServerCluster.java calls "sameHost" method. but gives without "[","]" host.
if I have faults to set, can you tell me the correct way?
WARN <2017-09-04 11:48:41>[o.m.d.c.event:91] Exception thrown raising server description changed event to listener com.mongodb.connection.MultiServerCluster$DefaultServerStateListener@699320af java.lang.NumberFormatException: For input string: "da12:465:7e00:12a7:1e2e:4f8b:b73a]:27017" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_92] at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_92] at java.lang.Integer.parseInt(Integer.java:615) ~[na:1.8.0_92] at com.mongodb.ServerAddress.sameHost(ServerAddress.java:226) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.handleReplicaSetMemberChanged(MultiServerCluster.java:218) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.onChange(MultiServerCluster.java:165) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.access$100(MultiServerCluster.java:46) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster$DefaultServerStateListener.serverDescriptionChanged(MultiServerCluster.java:126) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.event.ServerEventMulticaster.serverDescriptionChanged(ServerEventMulticaster.java:92) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.DefaultServer$DefaultServerStateListener.stateChanged(DefaultServer.java:196) [mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:148) [mongodb-driver-core-3.4.2.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92] WARN <2017-09-04 11:48:41>[o.m.d.c.event:91] Exception thrown raising server description changed event to listener com.mongodb.connection.MultiServerCluster$DefaultServerStateListener@41418a91 java.lang.NumberFormatException: For input string: "da12:465:7e00:92b4:796c:d92c:5b84]:27017" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_92] at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_92] at java.lang.Integer.parseInt(Integer.java:615) ~[na:1.8.0_92] at com.mongodb.ServerAddress.sameHost(ServerAddress.java:226) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.handleReplicaSetMemberChanged(MultiServerCluster.java:218) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.onChange(MultiServerCluster.java:165) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.access$100(MultiServerCluster.java:46) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster$DefaultServerStateListener.serverDescriptionChanged(MultiServerCluster.java:126) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.event.ServerEventMulticaster.serverDescriptionChanged(ServerEventMulticaster.java:92) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.DefaultServer$DefaultServerStateListener.stateChanged(DefaultServer.java:196) [mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:148) [mongodb-driver-core-3.4.2.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92] WARN <2017-09-04 11:48:41>[o.m.d.c.event:91] Exception thrown raising server description changed event to listener com.mongodb.connection.MultiServerCluster$DefaultServerStateListener@25fede36 java.lang.NumberFormatException: For input string: "da12:465:7e00:8fd1:1567:4cd7:9fb2]:27017" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_92] at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_92] at java.lang.Integer.parseInt(Integer.java:615) ~[na:1.8.0_92] at com.mongodb.ServerAddress.sameHost(ServerAddress.java:226) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.handleReplicaSetMemberChanged(MultiServerCluster.java:218) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.onChange(MultiServerCluster.java:165) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster.access$100(MultiServerCluster.java:46) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.MultiServerCluster$DefaultServerStateListener.serverDescriptionChanged(MultiServerCluster.java:126) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.event.ServerEventMulticaster.serverDescriptionChanged(ServerEventMulticaster.java:92) ~[mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.DefaultServer$DefaultServerStateListener.stateChanged(DefaultServer.java:196) [mongodb-driver-core-3.4.2.jar:na] at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:148) [mongodb-driver-core-3.4.2.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]