<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:02:52 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-4750] Java Spring Reactive cannot connect to server</title>
                <link>https://jira.mongodb.org/browse/JAVA-4750</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;I would like to get a confirmation and explanation of the root cause of this error below&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The Error from mongo :&lt;/b&gt;&#160;&lt;/p&gt;

&lt;p&gt;1. Mongo Socket Error when &lt;b&gt;Write&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Something went wrong org.springframework.dao.DataAccessResourceFailureException: Exception sending message; nested exception is }}com.mongodb.MongoSocketWriteException{{{}: Exception sending message at {&lt;/tt&gt;}&lt;br/&gt;
-------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;2. Mongo Socket Error when &lt;b&gt;Read&lt;/b&gt;&lt;br/&gt;
com.mongodb.MongoSocketReadException: Prematurely reached end of stream&lt;br/&gt;
-------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;3. Follow by no Server chosen&lt;/p&gt;

&lt;p&gt;org.mongodb.driver.cluster &lt;b&gt;: No server chosen by com.mongodb.reactivestreams&lt;/b&gt;.client.internal.ClientSessionHelper$$Lambda$0000/0x0000000840bf7440@3fcda9a9 from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=xxx-dev-xxx-documentdb-0.xxxxxx-xxxxxx.docdb.amazonaws.com:27000, type=UNKNOWN, state=CONNECTING, exception=&lt;/p&gt;

{com.mongodb.MongoSocketWriteException: Exception sending message}

&lt;p&gt;, caused by {io.netty.channel.StacklessClosedChannelException}}]}. Waiting for 30000 ms before timing out&lt;/p&gt;




&lt;p&gt;Is the root cause can be put as consumption below? and Solution to putting maxIdleTime is correct?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Root caused :&lt;/b&gt;&#160;&lt;/p&gt;

&lt;p&gt;When the connection is idle for a period of time, the connection is closed due to firewall or load balancing, and the client does not know that, when the client continues to use this closed connection for reading and writing, an error will occur.&lt;/p&gt;


&lt;p&gt;If the root cause and solution correct? Is there another way we can see that the connection is lost? In the log, I only see the connection is Open&lt;/p&gt;</description>
                <environment></environment>
        <key id="2152116">JAVA-4750</key>
            <summary>Java Spring Reactive cannot connect to server</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="9">Done</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="tanya.chansataporn@gmail.com">Tanya C</reporter>
                        <labels>
                    </labels>
                <created>Wed, 5 Oct 2022 09:23:53 +0000</created>
                <updated>Tue, 11 Oct 2022 11:55:07 +0000</updated>
                            <resolved>Tue, 11 Oct 2022 11:55:07 +0000</resolved>
                                    <version>4.0.0</version>
                                                    <component>Reactive Streams</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4893833" author="jeff.yemin" created="Tue, 11 Oct 2022 11:55:07 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tanya.chansataporn%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;tanya.chansataporn@gmail.com&quot;&gt;tanya.chansataporn@gmail.com&lt;/a&gt; I&apos;m going to close this now as it seems more like a support issue and not a problem with the driver itself.  If you have further questions, please follow up on either:&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>
                            <comment id="4893828" author="jeff.yemin" created="Tue, 11 Oct 2022 11:53:22 +0000"  >&lt;blockquote&gt;&lt;p&gt;Is there another way we can see that the connection is lost &amp;amp; who cut the connection? In the log, I only see the connection it is Open.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;No. Generally you would need either logs from the actual process that closed the connection, or else &lt;a href=&quot;https://www.wireshark.org/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Wireshark&lt;/a&gt; output&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;if I added  (&amp;amp;maxIdleTimeMS=30000)  and the error does not appear anymore. Could I imply that the root cause is either Load balancers or firewalls that close idle connections?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That would be a reasonable assumption.&lt;/p&gt;</comment>
                            <comment id="4893562" author="JIRAUSER1271425" created="Tue, 11 Oct 2022 09:59:11 +0000"  >&lt;p&gt;Thank you Jeffrey for your reply &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I still have questions as below and added more logs as you requested.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Question :&lt;/b&gt;&#160;&lt;br/&gt;
1. Is there another way we can see that the connection is lost &amp;amp; who cut the connection? In the log, I only see the connection it is Open.&lt;br/&gt;
2. if I added&#160; &lt;b&gt;(&amp;amp;maxIdleTimeMS=30000)&lt;/b&gt;&#160; and the error does not appear anymore. Could I imply that the root cause is either Load balancers or firewalls that close idle connections?&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Attached Kibana log: The Error appears on 14.29&lt;/b&gt;&lt;br/&gt;
&lt;b&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;407515_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/407515/407515_mongoKibana.png&quot; title=&quot;mongoKibana.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;407515&quot; file-preview-title=&quot;mongoKibana.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/407515/_thumb_407515.png&quot; height=&quot;229&quot; width=&quot;420&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/407509/407509_Screen+Shot+2565-10-11+at+14.06.45.png&quot; height=&quot;258&quot; width=&quot;427&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Full-text Error :&lt;/b&gt;&#160;&lt;br/&gt;
&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/407511/407511_MongoErrorLog.rtf&quot; title=&quot;MongoErrorLog.rtf attached to JAVA-4750&quot;&gt;MongoErrorLog.rtf&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Refer similar ticket:&lt;/b&gt; &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-4446&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/JAVA-4446&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4888163" author="jeff.yemin" created="Sat, 8 Oct 2022 18:13:24 +0000"  >&lt;p&gt;Load balancers and firewalls that close idle connections are one of many possible root causes of socket errors.  With retryable reads and writes enabled in the driver (both are on by default), most operations will be automatically retried and the application will not receive any exceptions.&lt;/p&gt;

&lt;p&gt;If a socket error is followed by a server selection timeout error, that means that the retry mechanism failed for some other reason, probably unrelated to this sort of load balancer behavior.  You should check server logs and confirm that a primary was actually available during the time period in question.  From the looks of that server selection timeout error, the driver is unable to reach the replica set members (though it&apos;s hard to say for sure without the full exception message, which looks to be cut off in the description)&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="407511" name="MongoErrorLog.rtf" size="15726" author="tanya.chansataporn@gmail.com" created="Tue, 11 Oct 2022 09:48:12 +0000"/>
                            <attachment id="407509" name="Screen Shot 2565-10-11 at 14.06.45.png" size="751662" author="tanya.chansataporn@gmail.com" created="Tue, 11 Oct 2022 09:46:17 +0000"/>
                            <attachment id="406232" name="Solution.png" size="680889" author="tanya.chansataporn@gmail.com" created="Wed, 5 Oct 2022 09:26:02 +0000"/>
                            <attachment id="407515" name="mongoKibana.png" size="1566974" author="tanya.chansataporn@gmail.com" created="Tue, 11 Oct 2022 10:03:58 +0000"/>
                    </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|hr3mmh:0400000946ijy</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>