<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:46:07 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-37482] Mongo runninng from autorestarting docker fails authentication</title>
                <link>https://jira.mongodb.org/browse/SERVER-37482</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Dear developers,&#160;&lt;/p&gt;

&lt;p&gt;I am not quite sure if this is on topic here, but it might interest you.&lt;/p&gt;

&lt;p&gt;I am running a&#160;&lt;b&gt;mongodb docker container&lt;/b&gt;&#160;on my machine and I want to have it start when I start my computer. However, each time I boot my computer I have to do a&#160;&lt;tt&gt;docker restart&lt;/tt&gt;&#160;of the container because the &quot;automatically started&quot; container slaps me with an&#160;&lt;tt&gt;Authentication failed&#160;&lt;/tt&gt; when I give it valid credentials. Manually restarting the offending container solves the problem immediately.&lt;/p&gt;

&lt;p&gt;I am running an&#160;&lt;b&gt;Ubuntu 18.04&lt;/b&gt;&#160;system, on an&#160;&lt;b&gt;encrypted partition&lt;/b&gt;, with the&#160;&lt;b&gt;latest docker&lt;/b&gt;&#160;and&#160;&lt;b&gt;MongoDB 4.0.2&lt;/b&gt;&#160;(althought I had this problem with every version I tried). Oddly enough, this problem does not occur on an unencrypted partition.&lt;/p&gt;

&lt;p&gt;I would like to know if this could&#160;&lt;tt&gt;possibly&lt;/tt&gt;&#160;be caused by the encryption of the partition (During Ubuntu installation you have the choice to encrypt).&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="614547">SERVER-37482</key>
            <summary>Mongo runninng from autorestarting docker fails authentication</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="9">Done</resolution>
                                        <assignee username="nick.brewer">Nick Brewer</assignee>
                                    <reporter username="drozdik.svk@gmail.com">Martin Drozdik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Oct 2018 09:36:05 +0000</created>
                <updated>Fri, 12 Oct 2018 04:27:39 +0000</updated>
                            <resolved>Fri, 12 Oct 2018 04:27:39 +0000</resolved>
                                    <version>4.0.2</version>
                                                    <component>Admin</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2030964" author="thomas.schubert" created="Fri, 12 Oct 2018 04:27:39 +0000"  >&lt;p&gt;Thanks for the update, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=drozdik.svk%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;drozdik.svk@gmail.com&quot;&gt;drozdik.svk@gmail.com&lt;/a&gt;!&lt;/p&gt;</comment>
                            <comment id="2029676" author="drozdik.svk@gmail.com" created="Wed, 10 Oct 2018 22:08:21 +0000"  >&lt;p&gt;Hi Nick,&lt;/p&gt;

&lt;p&gt;thanks for your investigation.&lt;/p&gt;

&lt;p&gt;I was unable to reproduce the problem on an unencrypted partition.  That is good news. My best guess is that this is a misunderstanding between Ubuntu and Docker and has nothing to do with Mongo.  However, my intuitions rarely prove correct.&lt;/p&gt;

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

&lt;p&gt;MD&lt;/p&gt;</comment>
                            <comment id="2025258" author="nick.brewer" created="Fri, 5 Oct 2018 16:58:31 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=drozdik.svk%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;drozdik.svk@gmail.com&quot;&gt;drozdik.svk@gmail.com&lt;/a&gt; Thanks for your report - I can see you also posted this on StackOverflow. That&apos;s likely to be a more appropriate place for this question, as the variable of the encrypted partition leads me to believe this isn&apos;t a &lt;tt&gt;mongod&lt;/tt&gt; bug. However I&apos;m curious to know if you encounter any errors if the Docker container is started automatically, without encryption enabled?&lt;/p&gt;

&lt;p&gt;Thanks, &lt;br/&gt;
-Nick&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>Fri, 5 Oct 2018 16:58:31 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 17 weeks, 6 days 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>kelsey.schubert@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 17 weeks, 6 days 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>kelsey.schubert@mongodb.com</customfieldvalue>
            <customfieldvalue>drozdik.svk@gmail.com</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|hu9lqn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htzyk7:</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;Start an unsecured mongo container.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;docker run --volume ~/test-data:/data/db --publish --name mongo-unauthenticated 27017:27017 mongo:4.0.2&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Connect to it and create some users:&lt;br/&gt;
{{mongo&lt;br/&gt;
 use admin&lt;br/&gt;
 db.createUser(&lt;br/&gt;
 &lt;/p&gt;
{
 user: &quot;admin&quot;,
 pwd: &quot;password&quot;,
 roles: [ \{ role: &quot;userAdminAnyDatabase&quot;, db: &quot;admin&quot; }
&lt;p&gt;, &quot;readWriteAnyDatabase&quot; ]&lt;br/&gt;
 }&lt;br/&gt;
 )&lt;br/&gt;
use test&lt;br/&gt;
 db.createUser(&lt;/p&gt;
{
 user: &quot;tester&quot;,
 pwd: &quot;password&quot;,
 roles: [ \{ role: &quot;readWrite&quot;, db: &quot;test&quot; }
&lt;p&gt; ]&lt;br/&gt;
 } )&lt;br/&gt;
exit}}&lt;/p&gt;

&lt;p&gt;Now take the unsecured mongo offline:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;docker stop mongo-unauthenticated&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;And put a secured version in place. Note the `--restart always` flag that causes the container to autostart.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;docker run --restart always --publish 27017:27017 --name test-mongo -v ~/test-data:/data/db mongo:4.0.2 --auth&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Check that you can connect with valid credentials:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;mongo --port 27017 -u &quot;tester&quot; -p &quot;password&quot; --authenticationDatabase &quot;test&quot;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Make a clean shutdown:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;docker stop mongo-unauthenticated&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Restart your computer.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;reboot&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Check that the `--restart always` works.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;docker ps&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;And get the authentication failed with pristine credentials.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;mongo --port 27017 -u &quot;tester&quot; -p &quot;password&quot; --authenticationDatabase &quot;test&quot;&lt;/tt&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|hu97zz:</customfieldvalue>

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