You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "DouShaoxun (via GitHub)" <gi...@apache.org> on 2023/09/11 03:39:58 UTC
[GitHub] [shardingsphere] DouShaoxun opened a new issue, #28405: ShardingSphereDataSource+liquibase fail
DouShaoxun opened a new issue, #28405:
URL: https://github.com/apache/shardingsphere/issues/28405
## Bug Report
**For English only**, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will **close it**.
Please answer these questions before submitting your issue. Thanks!
### Which version of ShardingSphere did you use?
```shell
implementation "org.apache.shardingsphere:shardingsphere-jdbc-core-spring-boot-starter:5.2.0"
```
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
### Expected behavior
Use liquibase to maintain the database
### Actual behavior
Startup failure
### Reason analyze (If you can)
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
```log
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.15)
2023-09-11 11:29:43.451 INFO [main] c.c.d.s.Application.logStarting [55] - Starting Application using Java 17 on yoga with PID 13884 (C:\Users\dousx\Code\Java\shardingsphere-jdbc-liquibase-case\build\classes\java\main started by dousx in C:\Users\dousx\Code\Java\shardingsphere-jdbc-liquibase-case)
2023-09-11 11:29:43.453 DEBUG [main] c.c.d.s.Application.logStarting [56] - Running with Spring Boot v2.7.15, Spring v5.3.29
2023-09-11 11:29:43.454 INFO [main] c.c.d.s.Application.logStartupProfileInfo [637] - The following 2 profiles are active: "shardingsphere-jdbc", "liquibase"
2023-09-11 11:29:44.010 ERROR [main] c.c.d.s.a.HisDataMonthShardingAlgorithm.init [31] - parse auto-create table lower date failed: Cannot invoke "String.length()" because "text" is null, use default date 2017_01
2023-09-11 11:29:44.098 INFO [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization [376] - Bean 'stringToNoneShardingStrategyConfigurationConverter' of type [org.apache.shardingsphere.spring.boot.converter.StringToNoneShardingStrategyConfigurationConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-09-11 11:29:44.107 INFO [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization [376] - Bean 'spring.shardingsphere-org.apache.shardingsphere.spring.boot.prop.SpringBootPropertiesConfiguration' of type [org.apache.shardingsphere.spring.boot.prop.SpringBootPropertiesConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-09-11 11:29:44.495 INFO [main] o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization [376] - Bean 'org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration' of type [org.apache.shardingsphere.spring.boot.ShardingSphereAutoConfiguration$$EnhancerBySpringCGLIB$$fd35cafc] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-09-11 11:29:44.562 ERROR [main] c.c.d.s.a.HisDataMonthShardingAlgorithm.init [31] - parse auto-create table lower date failed: Cannot invoke "String.length()" because "text" is null, use default date 2017_01
2023-09-11 11:29:44.590 INFO [main] c.z.h.HikariDataSource.getConnection [110] - HikariPool-1 - Starting...
2023-09-11 11:29:44.752 INFO [main] c.z.h.HikariDataSource.getConnection [123] - HikariPool-1 - Start completed.
2023-09-11 11:29:44.882 INFO [main] c.z.h.HikariDataSource.getConnection [110] - HikariPool-2 - Starting...
2023-09-11 11:29:45.089 INFO [main] c.z.h.HikariDataSource.getConnection [123] - HikariPool-2 - Start completed.
2023-09-11 11:29:45.133 ERROR [main] c.c.d.s.a.HisDataMonthShardingAlgorithm.init [31] - parse auto-create table lower date failed: Cannot invoke "String.length()" because "text" is null, use default date 2017_01
2023-09-11 11:29:45.274 INFO [main] c.c.d.s.c.LiquibaseConfig.liquibase [40] - liquibase dataSource class org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource
2023-09-11 11:29:45.529 INFO [main] l.changelog.log [37] - Reading resource: db/liquibase/changelog/2023/09/11-1725-78f6ee87.xml
2023-09-11 11:29:45.739 INFO [main] l.changelog.log [37] - Creating database history table with name: DATABASECHANGELOG
2023-09-11 11:29:46.383 INFO [main] l.command.log [37] - Command execution complete
2023-09-11 11:29:46.390 WARN [main] o.s.c.a.AnnotationConfigApplicationContext.refresh [591] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/cruder/dousx/sjlc/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: null [Failed SQL: CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, `DESCRIPTION` VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL, CONTEXTS VARCHAR(255) NULL, LABELS VARCHAR(255) NULL, DEPLOYMENT_ID VARCHAR(10) NULL)]
2023-09-11 11:29:46.390 INFO [main] c.z.h.HikariDataSource.close [350] - HikariPool-2 - Shutdown initiated...
2023-09-11 11:29:46.394 INFO [main] c.z.h.HikariDataSource.close [352] - HikariPool-2 - Shutdown completed.
2023-09-11 11:29:46.394 INFO [main] c.z.h.HikariDataSource.close [350] - HikariPool-1 - Shutdown initiated...
2023-09-11 11:29:46.395 INFO [main] c.z.h.HikariDataSource.close [352] - HikariPool-1 - Shutdown completed.
2023-09-11 11:29:46.400 INFO [main] o.s.b.a.l.ConditionEvaluationReportLoggingListener.logMessage [136] -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-09-11 11:29:46.415 ERROR [main] o.s.b.SpringApplication.reportFailure [821] - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [cn/cruder/dousx/sjlc/config/LiquibaseConfig.class]: Invocation of init method failed; nested exception is liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: null [Failed SQL: CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, `DESCRIPTION` VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL, CONTEXTS VARCHAR(255) NULL, LABELS VARCHAR(255) NULL, DEPLOYMENT_ID VARCHAR(10) NULL)]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:921)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
at cn.cruder.dousx.sjlc.Application.main(Application.java:10)
Caused by: liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: null [Failed SQL: CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, `DESCRIPTION` VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL, CONTEXTS VARCHAR(255) NULL, LABELS VARCHAR(255) NULL, DEPLOYMENT_ID VARCHAR(10) NULL)]
at liquibase.command.CommandScope.execute(CommandScope.java:236)
at liquibase.Liquibase.lambda$update$0(Liquibase.java:223)
at liquibase.Scope.lambda$child$0(Scope.java:197)
at liquibase.Scope.child(Scope.java:206)
at liquibase.Scope.child(Scope.java:196)
at liquibase.Scope.child(Scope.java:175)
at liquibase.Liquibase.runInScope(Liquibase.java:1361)
at liquibase.Liquibase.update(Liquibase.java:215)
at liquibase.Liquibase.update(Liquibase.java:197)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:329)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 15 common frames omitted
Caused by: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: null [Failed SQL: CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, `DESCRIPTION` VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL, CONTEXTS VARCHAR(255) NULL, LABELS VARCHAR(255) NULL, DEPLOYMENT_ID VARCHAR(10) NULL)]
at liquibase.executor.jvm.ChangelogJdbcMdcListener.execute(ChangelogJdbcMdcListener.java:39)
at liquibase.changelog.StandardChangeLogHistoryService.init(StandardChangeLogHistoryService.java:277)
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.checkLiquibaseTables(DatabaseChangelogCommandStep.java:127)
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.run(DatabaseChangelogCommandStep.java:94)
at liquibase.command.CommandScope.execute(CommandScope.java:213)
... 27 common frames omitted
Caused by: liquibase.exception.DatabaseException: null [Failed SQL: CREATE TABLE DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED datetime NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35) NULL, `DESCRIPTION` VARCHAR(255) NULL, COMMENTS VARCHAR(255) NULL, TAG VARCHAR(255) NULL, LIQUIBASE VARCHAR(20) NULL, CONTEXTS VARCHAR(255) NULL, LABELS VARCHAR(255) NULL, DEPLOYMENT_ID VARCHAR(10) NULL)]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:467)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:77)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:180)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:145)
at liquibase.changelog.StandardChangeLogHistoryService.lambda$init$2(StandardChangeLogHistoryService.java:277)
at liquibase.executor.jvm.ChangelogJdbcMdcListener.lambda$execute$0(ChangelogJdbcMdcListener.java:33)
at liquibase.Scope.lambda$child$0(Scope.java:197)
at liquibase.Scope.child(Scope.java:206)
at liquibase.Scope.child(Scope.java:196)
at liquibase.Scope.child(Scope.java:175)
at liquibase.executor.jvm.ChangelogJdbcMdcListener.execute(ChangelogJdbcMdcListener.java:32)
... 31 common frames omitted
Caused by: org.apache.shardingsphere.dialect.exception.syntax.table.TableExistsException: null
at org.apache.shardingsphere.sharding.route.engine.validator.ddl.ShardingDDLStatementValidator.validateTableNotExist(ShardingDDLStatementValidator.java:79)
at org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateTableStatementValidator.preValidate(ShardingCreateTableStatementValidator.java:47)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.lambda$createRouteContext$0(ShardingSQLRouter.java:55)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:55)
at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:46)
at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:58)
at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:55)
at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:59)
at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:51)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.createExecutionContext(ShardingSphereStatement.java:508)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.execute0(ShardingSphereStatement.java:454)
at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement.execute(ShardingSphereStatement.java:379)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:461)
... 41 common frames omitted
```
### Example codes for reproduce this issue (such as a github link).
[github Example](https://github.com/DouShaoxun/shardingsphere-jdbc-liquibase-case)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #28405: ShardingSphereDataSource+liquibase fail
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #28405:
URL: https://github.com/apache/shardingsphere/issues/28405#issuecomment-1714878059
Hi @DouShaoxun
Liquibase is not in ShardingSphere's support list, maybe you can investigate how to integrate it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] DouShaoxun commented on issue #28405: ShardingSphereDataSource+liquibase fail
Posted by "DouShaoxun (via GitHub)" <gi...@apache.org>.
DouShaoxun commented on issue #28405:
URL: https://github.com/apache/shardingsphere/issues/28405#issuecomment-1720424615
> Hi @DouShaoxun Liquibase is not in ShardingSphere's support list, maybe you can investigate how to integrate it?
It seems that I can only create a HikariDataSource for Liquibase to use. I hope that in the future, ShardingSphereDataSource will support Liquibase.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] DouShaoxun closed issue #28405: ShardingSphereDataSource+liquibase fail
Posted by "DouShaoxun (via GitHub)" <gi...@apache.org>.
DouShaoxun closed issue #28405: ShardingSphereDataSource+liquibase fail
URL: https://github.com/apache/shardingsphere/issues/28405
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org