[GODRIVER-2020] Authenticate failed with keyId = 0 Created: 21/May/21  Updated: 11/Sep/21  Resolved: 25/Aug/21

Status: Closed
Project: Go Driver
Component/s: Authentication
Affects Version/s: 1.5.0
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: qi zhang Assignee: Matt Dale
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Running in centos based docker image


Attachments: Zip Archive dbstress.zip     PNG File image-1620390240863-1.png     PNG File image-1620390240863.png    

 Description   

When I use the 1.5 go driver to connect with mongod for operation, the authentication fails occasionally, but it doesn't appear on the 1.0 go driver. Could it be a driver compatibility issue? The error message is as follows: 

err connection() error occured during connection handshake:
auth error: sasl conversation error: unable to authenticate using mechanism "SCRAM-SHA-1":
(KeyNotFound) Cache Reader No keys found for HMAC that is valid for time: { ts: Timestamp(1620053128, 26) } with id: 0



 Comments   
Comment by Matt Dale [ 25/Aug/21 ]

I've so far been unable to reproduce this issue running the provided repro example code, Go Driver v1.5.0, and local replicasets using v4.0.3 and v4.2.11 of the MongoDB server, so I'm closing this as "Cannot Reproduce".

Comment by Matt Dale [ 28/Jul/21 ]

Hey qiangzhanghnu@gmail.com, thanks for the additional info and example code! I'm currently setting up another local replicaset to run the example code against. I'll let you know when I have some results.

Comment by qi zhang [ 14/Jul/21 ]

mongod error like this

Comment by qi zhang [ 09/Jul/21 ]

Hi,matt.dale

Comment by qi zhang [ 09/Jul/21 ]

I uploaded my test tool,  please try again

Comment by qi zhang [ 09/Jul/21 ]

Mongodb code is downloaded from GitHub without modification

Comment by qi zhang [ 18/Jun/21 ]

I suggest replacing persistent connection with non persistent connection when connecting mongod

Comment by Matt Dale [ 12/Jun/21 ]

Hey qiangzhanghnu@gmail.com thanks for the additional information. I set up 2 local replica sets, both with MongoDB versions 4.0.3 and 4.2.11 and tried connecting to them with using both v1.0.0 and v1.5.0 of the mongo-go-driver. So far I haven't been able to reproduce the auth error you described.

I have been able to find a few possibly related MongoDB server bugs that can result in the same intermittent error messages. Please update your MongoDB server versions to the minimum fixed versions and see if the auth errors persist:

  • 4.0.24 or higher (from 4.0.3)
  • 4.2.13 or higher (from 4.2.11)
Comment by qi zhang [ 07/Jun/21 ]
  • 4.0.3 and 4.2.11
  • self-hosted instance
  • replica set
Comment by Matt Dale [ 02/Jun/21 ]

qiangzhanghnu@gmail.com so far I've been unable to reproduce the error you described.

Please let me know more about your MongoDB server setup:

  • What version of MongoDB are you connecting to?
  • Are you connecting to an Atlas-managed instance or self-hosted instance?
  • What kind of MongoDB cluster are you connecting to? For example, are you connecting to a single MongoDB server, a group of MongoDB servers in a replica set, a group of MongoDB servers with sharded collections, etc?
Comment by Matt Dale [ 26/May/21 ]

qiangzhanghnu@gmail.com thanks for reporting this issue, we will look into it soon.

Generated at Thu Feb 08 08:37:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.