motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.77k stars 319 forks source link

Failed to connect to MongoDB with username and password #480

Open gengqin opened 2 years ago

gengqin commented 2 years ago

It does not work when using authenticated MongoDB to store API definition

Reproduction Steps: Configuration toml: [database] dsn = "mongodb://USERNAME:PASSWORD@janus-database:27017/janus"

Expected behavior:

It is expected to work as non-authenticated mongodb

Observed behavior: Run: janus start Error Message:

{"error":"could not build a repository for the database: could not connect to mongodb: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.","level":"error","msg":"could not build a repository for the database: could not connect to mongodb: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.","time":"2021-11-02T16:40:07+08:00"}

Janus version: [janus version 4.0.0] OS and version: [Ubuntu]

gengqin commented 2 years ago

Solved by self build in local environment.