Skip to content

Instantly share code, notes, and snippets.

@kimhanse
Created September 15, 2017 19:27
Show Gist options
  • Save kimhanse/ab4074d03c80510b30b549bd410bdad5 to your computer and use it in GitHub Desktop.
Save kimhanse/ab4074d03c80510b30b549bd410bdad5 to your computer and use it in GitHub Desktop.
2017-09-15 21:20:37,347 [main] INFO org.flywaydb.core.internal.util.VersionPrinter (Slf4jLog.java:44) - Flyway 4.2.0 by Boxfuse
2017-09-15 21:20:37,660 [main] INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory (Slf4jLog.java:44) - Database: jdbc:mysql://localhost/bookingedi (MySQL 5.6)
2017-09-15 21:20:37,734 [main] INFO org.flywaydb.core.internal.command.DbValidate (Slf4jLog.java:44) - Successfully validated 21 migrations (execution time 00:00.029s)
2017-09-15 21:20:37,747 [main] INFO org.flywaydb.core.internal.command.DbMigrate (Slf4jLog.java:44) - Current version of schema `bookingedi`: 005.6
2017-09-15 21:20:37,767 [main] INFO org.flywaydb.core.internal.command.DbMigrate (Slf4jLog.java:44) - Migrating schema `bookingedi` to version 005.7 - Confirmation and Status Tables
2017-09-15 21:20:37,781 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Unknown table 'bookingedi.BookingConfirmation' (SQL State: 42S02 - Error Code: 1051)
2017-09-15 21:20:37,783 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Unknown table 'bookingedi.BookingConfirmation' (SQL State: 42S02 - Error Code: 1051)
2017-09-15 21:20:37,784 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Unknown table 'bookingedi.BookingConfirmation' (SQL State: 42S02 - Error Code: 1051)
2017-09-15 21:20:37,804 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Unknown table 'bookingedi.BookingConfirmationMessage' (SQL State: 42S02 - Error Code: 1051)
2017-09-15 21:20:37,806 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Unknown table 'bookingedi.BookingConfirmationMessage' (SQL State: 42S02 - Error Code: 1051)
2017-09-15 21:20:37,807 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Unknown table 'bookingedi.BookingConfirmationMessage' (SQL State: 42S02 - Error Code: 1051)
2017-09-15 21:20:37,828 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Create table 'bookingedi/BookingConfirmationMessage' with foreign key constraint failed. There is no index in the referenced table where the referenced columns appear as the first columns.
(SQL State: HY000 - Error Code: 150)
2017-09-15 21:20:37,828 [main] WARN org.flywaydb.core.internal.dbsupport.JdbcTemplate (Slf4jLog.java:48) - DB: Cannot add foreign key constraint (SQL State: HY000 - Error Code: 1215)
2017-09-15 21:20:37,830 [main] ERROR org.flywaydb.core.internal.command.DbMigrate (Slf4jLog.java:52) - Migration of schema `bookingedi` to version 005.7 - Confirmation and Status Tables failed! Please restore backups and roll back database and code!
2017-09-15 21:20:37,839 [main] WARN org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext (AbstractApplicationContext.java:551) - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException:
Migration V005.7__Confirmation_and_Status_Tables.sql failed
-----------------------------------------------------------
SQL State : HY000
Error Code : 1215
Message : Cannot add foreign key constraint
Location : db/migration/V005.7__Confirmation_and_Status_Tables.sql (/home/kim/nyshex/booking-edi/service/target/file:/home/kim/nyshex/booking-edi/service/target/service-0-SNAPSHOT.jar!/BOOT-INF/classes!/db/migration/V005.7__Confirmation_and_Status_Tables.sql)
Line : 28
Statement : CREATE TABLE `BookingConfirmationMessage` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`bookingRequestId` decimal(19,2) DEFAULT NULL,
`carrierCode` varchar(255) NOT NULL,
`bookingConfirmationEntity_id` bigint(20) DEFAULT NULL,
`message_id` varchar(255) DEFAULT NULL,
`originalBookingConfirmationEntity_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK87y3nhjqihc1d0hnu9a7oeiab` (`bookingConfirmationEntity_id`),
KEY `FKslteefy3rdiq1213si4fpr9xh` (`message_id`),
KEY `FKs8geecphtj6pm3kyvqug7j840` (`originalBookingConfirmationEntity_id`),
CONSTRAINT `FK87y3nhjqihc1d0hnu9a7oeiab` FOREIGN KEY (`bookingConfirmationEntity_id`) REFERENCES `BookingConfirmation` (`id`),
CONSTRAINT `FKs8geecphtj6pm3kyvqug7j840` FOREIGN KEY (`originalBookingConfirmationEntity_id`) REFERENCES `BookingConfirmation` (`id`),
CONSTRAINT `FKslteefy3rdiq1213si4fpr9xh` FOREIGN KEY (`message_id`) REFERENCES `Message` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
2017-09-15 21:20:37,841 [main] INFO org.apache.catalina.core.StandardService (DirectJDKLog.java:179) - Stopping service [Tomcat]
2017-09-15 21:20:37,867 [main] INFO org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer (AutoConfigurationReportLoggingInitializer.java:101) -
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-09-15 21:20:37,874 [main] ERROR org.springframework.boot.SpringApplication (SpringApplication.java:771) - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException:
Migration V005.7__Confirmation_and_Status_Tables.sql failed
-----------------------------------------------------------
SQL State : HY000
Error Code : 1215
Message : Cannot add foreign key constraint
Location : db/migration/V005.7__Confirmation_and_Status_Tables.sql (/home/kim/nyshex/booking-edi/service/target/file:/home/kim/nyshex/booking-edi/service/target/service-0-SNAPSHOT.jar!/BOOT-INF/classes!/db/migration/V005.7__Confirmation_and_Status_Tables.sql)
Line : 28
Statement : CREATE TABLE `BookingConfirmationMessage` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`bookingRequestId` decimal(19,2) DEFAULT NULL,
`carrierCode` varchar(255) NOT NULL,
`bookingConfirmationEntity_id` bigint(20) DEFAULT NULL,
`message_id` varchar(255) DEFAULT NULL,
`originalBookingConfirmationEntity_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK87y3nhjqihc1d0hnu9a7oeiab` (`bookingConfirmationEntity_id`),
KEY `FKslteefy3rdiq1213si4fpr9xh` (`message_id`),
KEY `FKs8geecphtj6pm3kyvqug7j840` (`originalBookingConfirmationEntity_id`),
CONSTRAINT `FK87y3nhjqihc1d0hnu9a7oeiab` FOREIGN KEY (`bookingConfirmationEntity_id`) REFERENCES `BookingConfirmation` (`id`),
CONSTRAINT `FKs8geecphtj6pm3kyvqug7j840` FOREIGN KEY (`originalBookingConfirmationEntity_id`) REFERENCES `BookingConfirmation` (`id`),
CONSTRAINT `FKslteefy3rdiq1213si4fpr9xh` FOREIGN KEY (`message_id`) REFERENCES `Message` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:296)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1078)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.nyshex.bookingedi.BookingEdiApplication.main(BookingEdiApplication.java:154)
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.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateSqlException:
Migration V005.7__Confirmation_and_Status_Tables.sql failed
-----------------------------------------------------------
SQL State : HY000
Error Code : 1215
Message : Cannot add foreign key constraint
Location : db/migration/V005.7__Confirmation_and_Status_Tables.sql (/home/kim/nyshex/booking-edi/service/target/file:/home/kim/nyshex/booking-edi/service/target/service-0-SNAPSHOT.jar!/BOOT-INF/classes!/db/migration/V005.7__Confirmation_and_Status_Tables.sql)
Line : 28
Statement : CREATE TABLE `BookingConfirmationMessage` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`bookingRequestId` decimal(19,2) DEFAULT NULL,
`carrierCode` varchar(255) NOT NULL,
`bookingConfirmationEntity_id` bigint(20) DEFAULT NULL,
`message_id` varchar(255) DEFAULT NULL,
`originalBookingConfirmationEntity_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK87y3nhjqihc1d0hnu9a7oeiab` (`bookingConfirmationEntity_id`),
KEY `FKslteefy3rdiq1213si4fpr9xh` (`message_id`),
KEY `FKs8geecphtj6pm3kyvqug7j840` (`originalBookingConfirmationEntity_id`),
CONSTRAINT `FK87y3nhjqihc1d0hnu9a7oeiab` FOREIGN KEY (`bookingConfirmationEntity_id`) REFERENCES `BookingConfirmation` (`id`),
CONSTRAINT `FKs8geecphtj6pm3kyvqug7j840` FOREIGN KEY (`originalBookingConfirmationEntity_id`) REFERENCES `BookingConfirmation` (`id`),
CONSTRAINT `FKslteefy3rdiq1213si4fpr9xh` FOREIGN KEY (`message_id`) REFERENCES `Message` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:345)
at org.flywaydb.core.internal.command.DbMigrate.access$900(DbMigrate.java:53)
at org.flywaydb.core.internal.command.DbMigrate$4.call(DbMigrate.java:276)
at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:75)
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:273)
at org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:53)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:210)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:146)
at org.flywaydb.core.internal.dbsupport.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:60)
at org.flywaydb.core.internal.dbsupport.mysql.MySQLDbSupport.lock(MySQLDbSupport.java:129)
at org.flywaydb.core.internal.metadatatable.MetaDataTableImpl.lock(MetaDataTableImpl.java:174)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:146)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1010)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:971)
at org.flywaydb.core.Flyway.execute(Flyway.java:1464)
at org.flywaydb.core.Flyway.migrate(Flyway.java:971)
at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
... 26 common frames omitted
Caused by: java.sql.SQLException: Cannot add foreign key constraint
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2444)
at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:745)
at org.flywaydb.core.internal.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:267)
at org.flywaydb.core.internal.dbsupport.SqlScript.execute(SqlScript.java:142)
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:76)
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:343)
... 44 common frames omitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment