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

MySQL 5.7 not working w/ SCDF 2.10 when using config server #5164

Closed
onobc opened this issue Dec 16, 2022 · 2 comments · Fixed by #5176
Closed

MySQL 5.7 not working w/ SCDF 2.10 when using config server #5164

onobc opened this issue Dec 16, 2022 · 2 comments · Fixed by #5176
Assignees
Milestone

Comments

@onobc
Copy link
Contributor

onobc commented Dec 16, 2022

Description

SCDF fails to start w/ the following exception:

Caused by: org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [create sequence if not exists hibernate_sequence start 1 increment 1]; nested exception is java.sql.SQLSyntaxErrorException: (conn=3) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sequence if not exists hibernate_sequence start 1 increment 1' at line 1
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
        at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:431)
        at org.springframework.cloud.dataflow.common.flyway.SqlCommandsRunner.execute(SqlCommandsRunner.java:61)
        at org.springframework.cloud.dataflow.common.flyway.AbstractMigration.migrate(AbstractMigration.java:46)
        at org.flywaydb.core.internal.resolver.java.JavaMigrationExecutor.executeOnce(JavaMigrationExecutor.java:55)
        ... 45 common frames omitted

Environment

  • SCDF: 2.10 w/ config server
  • DB: MySQL 5.7.4
  • Driver: MariaDB

Reproduce

Start Rabbit

docker run -d --hostname rabbitmq --name rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:3.7

Start MySQL 5.7.4

docker run  --name test-mysql -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=spring -e MYSQL_USER=spring -e MYSQL_PASSWORD=spring -e MYSQL_DATABASE=dataflow mysql:5.7.4

Start config sever

Something like this:

@SpringBootApplication
@EnableConfigServer
public class ConfigServer {
    public static void main(String[] args) {
        SpringApplication.run(ConfigServer.class, args);
    }
}

include these properties:

spring.datasource.driver-class-name: org.mariadb.jdbc.Driver
spring.datasource.url: jdbc:mysql://localhost:3306/dataflow?permitMysqlScheme
spring.datasource.username: spring
spring.datasource.password: spring

Install/run SCDF

mkdir tmp-scdf-210
cd tmp-scdf-210
wget https://repo.spring.io/release/org/springframework/cloud/spring-cloud-dataflow-server/2.10.0/spring-cloud-dataflow-server-2.10.0.jar
java -jar spring-cloud-dataflow-server-2.10.0.jar

AND
💣 💣 💣

Additional context

Note that w/o the config server in the picture all works well

  • Stop the config server.
  • Relaunch SCDF as follows:
java -jar spring-cloud-dataflow-server-2.10.0.jar \
    --spring.datasource.url='jdbc:mysql://localhost:3306/dataflow?permitMysqlScheme' \
    --spring.datasource.username=spring \
    --spring.datasource.password=spring \
    --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
@onobc onobc self-assigned this Dec 16, 2022
@onobc onobc added this to the 2.10.1 milestone Dec 16, 2022
@onobc
Copy link
Contributor Author

onobc commented Dec 16, 2022

I'm almost certain this is because the Flyway environment post processor we run to allow mysql-over-maria is either not running or running too late when the config server property source comes into the picture.

@onobc
Copy link
Contributor Author

onobc commented Dec 17, 2022

Confirmed the above theory.

Workaround

Add the following property to your config server configuration data:

spring.flyway.locations:
  - classpath:org/springframework/cloud/dataflow/server/db/migration/mysql

@markpollack markpollack modified the milestones: 2.10.1, Priority Backlog Jan 5, 2023
onobc added a commit to onobc/spring-cloud-dataflow-common that referenced this issue Jan 9, 2023
onobc added a commit to onobc/spring-cloud-dataflow that referenced this issue Jan 9, 2023
onobc added a commit to spring-cloud/spring-cloud-dataflow-common that referenced this issue Jan 9, 2023
onobc added a commit to onobc/spring-cloud-skipper that referenced this issue Jan 11, 2023
onobc added a commit to spring-cloud/spring-cloud-skipper that referenced this issue Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants