Applies to
- Liquibase Secure (Pro)
- Liquibase Community (Open Source)
Conditions
-
log-formatset to JSON or JSON_PRETTY -
log-levelset to INFO or FINE - Use a native executor (i.e., sqlplus, sqlcmd, psql, mongosh, etc.)
- Liquibase version 4.31 or older
Issue Summary
While deploying a change that contains large SQL changes using a native executor in a pipeline with JSON or JSON_PRETTY log format and INFO or FINE log-level, the log file can exceed the filesystem size, causing the deployment to crash and fail.
When this occurs, it can be confirmed by checking the generated log file size, which can exceed multiple gigabytes of data before crashing.
Root Cause
When the logs are being generated during the deployment, the SQL in the executed script is included multiple times in the log field of changesetSql. Deploying an SQL file with several hundred or thousands of lines using a native executor can quickly bloat the size of the destination log file.
Resolution
Update Liquibase to version 4.32.0+ and use .gz for the end of the file name for log-file to compress the logs. For example:
$ liquibase --log-format=JSON --log-level=FINE --log-file=../path/to/logs.gz update
Full documentation on this can be found on our documentation site here.
The latest releases can be found on Liquibase.com and GitHub.
Related Article(s)
Can I show the SQL output in the logs?
Comments
0 comments
Article is closed for comments.