easypanel-io / community

Modern server control panel powered by Docker
https://easypanel.io
51 stars 4 forks source link

MongoDB Failed Authentication #45

Closed Ponkhy closed 2 years ago

Ponkhy commented 2 years ago

Error:

{"t":{"$date":"2022-05-10T19:57:28.141+00:00"},"s":"I",  "c":"ACCESS",   "id":20249,   "ctx":"conn24","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-256","speculative":true,"principalName":"mongo","authenticationDatabase":"templates","remote":"10.0.1.4:53476","extraInfo":{},"error":"UserNotFound: Could not find user \"mongo\" for db \"templates\""}}
{"t":{"$date":"2022-05-10T19:57:28.147+00:00"},"s":"I",  "c":"ACCESS",   "id":20249,   "ctx":"conn24","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-1","speculative":false,"principalName":"mongo","authenticationDatabase":"templates","remote":"10.0.1.4:53476","extraInfo":{},"error":"UserNotFound: Could not find user \"mongo\" for db \"templates\""}}
deiucanta commented 2 years ago

The connection works for me but the database is not created. Mongo creates databases lazily, so a database is not available until you write some data to it.

If you remove the last part from the connection URL it should work.

Can you try it?

Ponkhy commented 2 years ago

It does work! Thanks Wow, i've never experienced it with MongoDB.