現在JavaでSpringフレームワークを用いたWebアプリケーションを作成し、herokuにデプロイしたところエラーが発生しております。
前提・実現したいこと
Java 11
Mysql 5.7
発生している問題・エラーメッセージ
herokuにローカルのmasterをデプロイしたのちに、開発ブランチをpushした所以下の様なエラーが発生しました。
2020-06-25T10:45:50.212953+00:00 app[web.1]: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2020-06-25T10:45:50.219629+00:00 app[web.1]: 2020-06-25 10:45:50.219 ERROR 4 --- [ main] o.s.boot.SpringApplication : Application run failed 2020-06-25T10:45:50.219631+00:00 app[web.1]: 2020-06-25T10:45:50.219670+00:00 app[web.1]: 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.api.FlywayException: Validate failed: 2020-06-25T10:45:50.219897+00:00 app[web.1]: Migration checksum mismatch for migration version 3 2020-06-25T10:45:50.219899+00:00 app[web.1]: -> Applied to database : 134832656 2020-06-25T10:45:50.219900+00:00 app[web.1]: -> Resolved locally : -727294819 2020-06-25T10:45:50.219900+00:00 app[web.1]: 2020-06-25T10:45:50.219914+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219915+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219915+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219916+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219917+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219918+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219918+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219919+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219919+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219920+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219920+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219921+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219921+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219922+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219923+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219923+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219924+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219925+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219925+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219926+00:00 app[web.1]: at com.example.demo.OriginalApplication.main(OriginalApplication.java:10) ~[classes!/:0.0.1-SNAPSHOT] 2020-06-25T10:45:50.219927+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] 2020-06-25T10:45:50.219927+00:00 app[web.1]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na] 2020-06-25T10:45:50.219928+00:00 app[web.1]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] 2020-06-25T10:45:50.219936+00:00 app[web.1]: at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] 2020-06-25T10:45:50.219937+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[OriginalApplication-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] 2020-06-25T10:45:50.219937+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) ~[OriginalApplication-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] 2020-06-25T10:45:50.219938+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[OriginalApplication-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] 2020-06-25T10:45:50.219938+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[OriginalApplication-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] 2020-06-25T10:45:50.219939+00:00 app[web.1]: Caused by: org.flywaydb.core.api.FlywayException: Validate failed: 2020-06-25T10:45:50.219939+00:00 app[web.1]: Migration checksum mismatch for migration version 3 2020-06-25T10:45:50.219940+00:00 app[web.1]: -> Applied to database : 134832656 2020-06-25T10:45:50.219940+00:00 app[web.1]: -> Resolved locally : -727294819 2020-06-25T10:45:50.219941+00:00 app[web.1]: 2020-06-25T10:45:50.219941+00:00 app[web.1]: at org.flywaydb.core.Flyway.doValidate(Flyway.java:285) ~[flyway-core-6.4.4.jar!/:na] 2020-06-25T10:45:50.219942+00:00 app[web.1]: at org.flywaydb.core.Flyway.access$100(Flyway.java:74) ~[flyway-core-6.4.4.jar!/:na] 2020-06-25T10:45:50.219942+00:00 app[web.1]: at org.flywaydb.core.Flyway$1.execute(Flyway.java:167) ~[flyway-core-6.4.4.jar!/:na] 2020-06-25T10:45:50.219943+00:00 app[web.1]: at org.flywaydb.core.Flyway$1.execute(Flyway.java:159) ~[flyway-core-6.4.4.jar!/:na] 2020-06-25T10:45:50.219943+00:00 app[web.1]: at org.flywaydb.core.Flyway.execute(Flyway.java:530) ~[flyway-core-6.4.4.jar!/:na] 2020-06-25T10:45:50.219944+00:00 app[web.1]: at org.flywaydb.core.Flyway.migrate(Flyway.java:159) ~[flyway-core-6.4.4.jar!/:na] 2020-06-25T10:45:50.219945+00:00 app[web.1]: at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:65) ~[spring-boot-autoconfigure-2.3.1.RELEASE.jar!/:2.3.1.RELEASE] 2020-06-25T10:45:50.219946+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219947+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.7.RELEASE.jar!/:5.2.7.RELEASE] 2020-06-25T10:45:50.219947+00:00 app[web.1]: ... 27 common frames omitted 2020-06-25T10:45:50.219948+00:00 app[web.1]: 2020-06-25T10:45:50.317500+00:00 heroku[web.1]: Process exited with status 1 2020-06-25T10:45:50.360392+00:00 heroku[web.1]: State changed from starting to crashed 2020-06-25T10:45:52.376356+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gentle-shore-80591.herokuapp.com request_id=c59e150a-9885-48de-a78b-c9e9578ffe6b fwd="117.18.181.10" dyno= connect= service= status=503 bytes= protocol=https 2020-06-25T10:46:02.445989+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/login" host=gentle-shore-80591.herokuapp.com request_id=ed2a68b2-8266-48b8-a082-46ccf6cc04b0 fwd="117.18.181.10" dyno= connect= service= status=503 bytes= protocol=https
試したこと
masterで開発していたマイグレーションファイルから、作業ブランチにて同じバージョンのマイグレーションファイルを修正してしまい、その差異が解消出来ないと言う意味のエラーだと解釈しています。
・ローカルのマイグレーションファイル、テーブルを全て削除して再度push(変化なし)
この他に、今回のケースを解消する方法が思い浮かばず質問させて頂きました。
何卒よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー