391 — ReauthenticationRequired

authentication

Reauthentication Required — MongoDB error code 391

Source code references

ErrorCodes::ReauthenticationRequired found in 3 locations in the MongoDB server source.

Detailed investigation data (common causes, diagnostic steps) is not yet available for this error code. The information above comes from the official MongoDB error code reference.

Related Issues

GODRIVER-4187Needs Verification
getMore and killCursor fail to reauthenticate on ReauthenticationRequired (391)
h3. Detailed steps to reproduce the problem? getMore and killCursor do not reauthenticated on [ReauthenticationRequired (391)|https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.yml#L862C23-L862C47] Repro: https://github.com/10gen/go-driver-tools/blob/main/preston/repros/2.9.2/godriver_4187_test.go Public repro: https://gist.github.com/prestonvasquez/a7020ec7c7271f96e7195ab13517b8bc h3. Definition of done: what must be done to consider the task complete? The [aut
GODRIVER-4221Backlog
Operation.Execute retries indefinitely on repeated ReauthenticationRequired (391) after a successful reauthentication
h3. Detailed steps to reproduce the problem? The [auth spec|https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#reauthentication] says: {quote} Drivers MUST immediately attempt a reauthentication on the connection using suitable credentials... This attempt MUST be irrespective of whether the operation is considered retryable. {quote} This infinite loop is in Operation.Execute, which every command goes through, and has been on master since GODRIVER-3278. Any operat
NODE-7886Investigating
Transaction fails with NoSuchTransaction (251) when its first command triggers OIDC reauthentication — retried command omits startTransaction
h3. Use Case As a developer using the Node.js driver with {{MONGODB-OIDC}} authentication and manually managed transactions ({{session.startTransaction()}} / {{commitTransaction()}}) I want a transaction to succeed when its first command triggers OIDC reauthentication ({{ReauthenticationRequired}}, 391) So that transactions do not fail intermittently when their first command happens to hit an expired access token h3. User Experience * *Expected:* After reauthentication, the driver re-