Light Blue Pointer
본문 바로가기
Trouble Shooting

Exception authenticating MongoCredential{mechanism=SCRAM-SHA-256, userName='root', source='admin', password=<hidden>, mechanismProperties=<hidden>}] with root cause

by 개발바닥곰발바닥!!! 2024. 5. 9.

🚩문제 : MongoDB 연결이 되지 않고 에러 발생

2024-05-09T20:16:58.672+09:00 ERROR 23172 --- [core] [nio-8081-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.data.mongodb.UncategorizedMongoDbException: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-256, userName='root', source='admin', password=<hidden>, mechanismProperties=<hidden>}] with root cause

com.mongodb.MongoCommandException: Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server localhost:27018. The full response is {"ok": 0.0, "errmsg": "Authentication failed.", "code": 18, "codeName": "AuthenticationFailed"}
at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:205) ~[mongodb-driver-core-4.11.1.jar:na]

 

⛳해결 : 비밀번호를 복잡하게 바꿨다

비밀번호가 너무 짧아서 안 된 거였다

58155815

testpassword1234로 변경하니까

잘 돌아갔다

 

admin에 root가 없는지 검증하느라 엄청 시간을 썼는데 그게 아니었다고 한다