Не подключается к mongoDB с определённого провайдера C# драйвер

Есть приложение на .NetCore

Есть такой код

   public void ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton<UsersDatabase>();
            services.AddSingleton<IMongoClient>((serviceProvider) =>
            {
                return new MongoClient("mongodb+srv://approver:логинпарольимядб");
            });
          

            services.AddControllersWithViews();
        }

Есть облачная монга.

Коннекчусь со своего провайдера MAGTI(Грузия)

Нажимая добавить в белый список текущий IP адрес, добавляется. Написано

212.58.102.49/0  (includes your current IP address)

Но приложение не коннектится, выдает ошибку.

An unhandled exception occurred while processing the request.
TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "ReplicaSet", Type : "ReplicaSet", State : "Disconnected", Servers : [], DnsMonitorException : "DnsClient.DnsResponseException: Header id mismatch.
at DnsClient.DnsUdpMessageHandler.Query(IPEndPoint server, DnsRequestMessage request, TimeSpan timeout)
at DnsClient.LookupClient.ResolveQuery(IReadOnlyList`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit)
at DnsClient.LookupClient.QueryInternal(DnsQuestion question, DnsQuerySettings queryOptions, IReadOnlyCollection`1 servers)
at DnsClient.LookupClient.Query(DnsQuestion question)
at DnsClient.LookupClient.Query(String query, QueryType queryType, QueryClass queryClass)
at MongoDB.Driver.Core.Misc.DnsClientWrapper.ResolveSrvRecords(String service, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Clusters.DnsMonitor.Monitor()" }.

Окей, пробую с другого провайдера, silknet

Тоже прокидываю в белый список текущий IP адрес и заходит без проблем.

Теперь пробую сделать монгу доступной с любого адреса

0.0.0.0/0  (includes your current IP address)

И опять - MAGTI выдает ошибку выше, silknet коннектится.

И самое странное - через MongoDBCompass коннектится в любом случае, независимо от провайдера.

Т.е, резюме проблемы.

Не работает коннект к базе через драйвер C#, исключительно на одном провайдере - и даже если убрать вайтлист вообще на монге.

Есть предположения, в какую сторону копать?


Ответы (0 шт):