<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:02:55 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-4769] Unable to connect to more than one MongoDB nodes of a replica set using Private endpoint aware URL from GCP</title>
                <link>https://jira.mongodb.org/browse/JAVA-4769</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Unable to connect to multiple MongoDB nodes of a replica set using Private endpoint aware URL from GCP using Java driver&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Java Driver Version&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;mongodb-driver-sync 4.6.0&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;When trying to connect to Atlas Mongo from GCP using Private Endpoint (Dedicated Cluster) using Java driver, the connection is not established when more than one private endpoint aware MongoDB instance address in the replica set is provided. That is the following code&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;ConnectionString connectionString = new ConnectionString(&#8220;mongodb://admin:admin@pl-00-000-asia-south1-gcp.sb9fh.mongodb.net:27017,pl-00-001-asia-south1-gcp.sb9fh.mongodb.net:27017,pl-00-012-asia-south1-gcp.sb9fh.mongodb.net:27017/?ssl=true&amp;amp;authSource=admin&amp;amp;retryWrites=true&amp;amp;w=majority&#8221;);&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;MongoClientSettings settings = MongoClientSettings.builder()&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; .applyConnectionString(connectionString)&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; &#160; &#160; &#160; .build();&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;MongoClient mongoClient = MongoClients.create(settings);&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;MongoDatabase database = mongoClient.getDatabase(&#8220;src&#8221;);&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;results in the error&lt;/p&gt;

&lt;p&gt;{{Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@3e7a23e5. Client view of cluster state is {type=REPLICA_SET, servers=[&lt;/p&gt;

{address=pl-00-000-asia-south1-gcp.sb9fh.mongodb.net:27017 type=UNKNOWN, state=CONNECTING}

&lt;p&gt;, {address=pl-00-001-asia-south1-gcp.sb9fh.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, {address=pl-00-012-asia-south1-gcp.sb9fh.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}]}}&lt;/p&gt;

&lt;p&gt;whereas, by providing only one private endpoint aware host address (as shown below) the connection can be established.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;ConnectionString connectionString = new ConnectionString(&#8220;mongodb://admin:admin@pl-00-000-asia-south1-gcp.sb9fh.mongodb.net:27017?ssl=true&amp;amp;authSource=admin&amp;amp;retryWrites=true&amp;amp;w=majority&#8221;);&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Whereas, the Mongo shell is able to connect when multiple private endpoint aware MongoDB node addresses are given,&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;mongosh &quot;mongodb://admin:admin@pl-00-000-asia-south1-gcp.sb9fh.mongodb.net:27017,pl-00-001-asia-south1-gcp.sb9fh.mongodb.net:27017,pl-00-012-asia-south1-gcp.sb9fh.mongodb.net:27017&quot; --username admin&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Why does the Java driver fail to connect, with a TimeoutException, to the replicaset when more than one private endpoint aware host is provided, but connects when only one is provided?&lt;/li&gt;
	&lt;li&gt;Shouldn&apos;t Java driver be capable of connecting to the shard (or replica set) given that the mongo shell is able to do the same?&lt;/li&gt;
	&lt;li&gt;Is there a way to connect to the MongoDB instance nodes (port - 27017) using private aware endpoints through Java driver?&#160;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Note: Using &lt;tt&gt;mongodb+srv://&lt;/tt&gt; is not an option for the current requirement.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2157339">JAVA-4769</key>
            <summary>Unable to connect to more than one MongoDB nodes of a replica set using Private endpoint aware URL from GCP</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13203">Gone away</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="ajay.mathias@webaction.com">Ajay Mathias</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Oct 2022 06:32:24 +0000</created>
                <updated>Fri, 27 Oct 2023 19:48:32 +0000</updated>
                            <resolved>Tue, 8 Nov 2022 12:00:51 +0000</resolved>
                                    <version>4.6.0</version>
                                                    <component>Connection Management</component>
                    <component>Connection String</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="4962610" author="dbeng-pm-bot" created="Tue, 8 Nov 2022 12:00:52 +0000"  >&lt;p&gt;There hasn&apos;t been any recent activity on this ticket, so we&apos;re resolving it. Thanks for reaching out! Please feel free to comment on this if you&apos;re able to provide more information.&lt;/p&gt;</comment>
                            <comment id="4924869" author="JIRAUSER1256529" created="Tue, 25 Oct 2022 11:02:46 +0000"  >&lt;blockquote&gt;&lt;p&gt;Can you post a comment with the full mongosh output&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I think in particular a log file from a relevant mongosh session (&lt;a href=&quot;https://www.mongodb.com/docs/mongodb-shell/logs/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.mongodb.com/docs/mongodb-shell/logs/&lt;/a&gt;) would be helpful.&lt;/p&gt;</comment>
                            <comment id="4915397" author="jeff.yemin" created="Thu, 20 Oct 2022 12:53:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ajay.mathias%40webaction.com&quot; class=&quot;user-hover&quot; rel=&quot;ajay.mathias@webaction.com&quot;&gt;ajay.mathias@webaction.com&lt;/a&gt; can you also post the output of running &lt;tt&gt;rs.status()&lt;/tt&gt; in mongosh after you connect?&lt;/p&gt;</comment>
                            <comment id="4915290" author="jeff.yemin" created="Thu, 20 Oct 2022 12:13:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ajay.mathias%40webaction.com&quot; class=&quot;user-hover&quot; rel=&quot;ajay.mathias@webaction.com&quot;&gt;ajay.mathias@webaction.com&lt;/a&gt;, the difference in behavior with mongosh is definitely interesting.  Can you post a comment with the full mongosh output, so we can see what operations you&apos;re able to perform with mongosh?  i.e. are you able to connect and then successfully execute a CRUD operation?&lt;/p&gt;
</comment>
                            <comment id="4914593" author="JIRAUSER1265465" created="Thu, 20 Oct 2022 04:28:53 +0000"  >&lt;p&gt;I have gone through the documentation and as suggested I have also posted this query on the community portal.&lt;/p&gt;

&lt;p&gt;But I still think that this could be a Java driver issue because of two reasons&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The connection can be established from &lt;tt&gt;mongosh&lt;/tt&gt; by giving all three private endpoint aware host addresses, but not from Java driver.&lt;/li&gt;
	&lt;li&gt;The Java driver is able to establish the connection if only one of the host address is given, but not all three.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="4904834" author="jeff.yemin" created="Fri, 14 Oct 2022 22:05:17 +0000"  >&lt;p&gt;Hi there, thank you for reaching out.  This sounds like a support issue, so I wanted to give you some resources to get this question answered more quickly:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Our MongoDB support portal, located at &lt;a href=&quot;https://support.mongodb.com/welcome&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;support.mongodb.com&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Our MongoDB community portal, located &lt;a href=&quot;https://developer.mongodb.com/community/forums/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;If you are an Atlas customer, you can also: Click the in-app chat icon in the lower right corner to chat with a MongoDB Support representative OR Click Support in the left-hand navigation to view Developer Resources.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Just in case you have already opened a support case and are not receiving sufficient help, please let me know and I can facilitate escalating your issue.&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0wfsg:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>