Skip to content
Advertisement

Attempt to switch database target during SASL authentication

I try to setup a Mongo DB in Spring Boot project. I’ve set an uri in application.yml:

JavaScript

But application fails to read data from repository with error:

JavaScript

Line where error occurs (kotlin):

JavaScript

where

JavaScript

and

JavaScript

The same error occurs with findAll and save operations on repository (and likely others too)

Stack trace:

JavaScript

I am able to connect to mongo via Intellij Idea client with the same credentials.

I run mongo db with docker-compose

JavaScript

where mongo-init.js is

JavaScript

What is going on? The only place in the internet where I found this error message is… mongo source code 8].

Any help appreciated.

Advertisement

Answer

It seems that it’s a bug in mongo DB version

JavaScript

I’ve changed image in docker-compose to

JavaScript

and the error went away. Uh, so many hours….

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement