Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2575

DnsClient error on actual Android device

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.8.0
    • Component/s: API, Connectivity
    • None
    • Environment:
      Xamarin Forms 3.6
      Android 8.0
      Samsung Galaxy J7 (2016) phone
      Samsung Galaxy Tab A (2016) tablet

      We are getting the following exception when running our Xamarin forms app on an actual Android device(tried multiple devices).  The same code works in an Android emulator(GenyMotion) and also on an actual iOS device.

       

      We are using a mongoDB environment that was created during the "Getting Started" process.  We have ensured internet connectivity on the device.

       

      Here is the line that throws the exception:

       

      var mongoClientConnectionString = "mongodb+srv://user:pwd@our instance.mongodb.net";

      var mongoUrl = MongoUrl.Create(mongoClientConnectionString);
      var mongoClientSettings = MongoClientSettings.FromConnectionString(mongoClientConnectionString);

       

       

      04-05 09:49:36.395 I/mono-stdout(22961):  **ERROR** : Timestamp: 4/5/2019 9:49:36 AM04-05 09:49:36.395 I/mono-stdout(22961):  **ERROR** : Timestamp: 4/5/2019 9:49:36 AM **ERROR** : Timestamp: 4/5/2019 9:49:36 AM04-05 09:49:36.401 I/mono-stdout(22961): 
      04-05 09:49:36.401 I/mono-stdout(22961): ============================================================================================Message: Error resolving name servers (Value cannot be null.Parameter name: source) (Could not find file "/etc/resolv.conf")
      Source: DnsClient04-05 09:49:36.401 I/mono-stdout(22961): Message: Error resolving name servers (Value cannot be null.
      Stack Trace:   at DnsClient.NameServer.ResolveNameServers (System.Boolean skipIPv6SiteLocal, System.Boolean fallbackToGooglePublicDns) [0x0005e] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0   at DnsClient.LookupClient..ctor () [0x00000] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0   at MongoDB.Driver.Core.Configuration.ConnectionString.Resolve () [0x00011] in <a34d991f1d4449e5b16dbee9fe96734c>:0   at MongoDB.Driver.MongoUrl.Resolve () [0x00015] in <83d46eceb9e141e4851226c8e5372b51>:0   at MongoDB.Driver.MongoClientSettings.FromUrl (MongoDB.Driver.MongoUrl url) [0x00009] in <83d46eceb9e141e4851226c8e5372b51>:0 04-05 09:49:36.401 I/mono-stdout(22961): Parameter name: source) (Could not find file "/etc/resolv.conf")
      04-05 09:49:36.401 I/mono-stdout(22961):   at MongoDB.Driver.MongoClientSettings.FromConnectionString (System.String connectionString) [0x00006] in <83d46eceb9e141e4851226c8e5372b51>:0   at MyEhr.MongoDb.App.Rigging.MongoDbReplicator.Start () [0x00080] in C:\Code\Git\Asgard\pocs\MongoDB POC\MyEhr.MongoDb.App\MyEhr.MongoDb.App\Rigging\MongoDbReplicator.cs:61 

      -= > There is an inner exception <=-Message: Value cannot be null.Parameter name: source
      Source: System.CoreStack Trace:   at System.Linq.Enumerable.Where[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0000d] in <ba85ba5122c3499483c4d8a7ac6f7e5a>:0 
        at DnsClient.NameServer.QueryNetworkInterfaces (System.Boolean skipIPv6SiteLocal) [0x00047] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0   at DnsClient.NameServer.ResolveNameServers (System.Boolean skipIPv6SiteLocal, System.Boolean fallbackToGooglePublicDns) [0x0000d] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0 =============================================-=04-05 09:49:36.401 I/mono-stdout(22961): Source: DnsClient
      04-05 09:49:36.402 I/mono-stdout(22961): Stack Trace:   at DnsClient.NameServer.ResolveNameServers (System.Boolean skipIPv6SiteLocal, System.Boolean fallbackToGooglePublicDns) [0x0005e] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0 04-05 09:49:36.402 I/mono-stdout(22961):   at DnsClient.LookupClient..ctor () [0x00000] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0 04-05 09:49:36.402 I/mono-stdout(22961):   at MongoDB.Driver.Core.Configuration.ConnectionString.Resolve () [0x00011] in <a34d991f1d4449e5b16dbee9fe96734c>:0 04-05 09:49:36.402 I/mono-stdout(22961):   at MongoDB.Driver.MongoUrl.Resolve () [0x00015] in <83d46eceb9e141e4851226c8e5372b51>:0 04-05 09:49:36.402 I/mono-stdout(22961):   at MongoDB.Driver.MongoClientSettings.FromUrl (MongoDB.Driver.MongoUrl url) [0x00009] in <83d46eceb9e141e4851226c8e5372b51>:0 04-05 09:49:36.402 I/mono-stdout(22961):   at MongoDB.Driver.MongoClientSettings.FromConnectionString (System.String connectionString) [0x00006] in <83d46eceb9e141e4851226c8e5372b51>:0 04-05 09:49:36.403 I/mono-stdout(22961):   at MyEhr.MongoDb.App.Rigging.MongoDbReplicator.Start () [0x00080] in C:\Code\Git\Asgard\pocs\MongoDB POC\MyEhr.MongoDb.App\MyEhr.MongoDb.App\Rigging\MongoDbReplicator.cs:61 04-05 09:49:36.403 I/mono-stdout(22961): 04-05 09:49:36.403 I/mono-stdout(22961): 04-05 09:49:36.403 I/mono-stdout(22961): -= > There is an inner exception <=04-05 09:49:36.403 I/mono-stdout(22961): Message: Value cannot be null.04-05 09:49:36.403 I/mono-stdout(22961): Parameter name: source04-05 09:49:36.403 I/mono-stdout(22961): 04-05 09:49:36.403 I/mono-stdout(22961): Source: System.Core04-05 09:49:36.403 I/mono-stdout(22961): Stack Trace:   at System.Linq.Enumerable.Where[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0000d] in <ba85ba5122c3499483c4d8a7ac6f7e5a>:0 04-05 09:49:36.403 I/mono-stdout(22961):   at DnsClient.NameServer.QueryNetworkInterfaces (System.Boolean skipIPv6SiteLocal) [0x00047] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0 04-05 09:49:36.403 I/mono-stdout(22961):   at DnsClient.NameServer.ResolveNameServers (System.Boolean skipIPv6SiteLocal, System.Boolean fallbackToGooglePublicDns) [0x0000d] in <93b57b4b99c64a96a2c065ea9ae1fc1f>:0 04-05 09:49:36.403 I/mono-stdout(22961): ==============================================

            Assignee:
            Unassigned Unassigned
            Reporter:
            gschmidt@ntst.com George Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: