Forum Discussion

BartoloIsmail's avatar
BartoloIsmail
Frequent Visitor
2 years ago

Copy data activity on microsoft fabric and mongodbAtlas problem connection

I'm trying to utilize the new MongoDB Atlas connector in Data Pipelines/Copy Data, but have had no luck at all connecting to my MongoDB Atlas database. It seems to be a connectivity issue or something wrong with my connect string. Can anyone help with the proper format on setting up atlas as a source? 

 

>Connection to MongoDB server is timeout.
A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector }. Client view of cluster state is { ClusterId : "1", Type : "Unknown", State : "Disconnected", Servers : [], DnsMonitorException : "DnsClient.DnsResponseException: Query 24306 => _mongodb._tcp.clustermarket.clustermarket.yvfht.mongodb.net IN SRV on 169.254.0.1:53 timed out or is a transient error. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
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)
--- End of inner exception stack trace ---
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 MongoDB.Driver.Core.Misc.DnsClientWrapper.ResolveSrvRecords(String service, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Clusters.DnsMonitor.Monitor()" }.

Thanks for your support

 

14 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi BartoloIsmail ,

    Thanks for using Fabric Community.

    Here are some steps to troubleshoot the connection and set up MongoDB Atlas as a source:

     

    1. Verify Connection String:
      • Double-check your connection string for typos or incorrect formatting.
    2. Firewall Rules:
      • Ensure your network allows outbound connections to MongoDB Atlas on port 27017 (or the custom port you might be using). Check your Data Pipelines service's network configuration and any firewalls in between.

     

    Additional Tips:

    Consider increasing the timeout value in your connection string using connectTimeoutMS parameter. This might help if there's a slight delay in establishing the connection.

    Docs to refer - Configure MongoDB Atlas in a copy activity - Microsoft Fabric | Microsoft Learn

    Hope this helps. Do let us know incase of further queries.

    • BartoloIsmail's avatar
      BartoloIsmail
      Frequent Visitor

      Hi Anonymous ,

      this morning I tried to input 00000. IP address in order to allow all access for everyone, and now I can conclude that it's Microsoft Fabric that doesn't want to connect. I have an internal error.

       

      I found a similar message (https://community.fabric.microsoft.com/t5/Data-Pipelines/MongoDB-Atlas-Data-Copy-Connectivity/m-p/3566910) regarding the issue I'm facing. Let me explain: I'm trying to copy data via a pipeline using Microsoft Fabric to retrieve my MongoDB Atlas collection. I had an error that I corrected by adding a parameter that allows access to all IPs to access the MongoDB service. After running the test, I now encounter a new error that appears (progress... :)). I'm coming to you to ask if you could explain where this new error might be coming from. Thank you for your help.

       

    • BartoloIsmail's avatar
      BartoloIsmail
      Frequent Visitor

      Is there a way to deposit a JSON file into my bronze layer of my Microsoft Fabric lakehouse in a non-manual manner using a Talend job, for example, without using the MongoDB Atlas pipeline connectors or MongoDB Atlas SQL via Gen2 flows? I've noticed that there are SQL string connections available, but they seem only usable by tools like Power BI Desktop, for instance

  • I also have the problem with connection because by connection string must contain 

    &authmechanism=SCRAM-SHA-256&

    how can I specify it in Fabric? There are only server name + port and creds. How to specify an additional param?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Marusyk ,

      Thanks for using Fabric Community.
      Can you explain me more about your issue? What are you trying to do?

       

      • Marusyk's avatar
        Marusyk
        Advocate II

        Hi, sure. I'm using the RBAC feature for CosmosDb. So I've created a user fabric and want to use it to connect from Fabric.

         

        To connect to Cosmos using custom credentials use connection string like this (replace <username> and <password>):

         

         

        mongodb://<username>:<password>@cosmos****-prod.mongo.cosmos.azure.com:10255/Customers?ssl=true&replicaSet=globaldb&authmechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000

         

         

         

        I got the error however the key is valid because I'm able to connect via MongoDB Compass