Using Liquibase with NAT gateway

We’re trying to create a Liquibase deployment via a GitLab CI/CD pipeline for our Oracle databases in EC2 instances on AWS. In order to reach the databases, we need to use a NAT gateway so I’ve specify that on the connection.
Thank you!

build-job:

tags:

# - test_db

extends: .liquibase_job
image: liquibase/liquibase:latest
stage: build
environment:
name: DEV
script:
- cd ./Liquibase_Oracle_CRM
- liquibase --logFile=${CI_JOB_NAME}_${CI_PIPELINE_ID}.log --log-level=FINE status --username=XXX_LIQUIBASE --password=$DEV_PASSWORD --url=$COMMAND_URL_DEV1 --driver=oracle.jdbc.OracleDriver
- echo “This job tested successfully with liquibase in DEV environment”
rules:
- if: ‘$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH’

The Dev url is ******.us-east-1.amazonaws.com:9999:XXX01.CONNECT_TIMEOUT=1200

The relavent output from the pipeline is
Starting Liquibase at 19:22:56 using Java 21.0.7 (version 4.32.0 #8159 built at 2025-05-19 23:00+0000)
Liquibase Version: 4.32.0
Liquibase Open Source 4.32.0 by Liquibase
ERROR: Exception Details
ERROR: Exception Primary Class: DatabaseException
ERROR: Exception Primary Reason: Connection could not be created to ****************.us-east-1.amazonaws.com:9999:XXX01.CONNECT_TIMEOUT=1200 with driver oracle.jdbc.OracleDriver. Possibly the wrong driver for the given database URL
ERROR: Exception Primary Source: 4.32.0
Unexpected error running Liquibase: Connection could not be created to **************************.us-east-1.amazonaws.com:9999:XXX01.CONNECT_TIMEOUT=1200 with driver oracle.jdbc.OracleDriver. Possibly the wrong driver for the given database URL

I spent a little time troubleshooting this and think it’s caused by the format of your database URL. Here’s what I suggest:

  1. Make sure the value of the url parameter is in the proper format for Oracle. This should be similar to jdbc:oracle:thin:@<hostname>:<port>/<service or SID>
  2. Append the CONNECT_TIMEOUT=1200 connection property to the URL preceded by a ?

EXAMPLE: jdbc:oracle:thin:@localhost:1521/XE?CONNECT_TIMEOUT=1200

Good luck! Let me know how it goes.

Thank you, Pete for your quick response! I’m in the midst of trying this. It definitely helped, got a new error which I’ll look at. Unfortunately, another issue arose, a non-Liquibase-related production which I need to take care of first. I should be able to report back here later today or tomorrow.

1 Like