<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:46:14 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-37520] &quot;too many users are authenticated&quot; after getSiblingDB() and auth()</title>
                <link>https://jira.mongodb.org/browse/SERVER-37520</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;With MongoDB versions 4 (4.0.1 and 4.0.2 tested), I cannot switch to another db, authenticate, and operate with that db. In MongoDB 3.6, I can successfully do this:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;~$ mongo mongodb://daniel:mahpass@127.0.0.1:27017/admin&lt;/tt&gt;&lt;br/&gt;
{{ MongoDB shell version v3.6.7}}&lt;br/&gt;
{{ connecting to: mongodb://127.0.0.1:27017/admin}}&lt;br/&gt;
{{ MongoDB server version: 3.6.7}}&lt;br/&gt;
{{ &amp;gt; var mother = db.getSiblingDB(&apos;mother&apos;)}}&lt;br/&gt;
{{ &amp;gt; mother.auth(}}{{&lt;/p&gt;
{ user: &apos;daniel&apos;, pwd: &apos;mahpass&apos; }
&lt;p&gt;}}&lt;tt&gt;)&lt;/tt&gt;&lt;br/&gt;
{{ 1}}&lt;br/&gt;
{{ &amp;gt; mother.sites.find()}}{{&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;54b1d0a26629edca9cbef6c3&quot;), &quot;client&quot; : &quot;Dev&quot;, &quot;dbName&quot; : &quot;mother&quot;, &quot;domain&quot; : &quot;mother.localhost&quot;, &quot;licenses&quot; : 0, &quot;name&quot; : &quot;Mother&quot; }
&lt;p&gt;}}&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&amp;gt;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;My user was created on the admin database first, with &quot;dbOwner&quot; and &quot;userAdminAnyDatabase&quot; rights, and then on the &quot;mother&quot; database with &quot;dbOwner&quot; rights.&lt;/p&gt;

&lt;p&gt;In other words, these are two different users, one on each db.&lt;/p&gt;

&lt;p&gt;Googling the error, I only get four hits, one in Chinese, and the remaining I cannot see how are related. I&apos;ve searched through the 4.0 changes, and cannot find any documented change that would cause this restriction &#8212; if indeed it is a restriction? Maybe this isn&apos;t a bug, and it&apos;s just me misbehaving?&lt;/p&gt;

&lt;p&gt;Thanks &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;Daniel&lt;/p&gt;</description>
                <environment></environment>
        <key id="615931">SERVER-37520</key>
            <summary>&quot;too many users are authenticated&quot; after getSiblingDB() and auth()</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="3">Duplicate</resolution>
                                        <assignee username="nick.brewer">Nick Brewer</assignee>
                                    <reporter username="Daniel Smedegaard Buus">Daniel Smedegaard Buus [X]</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Oct 2018 11:02:00 +0000</created>
                <updated>Tue, 9 Oct 2018 15:33:12 +0000</updated>
                            <resolved>Tue, 9 Oct 2018 15:33:12 +0000</resolved>
                                    <version>4.0.1</version>
                    <version>4.0.2</version>
                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2027891" author="nick.brewer" created="Tue, 9 Oct 2018 15:32:34 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=Daniel+Smedegaard+Buus&quot; class=&quot;user-hover&quot; rel=&quot;Daniel Smedegaard Buus&quot;&gt;Daniel Smedegaard Buus&lt;/a&gt; This behavior is indeed expected - by design, logical sessions cannot have more than one user authenticated on a single connection. The fix to prevent this behavior is detailed here: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32064&quot; title=&quot;A logical session id should be included in all command requests from the mongo shell&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32064&quot;&gt;&lt;del&gt;SERVER-32064&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This change will make it into the 3.6 branch in version 3.6.9.&lt;/p&gt;

&lt;p&gt;-Nick&lt;/p&gt;</comment>
                            <comment id="2027540" author="daniel smedegaard buus" created="Tue, 9 Oct 2018 11:15:18 +0000"  >&lt;p&gt;This may be worth noting. I get the same error even if not accessing the sibling db:&lt;/p&gt;

&lt;p&gt;MongoDB shell version v4.0.2&lt;br/&gt;
connecting to: mongodb://127.0.0.1:27017/admin&lt;br/&gt;
MongoDB server version: 4.0.2&lt;br/&gt;
&amp;gt; show dbs&lt;br/&gt;
admin 0.000GB&lt;br/&gt;
config 0.000GB&lt;br/&gt;
mother 0.002GB&lt;br/&gt;
local 0.000GB&lt;br/&gt;
tmp-scaffold-migration 0.002GB&lt;br/&gt;
&amp;gt; db.getSiblingDB(&apos;mother&apos;).auth({ user: &apos;daniel&apos;, pwd: &apos;mahpass&apos; })&lt;br/&gt;
1&lt;br/&gt;
&amp;gt; show dbs&lt;br/&gt;
2018-10-09T13:14:09.643+0200 E QUERY &lt;span class=&quot;error&quot;&gt;&amp;#91;js&amp;#93;&lt;/span&gt; Error: listDatabases failed:&lt;/p&gt;
{
 &quot;ok&quot; : 0,
 &quot;errmsg&quot; : &quot;too many users are authenticated&quot;,
 &quot;code&quot; : 13,
 &quot;codeName&quot; : &quot;Unauthorized&quot;
}
&lt;p&gt; :&lt;br/&gt;
_getErrorWithCode@src/mongo/shell/utils.js:25:13&lt;br/&gt;
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:67:1&lt;br/&gt;
shellHelper.show@src/mongo/shell/utils.js:876:19&lt;br/&gt;
shellHelper@src/mongo/shell/utils.js:766:15&lt;br/&gt;
@(shellhelp2):1:1&lt;/p&gt;</comment>
                            <comment id="2027532" author="daniel smedegaard buus" created="Tue, 9 Oct 2018 11:04:42 +0000"  >&lt;p&gt;And here&apos;s the other one:&lt;/p&gt;

&lt;p&gt;~$ mongo mongodb://daniel:mahpass@127.0.0.1:27017/admin&lt;br/&gt;
MongoDB shell version v4.0.2&lt;br/&gt;
 connecting to: mongodb://127.0.0.1:27017/admin&lt;br/&gt;
 MongoDB server version: 4.0.2&lt;br/&gt;
 &amp;gt; var mother = db.getSiblingDB(&apos;mother&apos;)&lt;br/&gt;
 &amp;gt; mother.auth({ user: &apos;daniel&apos;, pwd: &apos;mahpass&apos; })&lt;br/&gt;
 1&lt;br/&gt;
 &amp;gt; mother.sites.find()&lt;br/&gt;
 Error: error:&lt;/p&gt;

{ &quot;ok&quot; : 0, &quot;errmsg&quot; : &quot;too many users are authenticated&quot;, &quot;code&quot; : 13, &quot;codeName&quot; : &quot;Unauthorized&quot; }

&lt;p&gt;&amp;gt;&lt;/p&gt;</comment>
                            <comment id="2027531" author="daniel smedegaard buus" created="Tue, 9 Oct 2018 11:04:22 +0000"  >&lt;p&gt;Okay, there&apos;s something wrong with the editor here &#8212; my &quot;preformatted&quot; text is clearly converted to randomness. Also, I don&apos;t see an edit link here, so I&apos;m adding comment instead. Here&apos;s the first block that I tried to preformat:&lt;/p&gt;

&lt;p&gt;~$ mongo mongodb://daniel:mahpass@127.0.0.1:27017/admin&lt;br/&gt;
MongoDB shell version v3.6.7&lt;br/&gt;
connecting to: mongodb://127.0.0.1:27017/admin&lt;br/&gt;
MongoDB server version: 3.6.7&lt;br/&gt;
&amp;gt; var mother = db.getSiblingDB(&apos;mother&apos;)&lt;br/&gt;
&amp;gt; mother.auth({ user: &apos;daniel&apos;, pwd: &apos;mahpass&apos; })&lt;br/&gt;
1&lt;br/&gt;
&amp;gt; mother.sites.find()&lt;/p&gt;
{ &quot;_id&quot; : ObjectId(&quot;54b1d0a26629edca9cbef6c3&quot;), &quot;client&quot; : &quot;Dev&quot;, &quot;dbName&quot; : &quot;mother&quot;, &quot;domain&quot; : &quot;mother.localhost&quot;, &quot;licenses&quot; : 0, &quot;name&quot; : &quot;Mother&quot; }
&lt;p&gt;&amp;gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="462574">SERVER-32064</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 9 Oct 2018 15:32:34 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 18 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>nick.brewer</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 18 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>Daniel Smedegaard Buus</customfieldvalue>
            <customfieldvalue>nick.brewer</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu9tvr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu063z:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;This is how I fare with MongoDB 4.0:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&#160;~$ mongo mongodb://daniel:mahpass@127.0.0.1:27017/admin&lt;/tt&gt;&lt;br/&gt;
{{ mongo $MONGO_URI/admin}}&lt;br/&gt;
{{ MongoDB shell version v4.0.2}}&lt;br/&gt;
{{ connecting to: mongodb://127.0.0.1:27017/admin}}&lt;br/&gt;
{{ MongoDB server version: 4.0.2}}&lt;br/&gt;
{{ &amp;gt; var mother = db.getSiblingDB(&apos;mother&apos;)}}&lt;br/&gt;
{{ &amp;gt; mother.auth(}}{{&lt;/p&gt;
{ user: &apos;daniel&apos;, pwd: &apos;mahpass&apos; }
&lt;p&gt;}}&lt;tt&gt;)&lt;/tt&gt;&lt;br/&gt;
{{ 1}}&lt;br/&gt;
{{ &amp;gt; mother.sites.find()}}&lt;br/&gt;
{{ Error: error: {}}&lt;br/&gt;
{{ &quot;ok&quot; : 0,}}&lt;br/&gt;
{{ &quot;errmsg&quot; : &quot;too many users are authenticated&quot;,}}&lt;br/&gt;
{{ &quot;code&quot; : 13,}}&lt;br/&gt;
{{ &quot;codeName&quot; : &quot;Unauthorized&quot;}}&lt;br/&gt;
{{ }}}&lt;br/&gt;
{{ &amp;gt;}}&lt;/p&gt;</customfieldvalue>

                        </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>
                                

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

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