Unable to connect to mongo db with URL encoded parameters in username and password

Utils:

  • java 17
  • liquibase - 4.24.0
  • liquibase-mongodb-4.24.0.jar
  • mongodb-driver-core-4.11.0.jar
  • mongodb-driver-sync-4.11.0.jar

Getting the following error when connecting to mongo db using liquibase cli, with password having a special character ‘@’ which is url encoded to ‘%40’

Unexpected error running Liquibase: Could not query for long
  - Caused by: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName='username', source='admin', password=<hidden>, mechanismProperties=<hidden>}
  - Caused by: Command failed with error 18 (AuthenticationFailed): 'Authentication failed.' on server <mongo-atlas-server-host>:port. The full response is {"ok": 0.0, "errmsg": "Authentication failed.", "code": 18, "codeName": "AuthenticationFailed", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1698676589, "i": 1}}, "signature": {"hash": {"$binary": {"base64": "eXwcHcWxHrfcHRsegLd7YpaLrJM=", "subType": "00"}}, "keyId": 7234506813905829892}}, "operationTime": {"$timestamp": {"t": 1698676589, "i": 1}}}ase will typically take place

The same password used to work with
liquibase 4.16.0
mongo-java-driver-3.12.7.jar
liquibase-mongodb-4.16.0.jar

Any ideas how to resolve this ?

Hello @jballurr ,

I attempted the setup you described, and I successfully executed Liquibase commands with a password containing the special character ‘@,’ which is URL encoded as ‘%40.’ Please find the attached screenshot for reference.

Could you please share your liquibase.properties configuration, the changelog/changeset you intend to deploy, and a screenshot of the command-line interface (CLI) with the executed ‘liquibase --version’ command and ‘liquibase update’ showing the reproduced error?
Thanks in advance.

@rberezenskyi , are you using liquibase mongo db extension ?

@jballurr , yes