<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;No SRV records&amp;quot; intermittent error when running Databricks Pyspark to connect Mongo Atlas in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25606#M17841</link>
    <description>&lt;P&gt;Hi @Raymond Lai​&amp;nbsp; The issue looks to be on the Mongo DB connector.&amp;nbsp;The connection is created and maintained by the mongo-spark connector. You can try using the direct mongodb hosts in the connection string instead of SRV to avoid doing DNS lookups or you can reach out to MongoDb team for the resolution.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 15:39:14 GMT</pubDate>
    <dc:creator>Noopur_Nigam</dc:creator>
    <dc:date>2022-11-30T15:39:14Z</dc:date>
    <item>
      <title>"No SRV records" intermittent error when running Databricks Pyspark to connect Mongo Atlas</title>
      <link>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25602#M17837</link>
      <description>&lt;P&gt;My Mongo Atlas connect url is like mongodb+srv://&amp;lt;srv_hostname&amp;gt;&lt;/P&gt;&lt;P&gt;I don't want to use direct url like mongodb://&amp;lt;hostname1, hostname2, hostname3....&amp;gt; because our Mongo Atlas global clusters have many hosts. It would be hard to maintain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our java programs in our GCP cloud connecting to the same Mongo Atlas SRV do not have this issue.   I suspect something wrong with our Databricks or pyspark configs or driver versions compatibility.  Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;B&gt;level&lt;/B&gt;:&amp;nbsp;ERROR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;B&gt;message&lt;/B&gt;:&amp;nbsp;Exception occured: %s Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;  File "&amp;lt;command-389574246471033&amp;gt;", line 9, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;    if df.count() != 0:&lt;/P&gt;&lt;P&gt;  File "/databricks/spark/python/pyspark/sql/dataframe.py", line 688, in count&lt;/P&gt;&lt;P&gt;    return int(self._jdf.count())&lt;/P&gt;&lt;P&gt;  File "/databricks/spark/python/lib/py4j-0.10.9.1-src.zip/py4j/java_gateway.py", line 1304, in __call__&lt;/P&gt;&lt;P&gt;    return_value = get_return_value(&lt;/P&gt;&lt;P&gt;  File "/databricks/spark/python/pyspark/sql/utils.py", line 117, in deco&lt;/P&gt;&lt;P&gt;    return f(*a, **kw)&lt;/P&gt;&lt;P&gt;  File "/databricks/spark/python/lib/py4j-0.10.9.1-src.zip/py4j/protocol.py", line 326, in get_return_value&lt;/P&gt;&lt;P&gt;    raise Py4JJavaError(&lt;/P&gt;&lt;P&gt;py4j.protocol.Py4JJavaError: An error occurred while calling o468.count.&lt;/P&gt;&lt;P&gt;: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@43eaa290. Client view of cluster state is {type=REPLICA_SET, srvResolutionException=com.mongodb.MongoConfigurationException: No SRV records available for _mongodb._tcp.mongo-core-coreapp-clus-pri.tpl3f.mongodb.net, servers=[]&lt;/P&gt;&lt;P&gt;	at com.mongodb.internal.connection.BaseCluster.createTimeoutException(BaseCluster.java:424)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 20:08:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25602#M17837</guid>
      <dc:creator>200723</dc:creator>
      <dc:date>2022-10-26T20:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: "No SRV records" intermittent error when running Databricks Pyspark to connect Mongo Atlas</title>
      <link>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25604#M17839</link>
      <description>&lt;P&gt;Our code is already as same as the one which is mentioned in the article link which you have shared.  &lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 13:42:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25604#M17839</guid>
      <dc:creator>200723</dc:creator>
      <dc:date>2022-10-28T13:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: "No SRV records" intermittent error when running Databricks Pyspark to connect Mongo Atlas</title>
      <link>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25605#M17840</link>
      <description>&lt;P&gt;Hi @Raymond Lai​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or &lt;B&gt;mark an answer as best&lt;/B&gt;? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 06:47:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25605#M17840</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-28T06:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: "No SRV records" intermittent error when running Databricks Pyspark to connect Mongo Atlas</title>
      <link>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25606#M17841</link>
      <description>&lt;P&gt;Hi @Raymond Lai​&amp;nbsp; The issue looks to be on the Mongo DB connector.&amp;nbsp;The connection is created and maintained by the mongo-spark connector. You can try using the direct mongodb hosts in the connection string instead of SRV to avoid doing DNS lookups or you can reach out to MongoDb team for the resolution.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 15:39:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/quot-no-srv-records-quot-intermittent-error-when-running/m-p/25606#M17841</guid>
      <dc:creator>Noopur_Nigam</dc:creator>
      <dc:date>2022-11-30T15:39:14Z</dc:date>
    </item>
  </channel>
</rss>

