[halo-dev/halo]使用docker+mysql重新启动报错

2024-02-20 715 views
4
是什么版本出现了此问题?

2.10

使用的什么数据库?

MySQL 8.x

使用的哪种方式运行?

Docker

发生了什么?

第一次启动成功后执行 docker stop halo docker rm halo 删除容器 再次执行 docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.10 就会报错

相关日志输出
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-10-14T19:28:46.536+08:00 ERROR 7 --- [           main] o.s.boot.SpringApplication               : Application run failed

run.halo.app.infra.exception.DuplicateNameException: 400 BAD_REQUEST "Duplicate name detected."
        at run.halo.app.extension.store.ReactiveExtensionStoreClientImpl.lambda$create$0(ReactiveExtensionStoreClientImpl.java:33) ~[classes/:2.10.0]
        at reactor.core.publisher.Mono.lambda$onErrorMap$27(Mono.java:3769) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.lambda$onErrorResume$29(Mono.java:3859) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoUsingWhen$MonoUsingWhenSubscriber.deferredError(MonoUsingWhen.java:277) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxUsingWhen$RollbackInner.onComplete(FluxUsingWhen.java:475) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onError(FluxUsingWhen.java:364) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:180) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoTakeLastOne$TakeLastOneSubscriber.onError(MonoTakeLastOne.java:134) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.deferredError(FluxUsingWhen.java:398) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxUsingWhen$RollbackInner.onComplete(FluxUsingWhen.java:475) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2205) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2205) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.pool.SimpleDequePool.maybeRecycleAndDrain(SimpleDequePool.java:537) ~[reactor-pool-1.0.2.jar:1.0.2]
        at reactor.pool.SimpleDequePool$QueuePoolRecyclerInner.onComplete(SimpleDequePool.java:767) ~[reactor-pool-1.0.2.jar:1.0.2]
        at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.pool.SimpleDequePool$QueuePoolRecyclerMono.subscribe(SimpleDequePool.java:879) ~[reactor-pool-1.0.2.jar:1.0.2]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onComplete(MonoIgnoreElements.java:89) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onComplete(FluxHandleFuseable.java:239) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoSupplier$MonoSupplierSubscription.request(MonoSupplier.java:148) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.request(FluxHandleFuseable.java:260) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onSubscribe(MonoIgnoreElements.java:72) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onSubscribe(FluxHandleFuseable.java:164) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:48) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onError(MonoIgnoreElements.java:84) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxFilter$FilterSubscriber.onError(FluxFilter.java:157) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onError(FluxFilter.java:291) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onError(FluxUsingWhen.java:364) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:843) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:609) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:589) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxFlatMap$FlatMapMain.innerError(FluxFlatMap.java:864) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxFlatMap$FlatMapInner.onError(FluxFlatMap.java:991) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:201) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableConditionalSubscriber.onNext(FluxHandleFuseable.java:505) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.5.10.jar:3.5.10]
        at io.asyncer.r2dbc.mysql.internal.util.DiscardOnCancelSubscriber.onNext(DiscardOnCancelSubscriber.java:66) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drainRegular(FluxWindowPredicate.java:670) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drain(FluxWindowPredicate.java:748) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxWindowPredicate$WindowFlux.onNext(FluxWindowPredicate.java:790) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.onNext(FluxWindowPredicate.java:268) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.5.10.jar:3.5.10]
        at io.asyncer.r2dbc.mysql.internal.util.DiscardOnCancelSubscriber.onNext(DiscardOnCancelSubscriber.java:66) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxHandle$HandleConditionalSubscriber.onNext(FluxHandle.java:343) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.SinkManyEmitterProcessor.drain(SinkManyEmitterProcessor.java:471) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.SinkManyEmitterProcessor.tryEmitNext(SinkManyEmitterProcessor.java:269) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27) ~[reactor-core-3.5.10.jar:3.5.10]
        at io.asyncer.r2dbc.mysql.client.ReactorNettyClient$ResponseSink.next(ReactorNettyClient.java:383) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at io.asyncer.r2dbc.mysql.client.ReactorNettyClient.lambda$new$0(ReactorNettyClient.java:121) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:185) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:292) ~[reactor-netty-core-1.1.11.jar:1.1.11]
        at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:401) ~[reactor-netty-core-1.1.11.jar:1.1.11]
        at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:411) ~[reactor-netty-core-1.1.11.jar:1.1.11]
        at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114) ~[reactor-netty-core-1.1.11.jar:1.1.11]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.asyncer.r2dbc.mysql.client.MessageDuplexCodec.handleDecoded(MessageDuplexCodec.java:162) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at io.asyncer.r2dbc.mysql.client.MessageDuplexCodec.channelRead(MessageDuplexCodec.java:73) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1466) ~[netty-handler-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1329) ~[netty-handler-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1378) ~[netty-handler-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
        Suppressed: java.lang.Exception: #block terminated with an error
                at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:103) ~[reactor-core-3.5.10.jar:3.5.10]
                at reactor.core.publisher.Mono.block(Mono.java:1712) ~[reactor-core-3.5.10.jar:3.5.10]
                at run.halo.app.infra.DefaultThemeInitializer.onApplicationEvent(DefaultThemeInitializer.java:54) ~[classes/:2.10.0]
                at run.halo.app.infra.DefaultThemeInitializer.onApplicationEvent(DefaultThemeInitializer.java:17) ~[classes/:2.10.0]
                at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:437) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370) ~[spring-context-6.0.12.jar:6.0.12]
                at run.halo.app.infra.SchemeInitializer.onApplicationEvent(SchemeInitializer.java:112) ~[classes/:2.10.0]
                at run.halo.app.infra.SchemeInitializer.onApplicationEvent(SchemeInitializer.java:47) ~[classes/:2.10.0]
                at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:437) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370) ~[spring-context-6.0.12.jar:6.0.12]
                at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:103) ~[spring-boot-3.1.4.jar:3.1.4]
                at org.springframework.boot.SpringApplicationRunListeners.lambda$started$5(SpringApplicationRunListeners.java:76) ~[spring-boot-3.1.4.jar:3.1.4]
                at java.base/java.lang.Iterable.forEach(Unknown Source) ~[na:na]
                at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118) ~[spring-boot-3.1.4.jar:3.1.4]
                at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112) ~[spring-boot-3.1.4.jar:3.1.4]
                at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:76) ~[spring-boot-3.1.4.jar:3.1.4]
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) ~[spring-boot-3.1.4.jar:3.1.4]
                at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:150) ~[spring-boot-3.1.4.jar:3.1.4]
                at run.halo.app.Application.main(Application.java:28) ~[classes/:2.10.0]
                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:95) ~[application/:na]
                at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[application/:na]
                at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) ~[application/:na]
Caused by: org.springframework.dao.DuplicateKeyException: executeMany; SQL [INSERT INTO extensions (name, data, version) VALUES (?, ?, ?)]; Duplicate entry '/registry/theme.halo.run/themes/theme-earth' for key 'extensions.PRIMARY'
        at org.springframework.r2dbc.connection.ConnectionFactoryUtils.convertR2dbcException(ConnectionFactoryUtils.java:234) ~[spring-r2dbc-6.0.12.jar:6.0.12]
        at org.springframework.r2dbc.core.DefaultDatabaseClient.lambda$inConnectionMany$8(DefaultDatabaseClient.java:152) ~[spring-r2dbc-6.0.12.jar:6.0.12]
        at reactor.core.publisher.Flux.lambda$onErrorMap$28(Flux.java:7236) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Flux.lambda$onErrorResume$29(Flux.java:7289) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.5.10.jar:3.5.10]
        ... 115 common frames omitted
Caused by: io.r2dbc.spi.R2dbcDataIntegrityViolationException: Duplicate entry '/registry/theme.halo.run/themes/theme-earth' for key 'extensions.PRIMARY'
        at io.asyncer.r2dbc.mysql.message.server.ErrorMessage.toException(ErrorMessage.java:121) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at io.asyncer.r2dbc.mysql.message.server.ErrorMessage.toException(ErrorMessage.java:73) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at io.asyncer.r2dbc.mysql.MySqlResult$MySqlMessage.exception(MySqlResult.java:178) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at io.asyncer.r2dbc.mysql.MySqlResult.lambda$map$1(MySqlResult.java:92) ~[r2dbc-mysql-1.0.3.jar:1.0.3]
        at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:179) ~[reactor-core-3.5.10.jar:3.5.10]
        ... 58 common frames omitted

2023-10-14T19:28:46.577+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Disposing controller run.halo.app.metrics.VisitedEventReconciler
2023-10-14T19:28:46.579+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.metrics.VisitedEventReconciler-worker-1 interrupted
2023-10-14T19:28:46.579+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.metrics.VisitedEventReconciler-worker-1 is stopped
2023-10-14T19:28:46.580+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Controller run.halo.app.metrics.VisitedEventReconciler is disposed
2023-10-14T19:28:46.581+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Disposing controller run.halo.app.metrics.ReplyEventReconciler
2023-10-14T19:28:46.582+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.metrics.ReplyEventReconciler-worker-1 interrupted
2023-10-14T19:28:46.582+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.metrics.ReplyEventReconciler-worker-1 is stopped
2023-10-14T19:28:46.584+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Controller run.halo.app.metrics.ReplyEventReconciler is disposed
2023-10-14T19:28:46.584+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Disposing controller run.halo.app.search.post.PostEventReconciler
2023-10-14T19:28:46.585+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.search.post.PostEventReconciler-worker-1 interrupted
2023-10-14T19:28:46.586+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.search.post.PostEventReconciler-worker-1 is stopped
2023-10-14T19:28:46.587+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Controller run.halo.app.search.post.PostEventReconciler is disposed
2023-10-14T19:28:46.587+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Disposing controller run.halo.app.plugin.PluginCreatedEventReconciler
2023-10-14T19:28:46.588+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.plugin.PluginCreatedEventReconciler-worker-1 interrupted
2023-10-14T19:28:46.588+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.plugin.PluginCreatedEventReconciler-worker-1 is stopped
2023-10-14T19:28:46.589+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Controller run.halo.app.plugin.PluginCreatedEventReconciler is disposed
2023-10-14T19:28:46.590+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Disposing controller run.halo.app.metrics.VotedEventReconciler
2023-10-14T19:28:46.591+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.metrics.VotedEventReconciler-worker-1 interrupted
2023-10-14T19:28:46.592+08:00  INFO 7 --- [tReconciler-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.metrics.VotedEventReconciler-worker-1 is stopped
2023-10-14T19:28:46.592+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Controller run.halo.app.metrics.VotedEventReconciler is disposed
2023-10-14T19:28:46.592+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Disposing controller run.halo.app.notification.DefaultNotificationSender
2023-10-14T19:28:46.593+08:00  INFO 7 --- [ationSender-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-1 interrupted
2023-10-14T19:28:46.593+08:00  INFO 7 --- [ationSender-t-5] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-5 interrupted
2023-10-14T19:28:46.594+08:00  INFO 7 --- [ationSender-t-5] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-5 is stopped
2023-10-14T19:28:46.593+08:00  INFO 7 --- [ationSender-t-3] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-3 interrupted
2023-10-14T19:28:46.596+08:00  INFO 7 --- [ationSender-t-3] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-3 is stopped
2023-10-14T19:28:46.593+08:00  INFO 7 --- [ationSender-t-4] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-4 interrupted
2023-10-14T19:28:46.597+08:00  INFO 7 --- [ationSender-t-4] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-4 is stopped
2023-10-14T19:28:46.593+08:00  INFO 7 --- [ationSender-t-2] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-2 interrupted
2023-10-14T19:28:46.598+08:00  INFO 7 --- [ationSender-t-2] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-2 is stopped
2023-10-14T19:28:46.595+08:00  INFO 7 --- [ationSender-t-1] r.h.a.e.controller.DefaultController     : Controller worker run.halo.app.notification.DefaultNotificationSender-worker-1 is stopped
2023-10-14T19:28:46.599+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Controller run.halo.app.notification.DefaultNotificationSender is disposed
2023-10-14T19:28:46.606+08:00  INFO 7 --- [           main] r.h.a.e.c.DefaultControllerManager       : Shutting down 0 controllers...
2023-10-14T19:28:46.607+08:00  INFO 7 --- [           main] r.h.a.e.c.DefaultControllerManager       : Shutdown 0 controllers.
2023-10-14T19:28:46.608+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Disposing controller garbage-collector-controller
2023-10-14T19:28:46.608+08:00  INFO 7 --- [           main] r.h.a.e.controller.DefaultController     : Controller garbage-collector-controller is disposed

回答

1

通过以上步骤无法复现。如果目录 ~/.halo2 不是很重要的话,建议删除后重试。

8

我使用的是mysql数据库,报错中有一段Caused by: org.springframework.dao.DuplicateKeyException: executeMany; SQL [INSERT INTO extensions (name, data, version) VALUES (?, ?, ?)]; Duplicate entry '/registry/theme.halo.run/themes/theme-earth' for key 'extensions.PRIMARY'的重复key错误

3

通过 Issue 的描述中确实没有看到关于 MySQL 的描述。不知道是否是通过配置文件 ~/.halo2/application.yaml 的方式配置的。

如果数据不是很重要的话,建议重建表后再重启 Halo。

如果还是无法解决,建议提供一个能够稳定复现的步骤,任何一个环节都不要少。

7

启动参数:docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/halo-blog halohub/halo:2.10 --spring.sql.init.platform=mysql --spring.r2dbc.url=r2dbc:pool:mysql://localhost:3306/halodb?serverZoneId=Asia/Shanghai --spring.r2dbc.username=root --spring.r2dbc.password=123456789

5

从这个命令来看,有几个问题:

  1. ~/.halo2:/root/halo-blog,不要修改 : 之后的路径,这是容器内路径,是固定的,这样等于没有设置。
  2. 你添加的 MySQL 的 host 在 Halo 的容器中并不存在,你可能需要设置 network_modehost,参考:https://docs.halo.run/getting-started/install/docker-compose/#:~:text=%E4%BB%85%E5%88%9B%E5%BB%BA%20Halo%20%E5%AE%9E%E4%BE%8B%EF%BC%88%E4%BD%BF%E7%94%A8%E5%B7%B2%E6%9C%89%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE%E5%BA%93%EF%BC%8CMySQL%20%E4%B8%BA%E4%BE%8B%EF%BC%89%EF%BC%9A
0

第一个错误我去修改下。但第二个错误有一点疑问,因为第一次启动是可以正常使用的,但是关闭后无法再次启动,错题提示好像也不是host找不到

0

如果你第一次也是同样创建方式的话,应该是不会启动成功的。