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

version:3.5.5-p1,Exception occurs while Liquibase update mysql DB #830

Open
lingsoul opened this issue Sep 14, 2021 · 1 comment
Open

Comments

@lingsoul
Copy link

Exception occurs while Liquibase update DB.

INFO 21-9-14 上午10:00: liquibase: Successfully acquired change log lock
INFO 21-9-14 上午10:00: liquibase: Reading from ngrinder.DATABASECHANGELOG
SEVERE 21-9-14 上午10:00: liquibase: ngrinder_datachange_logfile/db.changelog.xml: ngrinder_datachange_logfile/db.changelog_schema_31.xml::31-1::ngrinder.3.5.3: Change Set ngrinder_datachange_logfile/db.changelog_schema_31.xml::31-1::ngrinder.3.5.3 failed. Error: 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 'index created_user_index to created_by_index;
alter table PERF_TEST rename in' at line 1 [Failed SQL: alter table PERF_TEST rename index created_user_index to created_by_index;
alter table PERF_TEST rename index last_modified_user_index to last_modified_by_index;
alter table NUSER rename index created_user_index to created_by_index;
alter table NUSER rename index last_modified_user_index to last_modified_by_index;
alter table TAG rename index created_user_index to created_by_index;
alter table TAG rename index last_modified_user_index to last_modified_by_index;]
INFO 21-9-14 上午10:00: liquibase: ngrinder_datachange_logfile/db.changelog_schema_31.xml::31-1::ngrinder.3.5.3: Successfully released change log lock
2021-09-14 10:00:59,756 WARN AbstractApplicationContext.java:559 : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseUpdater': Invocation of init method failed; nested exception is org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB
2021-09-14 10:00:59,760 INFO DirectJDKLog.java:173 : Stopping service [Tomcat]
2021-09-14 10:00:59,771 INFO ConditionEvaluationReportLoggingListener.java:136 :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-09-14 10:00:59,783 ERROR SpringApplication.java:837 : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseUpdater': Invocation of init method failed; nested exception is org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:311)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.ngrinder.starter.NGrinderControllerStarter.main(NGrinderControllerStarter.java:243)
Caused by: org.ngrinder.common.exception.NGrinderRuntimeException: Exception occurs while Liquibase update DB
at org.ngrinder.common.util.ExceptionUtils.processException(ExceptionUtils.java:53)
at org.ngrinder.infra.init.DatabaseUpdater.init(DatabaseUpdater.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
... 21 common frames omitted
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set ngrinder_datachange_logfile/db.changelog_schema_31.xml::31-1::ngrinder.3.5.3:
Reason: liquibase.exception.DatabaseException: 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 'index created_user_index to created_by_index;
alter table PERF_TEST rename in' at line 1 [Failed SQL: alter table PERF_TEST rename index created_user_index to created_by_index;
alter table PERF_TEST rename index last_modified_user_index to last_modified_by_index;
alter table NUSER rename index created_user_index to created_by_index;
alter table NUSER rename index last_modified_user_index to last_modified_by_index;
alter table TAG rename index created_user_index to created_by_index;
alter table TAG rename index last_modified_user_index to last_modified_by_index;]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
at liquibase.Liquibase.update(Liquibase.java:214)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:188)
at liquibase.Liquibase.update(Liquibase.java:181)
at org.ngrinder.infra.init.DatabaseUpdater.init(DatabaseUpdater.java:87)
... 1 common frames omitted
Caused by: liquibase.exception.DatabaseException: 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 'index created_user_index to created_by_index;
alter table PERF_TEST rename in' at line 1 [Failed SQL: alter table PERF_TEST rename index created_user_index to created_by_index;
alter table PERF_TEST rename index last_modified_user_index to last_modified_by_index;
alter table NUSER rename index created_user_index to created_by_index;
alter table NUSER rename index last_modified_user_index to last_modified_by_index;
alter table TAG rename index created_user_index to created_by_index;
alter table TAG rename index last_modified_user_index to last_modified_by_index;]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
... 8 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: 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 'index created_user_index to created_by_index;
alter table PERF_TEST rename in' at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:782)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:666)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
... 13 common frames omitted

@donggyu04
Copy link
Contributor

@lingsoul

Check if SQL in ngrinder_datachange_logfile/db.changelog_schema_31.xml::31-1::ngrinder.3.5.3 works well on your MySQL server.

Caused by: java.sql.SQLSyntaxErrorException: 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 'index created_user_index to created_by_index;
alter table PERF_TEST rename in' at line 1

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

No branches or pull requests

2 participants