-
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
Azure MySQL database version incorrectly detected (5.6 instead of 5.7) #2519
Comments
Looks like this is a bug within the MySQL Azure service itself:
I don't think we can do anything about it unfortunately. We'll have to wait for Microsoft to fix the issue on their end. |
Actually, I have a workround. Reopening... |
Hi Julia. Great, that's good news. Could you explain the workaround please? I mean, is that something we can already apply or need to wait for a new flyway release? Thanks in advance. |
Essentially we can spot the case where the JDBC metadata and result of |
Trying to migrate using Flyway Community Edition 6.0.6 by Redgate but i get following error:
|
@Matonen I couldn't reproduce this odd result ( |
I also run |
I have the exact same issue, but I just found out that it's because of the |
Many thanks - I've reproduced it now. A fix on the way for 6.0.7. |
I'm still seeing this issue using MySQL 8.0 in Azure and version 6.1.1 of the Flyway gradle plugin. |
I also still have this issue when using a Basic 5.7 tier. It only works for me with a General Purpose, 2 vCore(s), 100 GB. |
@tygern @stevenenen Would you be able to run |
@tygern I've got a repro for you, a fix will go in v6.1.2. @stevenenen No joy when I create a Basic 5.7 db... could you also send me the output of |
@juliahayward Great, thanks. Just to answer your question, I saw |
…5.6 instead of 5.7)
Could you please guide me here: https://stackoverflow.com/questions/61558699/caused-by-org-flywaydb-core-api-flywayexception-migration-failed-and-spring ? |
Hi Ash, as mentioned in the SO post the underlying problem is that you migration is invalid for the version of MySQL you're using. I see in your Stack Overflow post that you are using Flyway 5.2.4. There were a number of fixes around MySQL versioning in v6 a while back and we recommend you upgrade as far forward as possible. |
I am using Flyway with a Kotlin / Micronaut application and I am still running into this same issue with an Azure MySQL 8 database. My Flyway version, etc: 16:16:42.946 [main] INFO o.f.c.i.license.VersionPrinter - Flyway Community Edition 6.4.4 by Redgate I have confirmed that the database is MySQL 8. Also I have confirmed that when connecting to a local MySQL 8 database, as opposed to one on Azure, I get the correct version coming through in the second info log statement above. I believe this issue was fixed prior to version 6.4.4, any idea why I am still running into it given that I am running version 6.4.4? |
@brent777 What is the exact output of |
@brent777 Any news? |
Revisited it with the current version (v8.0.15). The correct string comes through from MySQL |
@juliahayward I just tested it with MySQL 8.0.15 on Azure and flyway still detects it as 5.x. Are you sure that you aren't parsing something from the welcome header? (which reports a 5.6 instead of the 8.0)
|
@pschwager Do you still get the |
@pschwager We certainly don't parse the header, although it is quite possible the JDBC driver does under the hood (which would explain the consistent problems with incorrect JDBC metadata we have to work around). Could you confirm the versions of Flyway and the JDBC driver you're using? |
OK, after a long search through the code, I found a property which sets the |
Thanks for letting us know! It's really helpful for us as we weren't aware of that property - it might help out some of the other people on the thread. |
Which version and edition of Flyway are you using?
6.0.4 - Community edition
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)
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Maven plugin
Which database are you using (type & version)?
Azure MySQL 5.7, not 5.6 as the error says. See this note in Azure:
NOTE: In the service, a gateway is used to redirect the connections to server instances. After the connection is established, the MySQL client displays the version of MySQL set in the gateway, not the actual version running on your MySQL server instance. To determine the version of your MySQL server instance, use the SELECT VERSION(); command at the MySQL prompt.
Extracted from: https://docs.microsoft.com/en-us/azure/mysql/concepts-supported-versions
Which operating system are you using?
Ubuntu:latest
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
Ran the flyway maven plugin to migrate an Azure database for the first time:
goals: 'flyway:migrate'
What did you expect to see?
The database tables created.
What did you see instead?
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:6.0.4:migrate (default-cli) on project initializer: org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException: Flyway Enterprise Edition or MySQL upgrade required: MySQL 5.6 is no longer supported by Flyway Community Edition, but still supported by Flyway Enterprise Edition. -> [Help 1]
The text was updated successfully, but these errors were encountered: