[CSHARP-2575] DnsClient error on actual Android device Created: 05/Apr/19  Updated: 08/Apr/19  Resolved: 08/Apr/19

Status: Closed
Project: C# Driver
Component/s: API, Connectivity
Affects Version/s: 2.8.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: George Schmidt Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Xamarin Forms 3.6
Android 8.0
Samsung Galaxy J7 (2016) phone
Samsung Galaxy Tab A (2016) tablet



 Description   

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): ==============================================



 Comments   
Comment by Ian Whalen (Inactive) [ 08/Apr/19 ]

gschmidt@ntst.com thanks for reaching out with this bug report but Android is not currently a supported platform for the .NET driver. If you do see this issue on a supported platform please let us know.

Generated at Wed Feb 07 21:42:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.