I am facing an unusual error while deploying my database scripts. I am leveraging Liquibase to deploy my scripts. It was running all good till now, BTW, my DB server is Aurora Posgtres with Babelfish enabled, which allows you to talk to the DB using T-sql syntax and 1433 port, though the engine is Postgres. Now I upgraded the Auorora Postgres engine from 15.6 to 16.4 and now the Liquibase fails with below errors. Surprisingly I don’t have any Substring in my scripts. To rule out this, I have setup locally to test and I see same behaviour. Has anyone faced this error with Liquibase with MSSQL? If yes, please let me know what should be the fix/tweak. Thanks.
Edited: Below is my docker command which I use for my Project. This would run in AWS code build.
docker run --rm -v $(pwd):/liquibase/changelog liquibase/liquibase --database-changelog-table-name='databasechangelog' --search-path='/liquibase/changelog' update --url="jdbc:sqlserver://host:1433;databaseName=master;encrypt=true;trustServerCertificate=true" --changelog-file='Changelog.xml' --username=******* --password='*******'
Below is how my Changelog.xml looks like.
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">
<includeAll path="deploy"/>
</databaseChangeLog>
Run code snippet
Expand snippet
deploy is the directory where I host all my liquibase formatted sql files to be deployed/migrated. Find an image of my Project directory structure.
Error as below.
Liquibase Open Source 4.31.1 by Liquibase ERROR: Exception Details ERROR: Exception Primary Class: SQLServerException ERROR: Exception Primary Reason: Argument data type char is invalid for argument 1 of substring function. ERROR: Exception Primary Source: Microsoft SQL Server 12.00.2000 Unexpected error running Liquibase: Argument data type char is invalid for argument 1 of substring function.