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

Print logs on ChangeSet exception #2354

Closed
maxencelaurent opened this issue Jan 11, 2022 · 4 comments · Fixed by #2397
Closed

Print logs on ChangeSet exception #2354

maxencelaurent opened this issue Jan 11, 2022 · 4 comments · Fixed by #2397
Assignees
Milestone

Comments

@maxencelaurent
Copy link

Environment

Liquibase Version: 4.7.0 with CDI Plugin
Liquibase Integration & Version:
Liquibase Extension(s) & Version: any
Database Vendor & Version: any

Operating System Type & Version: any

Description

Despite LiquiBase logs plenty of information, there is not a single statement about exceptions which may occur when applying changesets (FINE level set for all LiquiBase loggers).

The current behaviour is to simply throw exceptions, without any logs.

When Liquibase is run in a CDI environment (weld, in my case), there is no way to understand what's wrong as the only relevant log statement is:

org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-000049: 
    Unable to invoke public void liquibase.integration.cdi.CDILiquibase.onStartup() on liquibase.integration.cdi.CDILiquibase@403e8b5
WELD-000049: Unable to invoke public void liquibase.integration.cdi.CDILiquibase.onStartup() on liquibase.integration.cdi.CDILiquibase@403e8b5

Steps To Reproduce

  • configure liquibase to run in CDI environnement
  • write some changeset that will fail, eg:
<update tableName="doesNotExist">
  <column name="doesNotExistEither" value="" />
</update>
  • Run it.

Actual Behavior

Liquibase does not log any relevant information about what failed.
Only way to understand underlying errors is to use a debugger...

Expected/Desired Behavior

Big fat error message which explain what's wrong

maxencelaurent added a commit to maxencelaurent/liquibase that referenced this issue Jan 11, 2022
@kataggart
Copy link
Contributor

Thanks for taking the time to submit this detail @maxencelaurent . We are reviewing and will get back to you.

@nvoxland
Copy link
Contributor

@maxencelaurent:
I opened an alternate implementation of #2397. That seems to me to be a more general case solution, but I don't personally use CDI enough to know for sure whether it's still going to solve your problem.

What do you think on #2397 vs. #2355?

@maxencelaurent
Copy link
Author

@nvoxland
#2397 does indeed look much better.
I'll close #2355

@XDelphiGrl XDelphiGrl self-assigned this Feb 7, 2022
@XDelphiGrl XDelphiGrl removed their assignment Feb 7, 2022
@kataggart kataggart removed the blocked label Feb 7, 2022
@XDelphiGrl
Copy link
Contributor

The Liquibase CDI integration needs some love from QA. Instead of blocking this PR from merging until a full/official certification of Liquibase CDI completes, @nvoxland added a new integration test, onStartupExceptionsAreCorrectlyHandled() to liquibase-cdi/src/test/java/liquibase/integration/cdi/CDILiquibaseTest.java. This test ran and passed.

I am comfortable with merging this PR, especially given that @maxencelaurent collaborated with Nathan and feels this PR will address the immediate need. Moving to ready to merge.

@XDelphiGrl XDelphiGrl self-assigned this Feb 7, 2022
@nvoxland nvoxland added this to the v4.8.0 milestone Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants