question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flyway can't calculate the checksum of a large SQL script

See original GitHub issue
Which version and edition of Flyway are you using?

6.0.2

If this is not the latest version, can you reproduce the issue with the latest one as well?

Yes

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

Command-line

Which database are you using (type & version)?

Oracle 12.1

Which operating system are you using?

Windows

What did you do?

I exported my database using SQL Developer, creating a SQL file ~32MB in size which I used as an effective baseline. When I tried to run flyway info, I got the following error:

Unable to calculate checksum for V001.001__BaselineScript.sql: Input length = 1
: Running flyway info failed: "C:\Program Files\flyway\flyway.cmd" exited with code 1
Flyway Enterprise Edition (unlimited schemas) 6.0.2 by Redgate
Database: jdbc:oracle:thin:@//localhost:1521/db (Oracle 12.1)

ERROR: Unable to calculate checksum for V001.001__BaselineScript.sql: Input length = 1
What did you expect to see?

I expected to see a standard flyway info response. The SQL script is valid and can be run in SQL Developer. When I tried to do something similar but on a much smaller database it all worked which suggests the size of the file is causing the problem.

What did you see instead?

See error as described above

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
rscerocommented, May 1, 2020

Wanted to add a bit to this discussion. Had this exact problem yesterday, ERROR: Unable to calculate checksum of <script file> Input Length=1. Looked through many discussions, went down the rabbit hole testing them, none of them worked. Script was not large at all, ran the repair command, even tried converting the encoding between UTF-8 and ANSI. Nothing worked. To make it more confusing, the procedure being changed hadn’t been updated in probably 4-5 years (prior to us using flyway), the change was minor, and the change script code, when run in SQL, ran fine. After a LOT of testing, found the issue. Our procedures have a comment header that maintains information on history of changes and other info. Part of that header is a copyright statement. Example: –COPYRIGHT 2011 … Well, in this particular procedure, that had been set at: © 2011… Yep, it was the © character that was causing the issue. Removed that, added COPYRIGHT statement, problem solved.

1reaction
hdiasscommented, May 13, 2020

@rscero saved hours of my life, Cheers to you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flyway Error - When I run migrate command. I get "Unable to ...
Flyway Error - When I run migrate command. I get "Unable to calculate checksum" ... And I've got this error. ... The file's...
Read more >
Flyway can't calculate the checksum of a large SQL script
Unable to calculate checksum for V001.001__BaselineScript.sql: Input length = 1 : Running flyway info failed: "C:\Program ...
Read more >
Flyway Error - When I Run Migrate Command. I Get "Unable ...
Use Flyway 6.0.8 Unable to calculate checksum on not changed SQL Scripts #2558 ... Script was not large at all ran the repair...
Read more >
Repair - Flyway by Redgate • Database Migrations Made Easy.
Repairs the schema history table. Repair is your tool to fix issues with the schema history table. It has a few main uses:...
Read more >
Database Migrations with Flyway - Baeldung
Flyway updates a database from one version to the next using migrations. We can write migrations either in SQL with database-specific syntax ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found