[CSHARP-1462] Cant connect to IPv6 Server or localhost Created: 30/Oct/15 Updated: 02/Apr/16 Resolved: 30/Oct/15 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Connectivity |
| Affects Version/s: | 2.1 |
| Fix Version/s: | 2.0.2, 2.1.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Bastian Broekmans [X] | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | regression | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows Client (ipv6), CentOS Server ipv6 |
||
| Description |
|
A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = ReadPreferenceServerSelector{ ReadPreference = { Mode = Primary, TagSets = [] }}, LatencyLimitingServerSelector { AllowedLatencyRange = 00:00:00.0150000 }}. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: " { ClusterId : 1, EndPoint : "Unspecified/::1:27017" }", EndPoint: "Unspecified/::1:27017", State: "Disconnected", Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.ArgumentException: Keine der ermittelten oder angegebenen Adressen entspricht der Socketadressfamilie. When connecting to a IPv6 Server or to ipv6 localhost ([::1]) with: var client = new MongoClient("mongodb://[::1]:27017/?ipv6=true"); |
| Comments |
| Comment by Githook User [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bastian Broekmans [X] [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you Craig, i'm looking forward for your reply. Going to get crazy about this problem | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Craig Wilson [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Bastian, Ok... I can reproduce this with 2.1. I was using our master branch which has apparently fixed this problem. I'm tracing the commit back to see where it got fixed and will look at backporting. I'll let you know. Craig | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bastian Broekmans [X] [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Craig, But connecting both, local and remote server works like charm with mongo.exe from my development machine Bastian | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bastian Broekmans [X] [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Craig Wilson [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Bastien, I was able to reproduce what you see only when the mongod.exe is not started with that --ipv6 flag. In addition, I was still able to connect to the server from mongo.exe with the --ipv6 flag set. In both cases, the flag is simply enabling ipv6, not restricting to only ipv6. In other words, with ipv6 specified, the mongod.exe still listens on ipv4 and mongo.exe will still attempt to connect on ipv4 if necessary. Regardless, it seems you are still seeing a problem. Could you provide the output of this command:
Also, what do you mean on the foreign server? [::1] is localhost. Craig | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bastian Broekmans [X] [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
On the foreign server the config file includes: net: Tthe connection to the foreign server via mongo.exe could be accomplished but not via the c# Driver. Bastian | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bastian Broekmans [X] [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Craig, yes the server is started with --ipv6. Connecting via mongo.exe is working like charm. Bastian | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Craig Wilson [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Bastian, I've just tested this and was able to connect to [::1] on my computer. You must also tell the server to listen on an ipv6 port by using the -ipv6 switch when starting mongod.exe. Could you please confirm ipv6 is turned on at the server? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bastian Broekmans [X] [ 30/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Connecting via mongo.exe is possible with the --ipv6 parameter! |