-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
JdbcUtils#openConnection
sets unrelated polyglot.engine.WarnInterpreterOnly
property
#3882
Comments
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:
As this method assumes the property values are strings. |
I totally agree that this is weird and shouldn't something that Flyway should be doing. Caught us out, we use Graal but not Mongo within our application and we started getting this exception -
Seems like the issue of it being set as a boolean instead of a string was at least fixed in version 10.11.1 see b674678 |
Issue fixed in Flyway 10.11.1: set System Properties as String rather than Boolean |
@JasonLuo-Redgate respectfully, it is not. I am using 10.11.1. The issue is not about which value is being set as a system property, it's about why the value is being set in the first place. |
Hi @myazinn , The reason is due to the MongoDB driver use by Flyway requiring that option to be set globally. |
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: