# Liquibase Maven Plugin with Mongo DB updateSQL

**URL:** <https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214>\
**Category:** General Discussion\
**Created:** [March 18, 2021, 4:09pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214 "2021-03-18T16:09:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pooja](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@Pooja](https://forum.liquibase.org/u/Pooja)\
**Post date:** [March 18, 2021, 4:09pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/1 "2021-03-18T16:09:08Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![ronak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/ronak/32/221_2.png) [@ronak](https://forum.liquibase.org/u/ronak)\
**Post date:** [March 18, 2021, 7:07pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/2 "2021-03-18T19:07:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pooja](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@Pooja](https://forum.liquibase.org/u/Pooja)\
**Post date:** [March 18, 2021, 10:20pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/3 "2021-03-18T22:20:25Z")

</div>

[

- 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

---

<div class="post-metadata">

**Author:** ![Pooja](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@Pooja](https://forum.liquibase.org/u/Pooja)\
**Post date:** [March 19, 2021, 2:01am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/4 "2021-03-19T02:01:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ronak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/ronak/32/221_2.png) [@ronak](https://forum.liquibase.org/u/ronak)\
**Post date:** [March 19, 2021, 12:22pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/5 "2021-03-19T12:22:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pooja](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@Pooja](https://forum.liquibase.org/u/Pooja)\
**Post date:** [March 19, 2021, 2:15pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/6 "2021-03-19T14:15:18Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Pooja](https://avatars.discourse-cdn.com/v4/letter/p/a5b964/32.png) [@Pooja](https://forum.liquibase.org/u/Pooja)\
**Post date:** [March 22, 2021, 1:09pm UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/7 "2021-03-22T13:09:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![alexandru.slobodcico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/alexandru.slobodcico/32/334_2.png) [@alexandru.slobodcico](https://forum.liquibase.org/u/alexandru.slobodcico)\
**Post date:** [April 4, 2021, 5:45am UTC](https://forum.liquibase.org/t/liquibase-maven-plugin-with-mongo-db-updatesql/5214/8 "2021-04-04T05:45:41Z")

</div>

> [@Pooja](#):
>
> updateSQL

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

> <https://github.com/liquibase/liquibase-mongodb/issues/120>
>
> From Liquibase Forum: 
> https://forum.liquibase.org/t/liquibase-maven-plugin-wit…h-mongo-db-updatesql/5214/7
> https://forum.liquibase.org/t/doesnt-liquibase-updatesql-goal-work-with-mongo/5251
> 
> There is no plans yet to enable this feature. 
> Will adjust README do be more explicit on supported features. 
> This issue will remain in backlog if any Idea how to implement it comes. to mind.
> 
> 
> 
> ┆Issue is synchronized with this \[Jira Bug\](https://datical.atlassian.net/browse/LB-1411) by \[Unito\](https://www.unito.io/learn-more)
