<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:43: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>[SERVER-57929] Inconsistent handling of mongodb:// URIs</title>
                <link>https://jira.mongodb.org/browse/SERVER-57929</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;h3&gt;&lt;a name=&quot;Description&quot;&gt;&lt;/a&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;Attempting to use the mongodb URI &quot;mongodb://0.0.0.0:27017/db&quot; works with mongodump/mongorestore but fails with mongo shell.&lt;/p&gt;

&lt;p&gt;When running mongo inside a docker-compose environment, I would typically run &quot;docker-compose port mongodb 27017&quot; to get the address and port which docker mapped the docker container port to on the local host. Ie. it could respond with &quot;0.0.0.0:49156&quot;.&lt;/p&gt;

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

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;MONGODB_URI=&quot;mongodb://$(docker-compose port mongodb 27017)/db&quot;&lt;/p&gt;

&lt;p&gt;mongorestore --uri &quot;$MONGODB_URI&quot; --dir dump --drop&lt;/p&gt;

&lt;p&gt;mongo &quot;$MONGODB_URI&quot; database/transformMessages.js&lt;/p&gt;

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

&lt;p&gt;The last step fails however, which the error message below:&lt;/p&gt;

&lt;p&gt;MongoDB shell version v4.0.25&lt;br/&gt;
connecting to: mongodb://0.0.0.0:49156/?gssapiServiceName=mongodb&lt;br/&gt;
2021-06-17T11:55:16.488+0200 E QUERY &lt;span class=&quot;error&quot;&gt;&amp;#91;js&amp;#93;&lt;/span&gt; Error: couldn&apos;t connect to server 0.0.0.0:49156, address resolved to 0.0.0.0 :&lt;br/&gt;
connect@src/mongo/shell/mongo.js:356:17&lt;br/&gt;
@(connect):2:6&lt;br/&gt;
exception: connect failed&lt;/p&gt;

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

&lt;p&gt;And just to confirm a connection is possible:&lt;/p&gt;

&lt;p&gt;curl -sv &lt;a href=&quot;http://0.0.0.0:49156/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://0.0.0.0:49156/&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Trying 0.0.0.0:49156...&lt;/li&gt;
	&lt;li&gt;TCP_NODELAY set&lt;/li&gt;
	&lt;li&gt;Connected to 0.0.0.0 (127.0.0.1) port 49156 (#0)&lt;br/&gt;
&amp;gt; GET / HTTP/1.1&lt;br/&gt;
&amp;gt; Host: 0.0.0.0:49156&lt;br/&gt;
&amp;gt; User-Agent: curl/7.68.0&lt;br/&gt;
&amp;gt; Accept: &lt;b&gt;/&lt;/b&gt;&lt;br/&gt;
&amp;gt; &lt;/li&gt;
	&lt;li&gt;Mark bundle as not supporting multiuse&lt;/li&gt;
	&lt;li&gt;HTTP 1.0, assume close after body&lt;br/&gt;
&amp;lt; HTTP/1.0 200 OK&lt;br/&gt;
&amp;lt; Connection: close&lt;br/&gt;
&amp;lt; Content-Type: text/plain&lt;br/&gt;
&amp;lt; Content-Length: 85&lt;br/&gt;
&amp;lt; &lt;br/&gt;
It looks like you are trying to access MongoDB over HTTP on the native driver port.&lt;/li&gt;
	&lt;li&gt;Closing connection 0&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;StepstoReproduce&quot;&gt;&lt;/a&gt;&lt;b&gt;Steps to Reproduce&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;1. docker run --rm -it -p 27017 --name mongo -d mongo&lt;/p&gt;

&lt;p&gt;2. MONGODB_URI=&quot;mongodb://$(docker port mongo 27017 | head -n1)/test&quot;&lt;/p&gt;

&lt;p&gt;3. mongo &quot;$MONGODB_URI&quot;&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1788176">SERVER-57929</key>
            <summary>Inconsistent handling of mongodb:// URIs</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="edwin.zhou@mongodb.com">Edwin Zhou</assignee>
                                    <reporter username="tais.hansen@gmail.com">Tais P. Hansen</reporter>
                        <labels>
                    </labels>
                <created>Thu, 17 Jun 2021 10:20:52 +0000</created>
                <updated>Fri, 27 Oct 2023 13:52:21 +0000</updated>
                            <resolved>Mon, 28 Jun 2021 23:37:25 +0000</resolved>
                                    <version>4.0.25</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3906835" author="JIRAUSER1260737" created="Tue, 29 Jun 2021 08:40:30 +0000"  >&lt;p&gt;Hi Edwin,&lt;/p&gt;

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

&lt;p&gt;Mongo shell is the only tool I&apos;ve encountered that cannot use 0.0.0.0. Both mysql, psql and cockroach&#160;are all able to connect to a server using 0.0.0.0 as the host name.&lt;/p&gt;

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

&lt;p&gt;RFC 5735 states:&#160;&lt;br/&gt;
Address 0.0.0.0/32 may be used as a source address for this&lt;br/&gt;
   host on this network&lt;br/&gt;
Listening on 0.0.0.0:8080 is usually how one would bind to port 8080 on all interfaces. Logically (although not explicitly stated) a client could be assumed to be able to connect to a local server using the same parameters.&lt;/p&gt;

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

&lt;p&gt;I find it odd that you would accept inconsistent behaviour between mongo&apos;s own tools.&#160;This should be changed from a bug to a feature request then.&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="3906454" author="JIRAUSER1257066" created="Mon, 28 Jun 2021 23:37:15 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tais.hansen%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;tais.hansen@gmail.com&quot;&gt;tais.hansen@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;The IP address 0.0.0.0 is typically reserved for something unspecified. In the mongo shell, we throw an error when the host address is &quot;0.0.0.0&quot;.&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/client/dbclient_connection.cpp#L416&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/master/src/mongo/client/dbclient_connection.cpp#L416&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see from the output from the curl command, the address 0.0.0.0 is resolving to 127.0.0.1, which is the localhost address. You may find success replacing &quot;0.0.0.0&quot; with &quot;127.0.0.1&quot;.&lt;/p&gt;

&lt;p&gt;Best,&lt;br/&gt;
Edwin&lt;/p&gt;</comment>
                            <comment id="3890813" author="tim.fogarty" created="Tue, 22 Jun 2021 11:49:07 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tais.hansen%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;tais.hansen@gmail.com&quot;&gt;tais.hansen@gmail.com&lt;/a&gt;, sorry to hear about this. It sounds like you&apos;re specifically having trouble with the behavior of the mongo shell. So I&apos;m going to move this ticket to the Server Jira project (which is where we track issues with the mono shell) so somebody can take a closer look.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 22 Jun 2021 11:49:07 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 32 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 32 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>edwin.zhou@mongodb.com</customfieldvalue>
            <customfieldvalue>tais.hansen@gmail.com</customfieldvalue>
            <customfieldvalue>tim.fogarty@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzn1pz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hz7kbb:</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>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[edwin.zhou@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzmnz3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>