Skip to content

[Bug] [DAO] The wrong separator is used in the file path of 'sql/upgrade/2.0.1-schema' #7195

@calvinjiang

Description

@calvinjiang

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When I initialized the database through the class of UpgradeDolphinScheduler, I encountered an error. The details is as follows:

java.lang.IllegalStateException: Failed to execute CommandLineRunner

at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:794) ~[spring-boot-2.5.6.jar:2.5.6]

at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:775) ~[spring-boot-2.5.6.jar:2.5.6]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) ~[spring-boot-2.5.6.jar:2.5.6]

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:143) [spring-boot-2.5.6.jar:2.5.6]

at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler.main(CreateDolphinScheduler.java:40) [dolphinscheduler-dao-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

Caused by: java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "1-schema"

at org.apache.dolphinscheduler.dao.upgrade.SchemaUtils.lambda$getAllSchemaList$0(SchemaUtils.java:71) ~[dolphinscheduler-dao-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

at java.util.TimSort.binarySort(TimSort.java:296) ~[na:1.8.0_312]

at java.util.TimSort.sort(TimSort.java:221) ~[na:1.8.0_312]

at java.util.Arrays.sort(Arrays.java:1512) ~[na:1.8.0_312]

at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353) ~[na:1.8.0_312]

at java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[na:1.8.0_312]

at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) ~[na:1.8.0_312]

at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[na:1.8.0_312]

at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[na:1.8.0_312]

at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_312]

at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[na:1.8.0_312]

at org.apache.dolphinscheduler.dao.upgrade.SchemaUtils.getAllSchemaList(SchemaUtils.java:73) ~[dolphinscheduler-dao-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

at org.apache.dolphinscheduler.dao.upgrade.DolphinSchedulerManager.upgradeDolphinScheduler(DolphinSchedulerManager.java:75) ~[dolphinscheduler-dao-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

at org.apache.dolphinscheduler.dao.upgrade.shell.CreateDolphinScheduler$CreateRunner.run(CreateDolphinScheduler.java:58) ~[dolphinscheduler-dao-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:791) ~[spring-boot-2.5.6.jar:2.5.6]

... 4 common frames omitted

Caused by: java.lang.NumberFormatException: For input string: "1-schema"

at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_312]

at java.lang.Integer.parseInt(Integer.java:580) ~[na:1.8.0_312]

at java.lang.Integer.parseInt(Integer.java:615) ~[na:1.8.0_312]

at org.apache.dolphinscheduler.dao.upgrade.SchemaUtils.isAGreatVersion(SchemaUtils.java:92) ~[dolphinscheduler-dao-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

at org.apache.dolphinscheduler.dao.upgrade.SchemaUtils.lambda$getAllSchemaList$0(SchemaUtils.java:64) ~[dolphinscheduler-dao-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]

... 18 common frames omitted

What you expected to happen

I expect that the process of initializing database can be executed exactly and correctly.

How to reproduce

I've found this root cause that the wrong separator is used in the file path of 'sql/upgrade/2.0.1-schema'.

image

Anything else

No response

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for replyWaiting for replybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions