Liquibase Maven Plugin with Mongo DB updateSQL

Hello

we are trying to use liquibase-maven-plugin in our project with MONGODB.
We are facing couple of issues:

  1. It does not support updateSQL goal with mongo?
  2. I am not sure if am using correct Mongo properties but i am seeing below error:

Caused by: com.mongodb.MongoCommandException: Command failed with error 13 (Unauthorized): 'not authorized on

These are my mongo.properties:

changeLogFile=src/main/resources/sql/mongo/mongo-master.xml
url:mongodb://server.insight.com:2052/web_db
username:svcMongo
password:S2Sux9RS9sCI
log:DEBUG

If i update the URL to include the user name password in the URL,

Hi @Pooja ,

It looks like your post was cut off. Would you please reply back with:

  • Version of Liquibase being used
  • exact command ran (ex. liquibase updateSQL)
  • Full log so we can see the error in context (be sure to set logLevel=debug in your properties file).

Thanks,

Ronak

[

  • Version of Liquibase being used - 4.3.1

  • exact command ran (ex. liquibase updateSQL)
    UpdateSQL

  • Full log so we can see the error in context (be sure to set logLevel=debug in your properties file
    [/quote]
    I attached those logs earlier

does liquibase-maven-plugin works with mongo with updateSQL goal?
I am able to execute Update goal but with updateSQL i get following error:

[ERROR] Error setting up or running Liquibase:
[ERROR] liquibase.exception.DatabaseException: ReplaceLockChangeLogStatement requires access to up to date database metadata which is not available in SQL output mode

@Pooja , you could just run liquibase updateSQL directly on the command line instead of mvn liquibase:

i did
following are the logs:

[2021-03-19 10:14:47] FINE [liquibase.servicelocator] Loaded liquibase.sqlgenerator.SqlGenerator instance liquibase.ext.mongodb.executor.MongoSqlGenerator
Unexpected error running Liquibase: ReplaceLockChangeLogStatement requires access to up to date database metadata which is not available in SQL output mode
For more information, please use the --logLevel flag
[2021-03-19 10:14:47] SEVERE [liquibase.integration] Unexpected error running Liquibase: ReplaceLockChangeLogStatement requires access to up to date database metadata which is not available in SQL output mode
liquibase.exception.LockException: liquibase.exception.DatabaseException: ReplaceLockChangeLogStatement requires access to up to date database metadata which is not available in SQL output mode
at liquibase.ext.mongodb.lockservice.MongoLockService.acquireLock(MongoLockService.java:184)
at liquibase.ext.mongodb.lockservice.MongoLockService.waitForLock(MongoLockService.java:121)
at liquibase.Liquibase$1.run(Liquibase.java:419)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Liquibase.runInScope(Liquibase.java:2322)
at liquibase.Liquibase.update(Liquibase.java:408)
at liquibase.Liquibase.update(Liquibase.java:400)
at liquibase.integration.commandline.Main.doMigration(Main.java:1798)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:364)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.integration.commandline.Main$1.run(Main.java:363)
at liquibase.integration.commandline.Main$1.run(Main.java:193)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:193)
at liquibase.integration.commandline.Main.main(Main.java:156)
Caused by: liquibase.exception.DatabaseException: ReplaceLockChangeLogStatement requires access to up to date database metadata which is not available in SQL output mode
at liquibase.executor.LoggingExecutor.outputStatement(LoggingExecutor.java:120)
at liquibase.executor.LoggingExecutor.outputStatement(LoggingExecutor.java:114)
at liquibase.executor.LoggingExecutor.update(LoggingExecutor.java:81)
at liquibase.ext.mongodb.lockservice.MongoLockService.acquireLock(MongoLockService.java:163)

any update @ronak ? updateSQL goal wont work with mongodb?

Hi @Pooja updateSQL is not supported. Raised an issue in github to have it in backlog.