__ __ __
/ / / /___ _/ /___
/ /_/ / __
/ / __ \
/ __ / // / / // /
// //_,//___/
Version: 1.5.5
2022-12-20 14:28:29.180 INFO 7 --- [ main] run.halo.app.Application : Starting Application v1.5.5 using Java 11.0.11 on 6cce68e75cb4 with PID 7 (/application/BOOT-INF/classes started by root in /application)
2022-12-20 14:28:29.193 INFO 7 --- [ main] run.halo.app.Application : No active profile set, falling back to 1 default profile: "default"
2022-12-20 14:28:32.123 INFO 7 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2022-12-20 14:28:32.124 INFO 7 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-12-20 14:28:32.797 INFO 7 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 653 ms. Found 24 JPA repository interfaces.
2022-12-20 14:28:35.234 INFO 7 --- [ main] org.eclipse.jetty.util.log : Logging initialized @8372ms to org.eclipse.jetty.util.log.Slf4jLog
2022-12-20 14:28:35.740 INFO 7 --- [ main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8090
2022-12-20 14:28:35.758 INFO 7 --- [ main] org.eclipse.jetty.server.Server : jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 11.0.11+9
2022-12-20 14:28:35.863 INFO 7 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring embedded WebApplicationContext
2022-12-20 14:28:35.865 INFO 7 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6512 ms
2022-12-20 14:28:37.317 INFO 7 --- [ main] run.halo.app.config.HaloConfiguration : Halo cache store load impl : [class run.halo.app.cache.InMemoryCacheStore]
2022-12-20 14:28:39.348 INFO 7 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-12-20 14:28:39.476 INFO 7 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.33
2022-12-20 14:28:39.573 INFO 7 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-12-20 14:28:39.898 INFO 7 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-12-20 14:28:40.385 INFO 7 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2022-12-20 14:28:40.455 INFO 7 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2022-12-20 14:28:43.344 INFO 7 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-12-20 14:28:43.364 INFO 7 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-12-20 14:28:45.161 INFO 7 --- [ main] org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
2022-12-20 14:28:45.161 INFO 7 --- [ main] org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
2022-12-20 14:28:45.163 INFO 7 --- [ main] org.eclipse.jetty.server.session : node0 Scavenging every 660000ms
2022-12-20 14:28:45.172 INFO 7 --- [ main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@51a3e3b4{application,/,[file:///tmp/jetty-docbase.8090.12943939758822097083/, jar:file:/application/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE}
2022-12-20 14:28:45.173 INFO 7 --- [ main] org.eclipse.jetty.server.Server : Started @18312ms
2022-12-20 14:28:46.520 INFO 7 --- [ main] run.halo.app.handler.file.FileHandlers : Registered 9 file handler(s)
2022-12-20 14:28:53.940 INFO 7 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 4 endpoint(s) beneath base path '/api/admin/actuator'
2022-12-20 14:28:54.008 INFO 7 --- [ main] o.e.j.s.h.ContextHandler.application : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-12-20 14:28:54.008 INFO 7 --- [ main] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2022-12-20 14:28:54.010 INFO 7 --- [ main] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
2022-12-20 14:28:54.022 INFO 7 --- [ main] o.e.jetty.server.AbstractConnector : Started ServerConnector@7f2b39a{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
2022-12-20 14:28:54.023 INFO 7 --- [ main] o.s.b.web.embedded.jetty.JettyWebServer : Jetty started on port(s) 8090 (http/1.1) with context path '/'
2022-12-20 14:28:54.051 INFO 7 --- [ main] run.halo.app.Application : Started Application in 26.184 seconds (JVM running for 27.19)
2022-12-20 14:28:54.053 INFO 7 --- [ main] run.halo.app.listener.StartedListener : Starting migrate database...
2022-12-20 14:28:54.178 INFO 7 --- [ main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 7.15.0 by Redgate
2022-12-20 14:28:54.188 INFO 7 --- [ main] o.f.c.i.database.base.BaseDatabaseType : Database: jdbc:mysql://some-mysql:3306/halodb (MySQL 8.0)
2022-12-20 14:28:54.438 INFO 7 --- [ main] o.f.core.internal.command.DbRepair : Successfully repaired schema history table halodb
.flyway_schema_history
(execution time 00:00.172s).
2022-12-20 14:28:54.440 INFO 7 --- [ main] o.f.core.internal.command.DbRepair : Manual cleanup of the remaining effects of the failed migration may still be required.
2022-12-20 14:28:54.487 INFO 7 --- [ main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 7.15.0 by Redgate
2022-12-20 14:28:54.533 INFO 7 --- [ main] o.f.core.internal.command.DbValidate : Successfully validated 10 migrations (execution time 00:00.025s)
2022-12-20 14:28:54.564 INFO 7 --- [ main] o.f.core.internal.command.DbMigrate : Current version of schema halodb
: 5
2022-12-20 14:28:54.608 INFO 7 --- [ main] o.f.core.internal.command.DbMigrate : Migrating schema halodb
to version "6 - migrate create contents table"
2022-12-20 14:28:54.634 ERROR 7 --- [ main] o.f.core.internal.command.DbMigrate : Migration of schema halodb
to version "6 - migrate create contents table" failed! Please restore backups and roll back database and code!
2022-12-20 14:28:54.665 INFO 7 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-12-20 14:28:54.785 ERROR 7 --- [ main] o.s.boot.SpringApplication : Application run failed
org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V6__migrate_create_contents_table.sql failed
SQL State : 23000
Error Code : 1062
Message : Duplicate entry '1' for key 'contents.PRIMARY'
Location : migration/V6migrate_create_contents_table.sql (/application/BOOT-INF/classes/migration/V6migrate_create_contents_table.sql)
Line : 2
Statement : -- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:378) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:271) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:66) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:270) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:243) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:141) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.database.mysql.MySQLNamedLockTemplate.execute(MySQLNamedLockTemplate.java:60) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.database.mysql.MySQLConnection.lock(MySQLConnection.java:154) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:141) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:141) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:101) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.Flyway$1.execute(Flyway.java:219) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.Flyway$1.execute(Flyway.java:170) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.Flyway.execute(Flyway.java:586) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.Flyway.migrate(Flyway.java:170) ~[flyway-core-7.15.0.jar:na]
at run.halo.app.listener.StartedListener.migrate(StartedListener.java:123) ~[classes/:1.5.5]
at run.halo.app.listener.StartedListener.onApplicationEvent(StartedListener.java:76) ~[classes/:1.5.5]
at run.halo.app.listener.StartedListener.onApplicationEvent(StartedListener.java:47) ~[classes/:1.5.5]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.18.jar:5.3.18]
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:105) ~[spring-boot-2.5.12.jar:2.5.12]
at org.springframework.boot.SpringApplicationRunListeners.lambda$started$5(SpringApplicationRunListeners.java:75) ~[spring-boot-2.5.12.jar:2.5.12]
at java.base/java.util.ArrayList.forEach(Unknown Source) ~[na:na]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117) ~[spring-boot-2.5.12.jar:2.5.12]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111) ~[spring-boot-2.5.12.jar:2.5.12]
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:75) ~[spring-boot-2.5.12.jar:2.5.12]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:345) ~[spring-boot-2.5.12.jar:2.5.12]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365) ~[spring-boot-2.5.12.jar:2.5.12]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-2.5.12.jar:2.5.12]
at run.halo.app.Application.main(Application.java:21) ~[classes/:1.5.5]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[application/:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[application/:na]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[application/:na]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[application/:na]
Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: Migration V6__migrate_create_contents_table.sql failed
SQL State : 23000
Error Code : 1062
Message : Duplicate entry '1' for key 'contents.PRIMARY'
Location : migration/V6migrate_create_contents_table.sql (/application/BOOT-INF/classes/migration/V6migrate_create_contents_table.sql)
Line : 2
Statement : -- Migrate post content to contents table
INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
update_time)
SELECT id,
status,
id,
id,
format_content,
original_content,
create_time,
update_time
FROM posts
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:277) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:224) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:128) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:78) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:67) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:66) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:370) ~[flyway-core-7.15.0.jar:na]
... 40 common frames omitted
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '1' for key 'contents.PRIMARY'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117) ~[mysql-connector-java-8.0.28.jar:8.0.28]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.28.jar:8.0.28]
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:763) ~[mysql-connector-java-8.0.28.jar:8.0.28]
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:648) ~[mysql-connector-java-8.0.28.jar:8.0.28]
at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:241) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:111) ~[flyway-core-7.15.0.jar:na]
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:212) ~[flyway-core-7.15.0.jar:na]
... 46 common frames omitted
2022-12-20 14:28:54.861 INFO 7 --- [ main] o.e.jetty.server.AbstractConnector : Stopped ServerConnector@7f2b39a{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
2022-12-20 14:28:54.864 INFO 7 --- [ main] org.eclipse.jetty.server.session : node0 Stopped scavenging
2022-12-20 14:28:54.877 INFO 7 --- [ main] o.e.j.s.h.ContextHandler.application : Destroying Spring FrameworkServlet 'dispatcherServlet'
2022-12-20 14:28:54.886 INFO 7 --- [ main] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@51a3e3b4{application,/,[file:///tmp/jetty-docbase.8090.12943939758822097083/, jar:file:/application/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],STOPPED}
2022-12-20 14:28:54.956 INFO 7 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2022-12-20 14:28:54.962 INFO 7 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2022-12-20 14:28:54.991 INFO 7 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
`
以前装的老版本halo,数据库是另一个docker里的,两个docker镜像通过docker -net连接,migration发生错误,不知道是怎么回事?