Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown Column Error caused by precondition in addColumn changeSet #5708

Closed
1 of 2 tasks
noahwenck opened this issue Mar 18, 2024 · 4 comments
Closed
1 of 2 tasks

Unknown Column Error caused by precondition in addColumn changeSet #5708

noahwenck opened this issue Mar 18, 2024 · 4 comments

Comments

@noahwenck
Copy link

noahwenck commented Mar 18, 2024

Search first

  • I searched and no similar issues were found

Description

We are having issues with the following log being thrown when running our changeSets: Error: 1054-42S22: Unknown column 't.EXAMPLE_COLUMN' in 'field list'. This is given a WARN log level, but we see one of these logs for every columnExists preconditions in an addColumn changeSet that we have, and they fill up our logs. Our preconditions do pass, so this doesn't break anything, but these logs are a nuisance. Not sure if addColumn preconditions have a hard time with the <not><columnExists/></not> or what. Some extra information is that we use mariaDB, and configure our liquibase changelogs using XML.

Looks like this exact log was added in Liquibase 3.4.1 ([Core-2408] - Unknown column 'LABELS' in 'field list' from changelog.txt).

Steps To Reproduce

*We are using Spring Boot (projects on 2.x and 3.1.x both have this issue, with liquibase versions 4.9.x and 4.25.x both seeing this issue)

  1. Start with a blank database, so that liquibase changelogs will run
  2. Have a createTable changeSet that creates a table, say EXAMPLE_TABLE
  3. In a later changeSet, have a addColumn changeSet (EXAMPLE_COLUMN) that adds a column to EXAMPLE_TABLE. Give this changeSet a precondition that checks if EXAMPLE_COLUMN already exists in EXAMPLE_TABLE, with the returned being not. Like this:

<preConditions onFail="MARK_RAN">
<not><columnExists tablename="EXAMPLE_TABLE" columnname="EXAMPLE_COLUMN"/></not>
</preConditions>

  1. Run the changelogs by running the project, look at logs

Expected/Desired Behavior

These logs should not be thrown when a precondition passes.

Liquibase Version

4.9.1 and 4.25.0

Database Vendor & Version

No response

Liquibase Integration

spring boot

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

No response

Additional Context

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@mpvvliet
Copy link
Contributor

Apparently, the logging comes from this line of code in the MariaDB JDBC driver.

To prevent this, my guess is you'll need to configure logging for the logger org.mariadb.jdbc.message.server to ERROR or higher.

@tati-qalified
Copy link
Contributor

@noahwenck could you confirm if @mpvvliet's suggestion fixes the problem? Thanks!

@noahwenck
Copy link
Author

The suggestion does block the logs, but that is not a solution I would like to use. This does make me worry that this might not necessarily be a liquibase issue (considering I can't find in liquibase any mention this kind of error), but the solution to these undesirable logs should not be blocking all mariaDB JDBC driver error logs.

My hope would be to prevent these errors from being thrown in the first place

@tati-qalified
Copy link
Contributor

Hi @noahwenck, I can confirm that Liquibase doesn't have any say in the logs that come from external JDBC drivers. You will probably get those logs even with log-level=FINE.
I would suggest you consult with the MariaDB team, and they might be able to help you solve this.

Thank you,
Tatiana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants