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

Checksum mismatch error not helpful #1813

Closed
o2dac opened this issue Nov 2, 2017 · 3 comments
Closed

Checksum mismatch error not helpful #1813

o2dac opened this issue Nov 2, 2017 · 3 comments
Labels
Milestone

Comments

@o2dac
Copy link

@o2dac o2dac commented Nov 2, 2017

What version of Flyway are you using?

3.2.1

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)

Spring boot, Maven

What database are you using (type & version)?

Postgres 9.3

What operating system are you using?

Ubuntu 16.04

What did you do?

Developer (e.g. accidentally) changed one of the migration scripts file.

What did you expect to see?

Flyway should log the error along with file name, so we can quickly identify what file was changed and check the history of the file.

What did you see instead?

It logged only the checksums. So if we want to troubleshoot the migration script we need to go to the schema_version table and looking for the checksums.
Below is an excerpt of what was printed on the stack trace

org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 2
-> Applied to database : 168520745
-> Resolved locally    : -1886360926
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Nov 2, 2017

Well isn't it trivial to find this out based on the version number provided by the error message?

@o2dac
Copy link
Author

@o2dac o2dac commented Nov 4, 2017

Unfortunately, I didn’t see the version mentioned anywhere in the error log. Does “migration 2” refer to “version” that you’re talking about? If true, that’s a bit clearer, but it means something else went wrong, because the version that actually causes the checksum mismatch error is version 19 in my configuration. So yes, a vesion info is good enough, as long as it is actually printed out. E.g. if my file is named V1.8__some_change.sql, then the error log should at least say “V1.8”. Currently it doesn’t.

@o2dac o2dac changed the title Checksum mistatch error not helpful, should log file name causing the error Checksum mismatch error not helpful, should log file name causing the error Nov 4, 2017
@axelfontaine axelfontaine changed the title Checksum mismatch error not helpful, should log file name causing the error Checksum mismatch error not helpful Nov 13, 2017
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Nov 13, 2017
@axelfontaine axelfontaine added this to the Flyway 5.0.0 milestone Nov 13, 2017
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Nov 13, 2017

Even though the message already contained the version number for versioned migrations, we decided the name making in even more explicit by also including the string version. The message you got is now printed as

org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration version 2
-> Applied to database : 168520745
-> Resolved locally    : -1886360926
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.