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
ERROR: Unable to calculate checksum of <<inputfile.sql>> 4/9/2020 4:11:38 PMInput length = 1 #2766
Comments
Can you share the file that is causing the issue? |
@MikielAgutu We are speaking with our legal team on sharing the file. I will get back to you |
What character encoding are you using? Is it consistent across your migration files? |
@Sourav1407 Any news? |
@juliahayward Most of them are UTF-8. We thought the problematic file might be having a different encoding and we tried to even convert that to UTF-8 in notepad++ but still the issue was not resolved. |
@MikielAgutu Awaiting response from our legal team. As soon as we get a reply will share the file. Thanks for your support on the same |
@MikielAgutu PFB one of the problematic file. I have modified the format to .txt from .sql |
@MikielAgutu Tried with the latest one 6.4.4. Got similar errors for the same files 6/12/2020 12:34:31 PMFlyway Community Edition 6.4.4 by Redgate 6/12/2020 12:34:31 PMFlyway Community Edition 6.4.4 by Redgate |
It looks like an issue with the file encoding. If you set in the configuration file:
does that make the migrations run? |
@juliahayward Getting checksum mismatch now after setting flyway.encoding=ISO_8859_1 for almost 100+ files. If I go and ask my deployment team to run the checksum repair in customer's production environment then lot of questions will be raised 6/12/2020 7:51:55 PMERROR: Validate failed: |
@juliahayward Got this for ~100+ files. Was not getting this for 4.2.0. Even if I repair then I don't know the impact and how this encoding is going to impact the future migrations. If I repair the checksum the checksum value will change and if I see any issues with future migrations I will not be able to even rollback to 4.2.0 |
OK, then remove that encoding setting... we will need to expand the encoding functionality so that you can override it on a per-script basis rather than all or nothing. I'll try to implement that in the next patch version, which should be out next week. |
@juliahayward Sure Thanks |
@juliahayward @Lyeeedar Closing comments please. If I upgrade to latest version, will the issue be resolved? Any encoding I have to provide in config? |
Yes. You will need to add a file
and then all should be good. You don't need to alter any previous scripts and the encoding change is not required in the main configuration. |
Which version and edition of Flyway are you using?
Flyway 6.3.3
If this is not the latest version, can you reproduce the issue with the latest one as well(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
This issue was not there in 4.2.0 but when we tried to upgrade to 6.2.2 this issue appeared. Upgraded with the latest version i.e. 6.3.3 but the issue still persists
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Command-line
Which database are you using (type & version)?
PostgreSQL 11.6
Which operating system are you using?
RHEL 7.5
What did you do?
Upgraded the docker image which has flyway bundle as the migration tool. Image is having SQL files which are checked in by our engineering team members. They uses different types of editor such as pgadmin,dbeaver,notepad++
All was good in 4.2.0 until we decided to upgrade to 6.2.2 to fix a security issue which popped up due to 2 of the DB drivers present in the flyway db. Once we upgraded, the security issue was resolved as the 6.2.2 version of flyway was using latest versions of the drivers but we started facing this "unable to calculate checksum" issue. Then we had to downgrade it back to 4.2.0 and decided to remove the drivers from the pack which were causing the security issues. Removal of the drivers from the image solved the problem but we want to upgrade the flyway now so that we don't have to remove the drivers
What did you expect to see?
The expectation is that this issue should not pop up as we can't go and correct the type conversion to UTF-8 for each and every file. For lot of files used for different engines and modules we are facing this. Even we tried to convert one problematic file to UTF-8 in notepad++ but we were still receiving the same error. We have lot of SQL files checked in for last few years and now they have grown up so much that we can't go and correct each of them or ask our engineers to correct them and also we don't even know how the file changes will impact the upgrade process in customer environments using our product and also as I said we are not sure also that the issue will be resolved post the changes of UTF-8 conversion. Any configuration tweak may also help if there is a way so that this error can be bypassed.
What did you see instead?
The expectation is that the issue should not pop up and the latest version of flyway and it should behave like 4.2.0 so that we can upgrade the latest flyway db in our database image
The text was updated successfully, but these errors were encountered: