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

Azure MySQL database version incorrectly detected (5.6 instead of 5.7) #2519

Closed
antoniomateo opened this issue Sep 26, 2019 · 9 comments

Comments

@antoniomateo
Copy link

@antoniomateo antoniomateo commented Sep 26, 2019

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]

@MikielAgutu

This comment has been minimized.

Copy link
Member

@MikielAgutu MikielAgutu commented Sep 26, 2019

Looks like this is a bug within the MySQL Azure service itself:

MySQL server instance displays the wrong server version after connection is established. To get the correct server instance engine version, use the select version(); command.

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.

@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Oct 4, 2019

Actually, I have a workround. Reopening...

@antoniomateo

This comment has been minimized.

Copy link
Author

@antoniomateo antoniomateo commented Oct 4, 2019

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.

@MikielAgutu MikielAgutu removed the r: invalid label Oct 7, 2019
@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Oct 7, 2019

Essentially we can spot the case where the JDBC metadata and result of select version(); return conflicting information, and in that case assume that the latter is correct - at least until such time as Azure is confirmed fixed. I hope to get it into 6.0.5 which should happen early this week.

@Matonen

This comment has been minimized.

Copy link

@Matonen Matonen commented Oct 15, 2019

Trying to migrate using Flyway Community Edition 6.0.6 by Redgate but i get following error:

WARNING: Azure MySQL database - reporting v5.6 in JDBC metadata but database actually v5.7.26-log
ERROR: Version may only contain 0..9 and . (dot). Invalid version: 5.7.26-log
@juliahayward juliahayward reopened this Oct 15, 2019
@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Oct 16, 2019

@Matonen I couldn't reproduce this odd result (5.7.26-log) from select version() on our Azure subscription. Is there anything out of the ordinary you need to do to see it? It doesn't stop me doing a fix, but it would be helpful to understand the context and anticipate any other unusual responses.

@Matonen

This comment has been minimized.

Copy link

@Matonen Matonen commented Oct 17, 2019

I also run select version() using the MySQL Workbench and it returns 5.7.26-log. MySQL server tier is Basic and version is 5.7. Server is created to WestEurope.

@stevenenen

This comment has been minimized.

Copy link

@stevenenen stevenenen commented Oct 17, 2019

I have the exact same issue, but I just found out that it's because of the Basic 5.7 version. Try to create a General Purpose, 2 vCore(s), 100 GB and then it works for now.

@juliahayward

This comment has been minimized.

Copy link
Member

@juliahayward juliahayward commented Oct 17, 2019

Many thanks - I've reproduced it now. A fix on the way for 6.0.7.

MikielAgutu added a commit that referenced this issue Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.