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

Command info: Comparison method violates its general contract! #1575

Closed
aoksys opened this issue Mar 27, 2017 · 8 comments
Closed

Command info: Comparison method violates its general contract! #1575

aoksys opened this issue Mar 27, 2017 · 8 comments

Comments

@aoksys
Copy link

aoksys commented Mar 27, 2017

What version of Flyway are you using?

4.1.2

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

Command-line

What database are you using (type & version)?

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

What operating system are you using?

Windows 7 Professional Service Pack 1

What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)

There exist several normal successful migrations in the database, which have been executed with flyway Version 3.2.1.
Now i want to proceed with some new migrations using flyway Version 4.1.2.
Before doing that I ran the command "flyway.cmd info" and receive the error message:
ERROR: java.lang.IllegalArgumentException: Comparison method violates its general contract!

Note:
To reproduce the error, please find attached a zip-file containing:

  • my configuration Settings (directory 'conf')
  • the insert-statements to restore my original schema-table-state to reproduce the error in your local database (file named 'inserts_bug.sql', possibly here you have to modify the tablespace-names)
  • the sql-migrations (Directory 'sql', the content of the SQL-migration-files is not relevant for the bug, only the names, so you find all files more or less empty.)
  • the oracle-jdbc-driver I am using (directory 'drivers')

flyway_bug.zip

What did you expect to see?

The normal info-Output.

What did you see instead?

This error message:
ERROR: java.lang.IllegalArgumentException: Comparison method violates its general contract!

@aoksys
Copy link
Author

aoksys commented May 22, 2017

Hi Axel,

I noticed, that the milestone for this issue has been changed to 5.0.0.
In my eyes, the bug is quite relevant. It appears only under certain circumstances (i.e. data constellations). The main effect is, when the bug appears, it appears on all flyway commands and not only on the command "info" (sorry, I didn't point up that before) and I think, this may have an impact on all flyway users.

For that reason we are forced to remain with all of our customers on Version 3.2.1, because we are responsible for the reliability of our delivered software (including database).
For that reason I would appreciate, if you could decide to accelerate the problem solution.

Please don't hesitate to contact me here, if you need additional information concerning this issue.

Best regards.

@ghost
Copy link

ghost commented Jun 19, 2017

I believe this is related to a change in the way Java performs sorting:

http://www.oracle.com/technetwork/java/javase/compatibility-417013.html#source
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6804124

To circumvent this issue in the short term I added the following parameter to the flyway java command line:

-Djava.util.Arrays.useLegacyMergeSort=true

I suspect the reason why 3.21 works is because it's bundled with an earlier JAVA version?

@ford-thomas-w
Copy link

I am getting this error too, but I don't know how to apply this suggested short term fix. Sorry, a noob question: where is the "flyway java command line" ? I have flyway installed on an Ubuntu 14.04 headless server.

@ghost
Copy link

ghost commented Jun 19, 2017

Edit the file 'flyway'

Add the parameters to the end of the JAVA_ARGS line

@aoksys
Copy link
Author

aoksys commented Jun 20, 2017

Here an extract of the file 'flyway' to clarify:

...
if $linux; then
JAVA_ARGS='-Djava.security.egd=file:/dev/../dev/urandom -Djava.util.Arrays.useLegacyMergeSort=true'
fi
if $cygwin; then
CP=$(cygpath -pw "$CP")
fi
"$JAVA_CMD" $JAVA_ARGS -cp "$CP" org.flywaydb.commandline.Main "$@"
...

@aoksys aoksys closed this as completed Jun 20, 2017
@aoksys aoksys reopened this Jun 20, 2017
@aoksys
Copy link
Author

aoksys commented Jun 20, 2017

By the way, thanks to junkmanuk.
This seems to be a fine workaround.

@axelfontaine :
But honestly we would appreciate to receive a stable solution of this issue, which works with all Java versions. We're looking forward to Flyway 5.0.0!

@ghost
Copy link

ghost commented Jun 20, 2017

Sorry for the brevity of my response - was on mobile - pleased it helps as much as it helped me!

I'd try to submit a bug fix but I'm not a Java dev by trade and tbh the whole transitive thing confused the heck out of me!

@ford-thomas-w
Copy link

Worked! Thank you both!

axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Nov 27, 2017
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
Development

No branches or pull requests

3 participants