You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which version and edition of Flyway are you using?
10.11.1
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)
It is the latest one
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Java API
Which database are you using? (Type & version)
Postgresql 15.5
Which operating system are you using?
Doesn't matter
What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)
In our project, we use flyway and a bunch of graalvm libs
of version 21.1.0.
With newer versions of flyway our service stopped working because org.graalvm.polyglot.Context.Builder can no longer create a org.graalvm.polyglot.Context and fails with the following error
Could not find option with name engine.WarnInterpreterOnly.
This flag was introduced in 21.2.0, while we use 21.1.0. There are reason why we use this particular old version, so unfortunately we cannot just bump it. We were surprised to find out that this flag is being set by flyway for Postgres, which doesn't have any graalvm-related dependencies.
It seems the issue was introduced here. The commit message states that it was intended to set property to hide warning from polyglot engine, but why? Why would one library set a system property that belongs to other, completely unrelated, library?
I see there was an issue regarding this flag related to MongoDB. Perhaps it makes sense for Mongo specifically (even though sounds weird to me), but why do this in JdbcUtils?
What did you expect to see?
That everything works fine
What did you see instead?
For some bizarre reason org.flywaydb.core.internal.jdbc.JdbcUtils#openConnection sets polyglot.engine.WarnInterpreterOnly system property to "false".
Making matters worse, it's not deterministic and depends on the initialisation order. If org.graalvm.polyglot.Context happens to be created before we open any DB connection, that everything works fine. Otherwise, we get an error.
In our case, we had to remove this property manually (System.clearProperty("polyglot.engine.WarnInterpreterOnly")) to make it work. But that's neither a good workaround, nor a real solution.
The text was updated successfully, but these errors were encountered:
Thank you for your issue. The reason is due to the MongoDB driver use by Flyway requiring that option to be set global. As Flyway does not usualy interact with GraalVM it was not seen as an issue initially. However, I appreciate the way you are using Flyway has hit this issue and I will raise a ticket in our development pipeline to deal with this appropriately.
Oh, I just got caught by this, because I do have code that tries to reset properties between tests. It does this using System.clearProperty, and at least with java17, results in:
java.lang.ClassCastException: java.lang.Boolean incompatible with java.lang.String
at java.base/java.lang.System.clearProperty(System.java:956)
As this method assumes the property values are strings.
Which version and edition of Flyway are you using?
10.11.1
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)
It is the latest one
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Java API
Which database are you using? (Type & version)
Postgresql 15.5
Which operating system are you using?
Doesn't matter
What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)
In our project, we use flyway and a bunch of graalvm libs
of version
21.1.0
.With newer versions of flyway our service stopped working because
org.graalvm.polyglot.Context.Builder
can no longer create aorg.graalvm.polyglot.Context
and fails with the following errorThis flag was introduced in
21.2.0
, while we use21.1.0
. There are reason why we use this particular old version, so unfortunately we cannot just bump it. We were surprised to find out that this flag is being set by flyway for Postgres, which doesn't have any graalvm-related dependencies.It seems the issue was introduced here. The commit message states that it was intended to
set property to hide warning from polyglot engine
, but why? Why would one library set a system property that belongs to other, completely unrelated, library?I see there was an issue regarding this flag related to MongoDB. Perhaps it makes sense for Mongo specifically (even though sounds weird to me), but why do this in
JdbcUtils
?What did you expect to see?
That everything works fine
What did you see instead?
For some bizarre reason
org.flywaydb.core.internal.jdbc.JdbcUtils#openConnection
setspolyglot.engine.WarnInterpreterOnly
system property to"false"
.Making matters worse, it's not deterministic and depends on the initialisation order. If
org.graalvm.polyglot.Context
happens to be created before we open any DB connection, that everything works fine. Otherwise, we get an error.In our case, we had to remove this property manually (
System.clearProperty("polyglot.engine.WarnInterpreterOnly")
) to make it work. But that's neither a good workaround, nor a real solution.The text was updated successfully, but these errors were encountered: