<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:01:17 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>[CXX-1063] mongocxx::uri doesn&apos;t validate URI on construction</title>
                <link>https://jira.mongodb.org/browse/CXX-1063</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;Uncatchable Error during initialisation. try&lt;/p&gt;
{ . . . }catch(...){ . . . }
&lt;p&gt;If I input wrong input parameters like: &quot;mongodb://:@:/&quot; The my program exits with -1. Last output is: src/mongoc/mongoc-topology.c:155 mongoc_topology_new(): precondition failed: uri&lt;/p&gt;

&lt;p&gt;If the version of the new c++ driver is important, pleas tell me how I can find out the library version of my compiled libraries. &lt;/p&gt;

&lt;p&gt;CODE:&lt;br/&gt;
mongocxx::client conn;  // defined in class header file&lt;br/&gt;
SomeClass::someClass(){&lt;br/&gt;
std::stringstream stmMongoDbUri;&lt;br/&gt;
  stmMongoDbUri&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;mongodb://&quot; //&amp;lt;&amp;lt; MyConfiguration.dbUser&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;:&quot;    //&amp;lt;&amp;lt; MyConfiguration.dbPassword&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;@&quot;    //&amp;lt;&amp;lt; MyConfiguration.dbHost&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;:&quot;    //&amp;lt;&amp;lt; MyConfiguration.dbPort&lt;br/&gt;
      &amp;lt;&amp;lt; &quot;/&quot;    //&amp;lt;&amp;lt; MyConfiguration.databaseName;&lt;/p&gt;


&lt;p&gt;  std::string strMongoDbUri (std::istreambuf_iterator&amp;lt;char&amp;gt;(stmMongoDbUri), {});&lt;/p&gt;

&lt;p&gt;  printf(&quot;47 - Streamconten Mongo DB Config &lt;del&gt;&amp;gt; %s &amp;lt;&lt;/del&gt;&quot;, strMongoDbUri.c_str() );&lt;/p&gt;

&lt;p&gt;  // src/mongoc/mongoc-topology.c:155 mongoc_topology_new(): precondition failed: uri&lt;br/&gt;
  // No valid connection established / invalid string... ka...&lt;br/&gt;
  //&lt;span class=&quot;error&quot;&gt;&amp;#91;strMongoDbUri&amp;#93;&lt;/span&gt; = &quot;mongodb://:@:/&quot; &lt;br/&gt;
  conn = mongocxx::client(mongocxx::uri(strMongoDbUri));&lt;br/&gt;
...&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment></environment>
        <key id="320683">CXX-1063</key>
            <summary>mongocxx::uri doesn&apos;t validate URI on construction</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="9">Done</resolution>
                                        <assignee username="david.golden@mongodb.com">David Golden</assignee>
                                    <reporter username="Weltenbummler">Armin Ball [X]</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Oct 2016 22:29:31 +0000</created>
                <updated>Tue, 15 Nov 2016 21:48:04 +0000</updated>
                            <resolved>Thu, 3 Nov 2016 15:36:06 +0000</resolved>
                                    <version>3.0.1</version>
                                    <fixVersion>3.0.3</fixVersion>
                                    <component>Implementation</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1429314" author="xgen-internal-githook" created="Tue, 8 Nov 2016 16:25:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;xdg&apos;, u&apos;name&apos;: u&apos;David Golden&apos;, u&apos;email&apos;: u&apos;xdg@xdg.me&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1063&quot; title=&quot;mongocxx::uri doesn&amp;#39;t validate URI on construction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1063&quot;&gt;&lt;del&gt;CXX-1063&lt;/del&gt;&lt;/a&gt; Throw exception for invalid URIs&lt;br/&gt;
Branch: 3.1-dev&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/ed9e97b051d839145808056c9a7e561448cd903e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/ed9e97b051d839145808056c9a7e561448cd903e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1425224" author="xgen-internal-githook" created="Thu, 3 Nov 2016 15:35:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;xdg&apos;, u&apos;name&apos;: u&apos;David Golden&apos;, u&apos;email&apos;: u&apos;xdg@xdg.me&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-1063&quot; title=&quot;mongocxx::uri doesn&amp;#39;t validate URI on construction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-1063&quot;&gt;&lt;del&gt;CXX-1063&lt;/del&gt;&lt;/a&gt; Throw exception for invalid URIs&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/ed9e97b051d839145808056c9a7e561448cd903e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/ed9e97b051d839145808056c9a7e561448cd903e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1423196" author="david.golden" created="Tue, 1 Nov 2016 18:04:00 +0000"  >&lt;p&gt;&lt;a href=&quot;https://mongodbcr.appspot.com/98920002/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/98920002/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1399361" author="weltenbummler" created="Mon, 3 Oct 2016 23:18:46 +0000"  >&lt;p&gt;&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; &amp;amp; Thank you!&lt;br/&gt;
Controlling arguments, got something in the mind:&lt;br/&gt;
find_and_update(view,view,view);&lt;br/&gt;
If you change the order of the arguments it crashes also very very downstairs. I&apos;m sorry I can&apos;t find the code anymore. It was late at night.&lt;br/&gt;
Maybe have a brief look at that if some can reproduce it in a minute. If not, I&apos;ll keep watching for this faulty code snipped.&lt;br/&gt;
I&apos;m sure for 80% that the upper description is correct. &lt;/p&gt;</comment>
                            <comment id="1399332" author="david.golden" created="Mon, 3 Oct 2016 22:45:03 +0000"  >&lt;p&gt;Good catch.  It looks like we&apos;re not validating URIs.  We&apos;ll address this in the next release.&lt;/p&gt;

&lt;p&gt;Regarding versions, it shouldn&apos;t matter for this, but you can check with &lt;tt&gt;mongocxx/config/version.h&lt;/tt&gt;:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;MONGOCXX_VERSION_MAJOR&lt;/li&gt;
	&lt;li&gt;MONGOCXX_VERSION_MINOR&lt;/li&gt;
	&lt;li&gt;MONGOCXX_VERSION_PATCH&lt;/li&gt;
	&lt;li&gt;MONGOCXX_VERSION_EXTRA&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I&apos;ll open a ticket to better expose and/or document those.&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|hrdion:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1351">Perl/CXX 2016-11-11</customfieldvalue>

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