Trying to work with Liquibase maven plugin for mongo and SQL

HI

my project has two DB. SQL and Mongo, I need to configure our project to automate for both.
I have created two profiles

  1. mongo - in mongo i have following two dependencies added:


    org.liquibase.ext
    liquibase-mongodb
    4.3.2


    org.mongodb
    mongo-java-driver
    3.12.10

Following are my mongo.properties

changeLogFile: src/main/resources/db/mongo/web_db/master.xml
url: mongodb://hostname:2052/@@
username:@@@
password:@@@
driver: liquibase.ext.mongodb.database.MongoClientDriver
logLevel: DEBUG

  1. SQL - in this following dependencies are added:

    com.microsoft.sqlserver
    mssql-jdbc
    7.4.1.jre11

When i run with SQL profile, it runs fine and updates the DB.
But when i run with mongo profile, it gives me following error:
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:4.1.0:update (web_db) on project liquibase:
[ERROR] Error setting up or running Liquibase:
[ERROR] liquibase.exception.DatabaseException: Could not execute: Command failed with error 13 (Unauthorized): 'not authorized on web_db to execute command { collMod: “DATABASECHANGELOGLOCK”, validator: { $jsonSchema: { bsonType: “object”, description: “Database Lock Collection”, required: [ “_id”, “locked” ], properties: { _id: { bsonType: “int”, description: “Unique lock identifier” }, locked: { bsonType: “bool”, description: “Lock flag” }, lockGranted: { bsonType: “date”, description: “Timestamp when lock acquired” }, lockedBy: { bsonType: [ “string”, “null” ], description: “Owner of the lock” } } } }, validationLev

i have made sure that my user has correct permissions i.e write.
anything i am missing?

Hi @Pooja, I guess this could be related to read access you also need in addition to the write access.

it has readWrite role @aditi
“_id” : “@@@@”,
“userId” : UUID(“32653b66-90cc-408c-abb0-a85e40fe6c7a”),
“user” : “svcMongoLiquibase”,
“db” : “@@”,
“roles” : [
{
“role” : “readWrite”,
“db” : “@@”
}

does this has something to do with how i am defining the properties?
Is the URL correcT?
Or is the URL supposed to have username password in it?

any update on this @aditi ?