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

Improve connection exception by including underlying driver exception trace #3033

Merged
merged 2 commits into from Jul 12, 2022

Conversation

hessjcg
Copy link
Contributor

@hessjcg hessjcg commented Jul 1, 2022

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

When there is an unexpected exception while connecting to the database, liquibase should populate the "causedBy"
exception so that it is possible to troubleshoot connection problems. Without this, users are shooting
in the dark if the connection fails.

Things to worry about

  • Underlying JDBC drivers may leak private data in its exception. This is probably beyond the scope of the liquibase code.

Additional Context

I'm submitting this PR because of problems that my customers have using liquibase with
google cloud sql. Often the problems are related to configuration issues that prevent them
from connecting and are easily resolved. The configuration problems are explained in exception
messages thrown by the custom google cloud sql socket factory.

However, when my customers Liquibase, these messages are hidden. It would be helpful
to let them see the full stack trace.

When there is an unexpected exception while connecting to the database, liquibase should populate the "causedBy" 
exception so that it is possible to troubleshoot connection problems. Without this, users are shooting
in the dark if the connection fails.
Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I think the "caused by" must have gotten missed there, there should be no reason to suppress that.

@hessjcg
Copy link
Contributor Author

hessjcg commented Jul 6, 2022

@StevenMassaro thanks for the quick review. Would you mind adding the tag SafeToBuild so that the builds can run?
The builds are currently blocked because... "A member of Liquibase team needs to apply label 'SafeToBuild'! "

@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Jul 6, 2022
@nvoxland
Copy link
Contributor

nvoxland commented Jul 6, 2022

Thanks for the reminder on the label. I added it

@kataggart kataggart added this to the NEXT milestone Jul 6, 2022
@github-actions
Copy link

github-actions bot commented Jul 6, 2022

Unit Test Results

  4 560 files  ±0    4 560 suites  ±0   34m 49s ⏱️ + 3m 41s
  4 539 tests ±0    4 321 ✔️ ±0     218 💤 ±0  0 ±0 
53 760 runs  ±0  48 748 ✔️ ±0  5 012 💤 ±0  0 ±0 

Results for commit 2b314f7. ± Comparison against base commit bd71f9f.

@FBurguer FBurguer self-assigned this Jul 7, 2022
@FBurguer
Copy link

FBurguer commented Jul 7, 2022

Reproduced this PR on MySQL and looks like it works as excpected and showing the right complete stack trace

Test Environment
OS: Windows 10
MySQL container 8.0.27
Java 8

@nvoxland nvoxland merged commit 13fea61 into liquibase:master Jul 12, 2022
Conditioning++ automation moved this from To Do to Done Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloudGCP enabler errorReporting SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions sprint2022-29 TypeEnhancement
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants