<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:00:08 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-3660] Mongo Driver Socket Connect Exception</title>
                <link>https://jira.mongodb.org/browse/JAVA-3660</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;When we are creating a MongoClient using the uir, even if the connection is unsuccessful, system is not throwing out the error, however in the log file, it will show the error message as below. I am attaching the file that I have tested with. &lt;/p&gt;

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

&lt;p&gt;Mar 12, 2020 1:24:12 PM com.mongodb.diagnostics.logging.JULLogger log&lt;br/&gt;
INFO: Cluster created with settings {hosts=&lt;span class=&quot;error&quot;&gt;&amp;#91;localhost1:27017&amp;#93;&lt;/span&gt;, mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout=&apos;30000 ms&apos;, maxWaitQueueSize=500}&lt;br/&gt;
Mar 12, 2020 1:24:12 PM com.mongodb.diagnostics.logging.JULLogger log&lt;br/&gt;
INFO: Exception in monitor thread while connecting to server localhost1:27017&lt;br/&gt;
com.mongodb.MongoSocketException: localhost1: No address associated with hostname&lt;br/&gt;
 at com.mongodb.ServerAddress.getSocketAddress(ServerAddress.java:188)&lt;br/&gt;
 at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:59)&lt;br/&gt;
 at com.mongodb.connection.SocketStream.open(SocketStream.java:57)&lt;br/&gt;
 at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:126)&lt;br/&gt;
 at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:114)&lt;br/&gt;
 at java.lang.Thread.run(Thread.java:748)&lt;br/&gt;
Caused by: java.net.UnknownHostException: localhost1: No address associated with hostname&lt;br/&gt;
 at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)&lt;br/&gt;
 at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)&lt;br/&gt;
 at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)&lt;br/&gt;
 at java.net.InetAddress.getAllByName0(InetAddress.java:1277)&lt;br/&gt;
 at java.net.InetAddress.getAllByName(InetAddress.java:1193)&lt;br/&gt;
 at java.net.InetAddress.getAllByName(InetAddress.java:1127)&lt;br/&gt;
 at java.net.InetAddress.getByName(InetAddress.java:1077)&lt;br/&gt;
 at com.mongodb.ServerAddress.getSocketAddress(ServerAddress.java:186)&lt;br/&gt;
 ... 5 more&lt;/p&gt;

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

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

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>Linux, Mongo Driver version 3.6.2. </environment>
        <key id="1267823">JAVA-3660</key>
            <summary>Mongo Driver Socket Connect Exception</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="13202">Works as Designed</resolution>
                                        <assignee username="ross@mongodb.com">Ross Lawley</assignee>
                                    <reporter username="vijaybabu.batta@sirmaindia.com">Vijay Babu Batta</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Mar 2020 09:27:14 +0000</created>
                <updated>Fri, 27 Oct 2023 13:21:00 +0000</updated>
                            <resolved>Thu, 12 Mar 2020 09:34:04 +0000</resolved>
                                    <version>3.6.0</version>
                                                    <component>Connection Management</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2971770" author="vijaybabu.batta@sirmaindia.com" created="Thu, 12 Mar 2020 12:04:49 +0000"  >&lt;p&gt;Hi Ross, &lt;/p&gt;

&lt;p&gt;Thank you very much for clarifying. We will see if we can trigger some dummy command and test then.&lt;/p&gt;

&lt;p&gt;Appreciate your help.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2971606" author="ross@10gen.com" created="Thu, 12 Mar 2020 10:16:31 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=vijaybabu.batta%40sirmaindia.com&quot; class=&quot;user-hover&quot; rel=&quot;vijaybabu.batta@sirmaindia.com&quot;&gt;vijaybabu.batta@sirmaindia.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;That&apos;s also to be expected as the driver uses a connection pool in the background and its the monitor thread that is throwing an exception.  You would only see an error in your application when calling a command. &lt;/p&gt;

&lt;p&gt;All the best,&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                            <comment id="2971591" author="vijaybabu.batta@sirmaindia.com" created="Thu, 12 Mar 2020 09:56:21 +0000"  >&lt;p&gt;Hi Ross,&lt;/p&gt;


&lt;p&gt;Thank you for your quick response.&lt;/p&gt;

&lt;p&gt;My query is related to the issue only. Apologies for not elaborating clearly.&lt;/p&gt;

&lt;p&gt;I have given localhost1 intentionally so that connection fails. However, in my code, is continues without going into the exception block. After a bit of study, what i have found was that, inside mongo driver code, it is logging the error to the console which is what i have pasted above, but it will not return the error outside.&lt;/p&gt;


&lt;p&gt;Here, my motive behind this is, If connection is not established to the server, I should know immediately in the code which is not happening.&lt;/p&gt;


&lt;p&gt;Looking forward for your help.&lt;/p&gt;


&lt;p&gt;PS: Thank you on pointing me to the community.&lt;/p&gt;

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

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

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2971578" author="ross@10gen.com" created="Thu, 12 Mar 2020 09:33:51 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=vijaybabu.batta%40sirmaindia.com&quot; class=&quot;user-hover&quot; rel=&quot;vijaybabu.batta@sirmaindia.com&quot;&gt;vijaybabu.batta@sirmaindia.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Please check the cause of the exception: &lt;tt&gt;Caused by: java.net.UnknownHostException: localhost1: No address associated with hostname&lt;/tt&gt;.  The error indicates that there is no IP address associated with the host &lt;tt&gt;localhost1&lt;/tt&gt;.  I imagine its a typo and the host should be &lt;tt&gt;localhost&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Just to let you know for future reference, this project is for Java driver bugs or feature requests. The best place for questions regarding MongoDB usage or the Java driver specifics is the &lt;a href=&quot;https://community.mongodb.com/tags/c/drivers-odms-connectors/7/java-driver&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb community forum&lt;/a&gt; as you will reach a broader audience there.  If your business requires an answer from MongoDB within a time frame then we do offer &lt;a href=&quot;https://www.mongodb.com/products/production-support&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;production support&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All the best,&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="252036" name="MongoPlayer.java" size="610" author="vijaybabu.batta@sirmaindia.com" created="Thu, 12 Mar 2020 09:26:42 +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|hwv8gv:</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>