<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:20:21 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>[CDRIVER-4238] C 1.19.0 report &quot;Cache Reader No keys found for HMAC that is valid for time&quot;</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4238</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;C Driver 1.19.0 reports HMAC key issue&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Environment&quot;&gt;&lt;/a&gt;Environment&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;C 1.19.0 + MongoDB shared cluster 4.0.24.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Centos 7, MongoDB 4.0.24 (it also happens with the eoled 3.6)&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;&lt;em&gt;Sharded cluster with multiple mongoS.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;
&lt;p&gt;_I didn&apos;t find a concise way of reproducing it, but more info can be found here:&lt;br/&gt;
&lt;a href=&quot;http://example.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://jira.mongodb.org/browse/GODRIVER-2127&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://example.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://jira.mongodb.org/browse/DRIVERS-1904&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://example.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://jira.mongodb.org/browse/PYTHON-1434&lt;/a&gt;_&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;This issue seems to be present in all drivers and all of them react differently to it where Python seems the one that is more tolerant. Matt mentioned in &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1904&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;DRIVERS-1904&lt;/a&gt; that this can affect up to 100% of the operations and I would consider it a high priority.&lt;/em&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1946024">CDRIVER-4238</key>
            <summary>C 1.19.0 report &quot;Cache Reader No keys found for HMAC that is valid for time&quot;</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="5">Cannot Reproduce</resolution>
                                        <assignee username="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="vgrippa@gmail.com">Vinicius Grippa</reporter>
                        <labels>
                    </labels>
                <created>Thu, 9 Dec 2021 21:10:55 +0000</created>
                <updated>Mon, 27 Dec 2021 16:49:00 +0000</updated>
                            <resolved>Mon, 27 Dec 2021 16:49:00 +0000</resolved>
                                    <version>1.19.0</version>
                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4268013" author="kevin.albertson" created="Mon, 27 Dec 2021 16:48:47 +0000"  >&lt;p&gt;Thank you for the additional information &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=vgrippa%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;vgrippa@gmail.com&quot;&gt;vgrippa@gmail.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I attempted to reproduce with similar conditions:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;C driver 1.19.0.&lt;/li&gt;
	&lt;li&gt;MongoDB server version 4.0.24 enterprise.&lt;/li&gt;
	&lt;li&gt;Sharded cluster with two mongos routers.&lt;/li&gt;
	&lt;li&gt;Authentication enabled.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;mongoc_client_pool_t&lt;/tt&gt; created with two mongos routers in the connection string &quot;mongodb://localhost:27017,localhost:27018&quot;.&lt;/li&gt;
	&lt;li&gt;Test ran &quot;ping&quot; command repeatedly in two threads.&lt;br/&gt;
 Running the test did not result in any error after 10 minutes.&lt;/li&gt;
&lt;/ul&gt;


&lt;blockquote&gt;&lt;p&gt;One more thing, in the event of this issue happening, is there any workaround apart from restarting the connection pool (which basically means restarting the app)?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Unfortunately, I do not see a good alternative workaround. I mocked the error by modifying the $clusterTime applied in &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.19.0/src/libmongoc/src/mongoc/mongoc-topology.c#L1513-L1535&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_mongoc_topology_update_cluster_time&lt;/a&gt; with this patch: &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/352624/352624_mock_cluster_time.patch&quot; title=&quot;mock_cluster_time.patch attached to CDRIVER-4238&quot;&gt;mock_cluster_time.patch&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;. It mocks the $clusterTime on the first reply to a &quot;ping&quot; command. Errors continue until the driver receives a valid $clusterTime with a higher &lt;tt&gt;$clusterTime.clusterTime&lt;/tt&gt; timestamp.&lt;/p&gt;

&lt;p&gt;I do not think this is a bug in driver behavior. &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1904&quot; title=&quot;Handle invalid $clusterTime documents when gossiping cluster time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1904&quot;&gt;DRIVERS-1904&lt;/a&gt; proposes an improvement in driver handling of this error. I linked &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-4238&quot; title=&quot;C 1.19.0 report &amp;quot;Cache Reader No keys found for HMAC that is valid for time&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-4238&quot;&gt;&lt;del&gt;CDRIVER-4238&lt;/del&gt;&lt;/a&gt;. Please watch &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1904&quot; title=&quot;Handle invalid $clusterTime documents when gossiping cluster time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1904&quot;&gt;DRIVERS-1904&lt;/a&gt; for updates.&lt;/p&gt;

&lt;p&gt;I suggest filing a Bug ticket in the SERVER project to help investigate the root cause. Since this occurs on 4.0.24, that rules out &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-52955&quot; title=&quot;KeysCollectionClientDirect should check if majority read concern is supported by storage engine&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-52955&quot;&gt;&lt;del&gt;SERVER-52955&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47568&quot; title=&quot;No keys found for HMAC in RECOVERING state&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47568&quot;&gt;&lt;del&gt;SERVER-47568&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="4245686" author="vgrippa@gmail.com" created="Mon, 13 Dec 2021 23:45:59 +0000"  >&lt;p&gt;FYI, the issue only happens when multiple routers are specified in the connection string. When using a single router, there is no issue.&lt;/p&gt;</comment>
                            <comment id="4244565" author="vgrippa@gmail.com" created="Mon, 13 Dec 2021 17:24:41 +0000"  >&lt;p&gt;One more thing, in the event of this issue happening, is there any workaround apart from restarting the connection pool (which basically means restarting the app)?&lt;/p&gt;</comment>
                            <comment id="4242640" author="vgrippa@gmail.com" created="Sun, 12 Dec 2021 21:27:19 +0000"  >&lt;p&gt;Hi Kevin,&lt;/p&gt;

&lt;p&gt;Thanks for checking out. I saw this comment about &lt;em&gt;transitionToAuth&lt;/em&gt; , but I&apos;m not using it. There are no special settings in the cluster, only basic settings.&lt;/p&gt;</comment>
                            <comment id="4242600" author="kevin.albertson" created="Sun, 12 Dec 2021 17:35:01 +0000"  >&lt;p&gt;Thank you for the report &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=vgrippa%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;vgrippa@gmail.com&quot;&gt;vgrippa@gmail.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Is there anything unique about how mongod or mongos is started? There has been internal discussion in &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1904&quot; title=&quot;Handle invalid $clusterTime documents when gossiping cluster time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1904&quot;&gt;DRIVERS-1904&lt;/a&gt; noting an instance of this occurring with the &lt;tt&gt;--transitionToAuth&lt;/tt&gt; option set on mongod.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1861956">DRIVERS-1904</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="352624" name="mock_cluster_time.patch" size="3208" author="kevin.albertson@mongodb.com" created="Mon, 27 Dec 2021 16:44:05 +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|hzx3gf:</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>