18 — AuthenticationFailed
authenticationauthorisation
Authentication credentials are invalid or the mechanism failed
What is happening?
AuthenticationFailed means the client provided credentials that MongoDB could not verify. This differs from Unauthorized (13): error 18 means the login itself failed, while error 13 means the user logged in successfully but lacks permission for a specific operation.
Common causes
- Incorrect password
- Wrong username or authentication database (authSource)
- SCRAM mechanism mismatch between client and server
- User credentials were changed but the application uses cached credentials
- X.509 certificate does not match the configured user
- LDAP authentication backend is unreachable