[halo-dev/halo]docker方式部署,可以正常启动,但是启动后,过段时间再操作页面,就会Mysql链接报错

2024-04-01 629 views
3

使用的docker方式来部署,配置文件中只做了数据库连接地址等修改 服务可以正常启动并访问,但是过段时间就会出现这个错误:

2023-07-24 11:05:32.055141+00:002023-07-24T19:05:32.053+08:00 ERROR 7 --- [mReconciler-t-1] r.h.a.e.controller.DefaultController     : Reconciler in run.halo.app.core.extension.reconciler.MenuItemReconciler-worker-1 aborted with an error, re-enqueuing...
2023-07-24 11:05:32.055149+00:002023-07-24T11:05:32.055149550Z
2023-07-24 11:05:32.055156+00:00org.springframework.dao.DataAccessResourceFailureException: Failed to obtain R2DBC Connection
2023-07-24 11:05:32.055164+00:00at org.springframework.r2dbc.connection.ConnectionFactoryUtils.lambda$getConnection$0(ConnectionFactoryUtils.java:90) ~[spring-r2dbc-6.0.10.jar:6.0.10]
2023-07-24 11:05:32.055172+00:00at reactor.core.publisher.Mono.lambda$onErrorMap$28(Mono.java:3783) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055180+00:00at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055188+00:00at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055195+00:00at reactor.core.publisher.FluxRetry$RetrySubscriber.onError(FluxRetry.java:95) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055202+00:00at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:241) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055210+00:00at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:315) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055217+00:00at io.r2dbc.pool.MonoDiscardOnCancel$MonoDiscardOnCancelSubscriber.onError(MonoDiscardOnCancel.java:98) ~[r2dbc-pool-1.0.0.RELEASE.jar:1.0.0.RELEASE]
2023-07-24 11:05:32.055225+00:00at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055232+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onError(MonoIgnoreThen.java:278) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055240+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:231) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055248+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055255+00:00at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055262+00:00at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055270+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055278+00:00at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055286+00:00at reactor.netty.FutureMono.doSubscribe(FutureMono.java:122) ~[reactor-netty-core-1.1.8.jar:1.1.8]
2023-07-24 11:05:32.055293+00:00at reactor.netty.FutureMono$DeferredFutureMono.subscribe(FutureMono.java:114) ~[reactor-netty-core-1.1.8.jar:1.1.8]
2023-07-24 11:05:32.055301+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055308+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055316+00:00at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2205) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055323+00:00at reactor.core.publisher.MonoFlatMap$FlatMapMain.onComplete(MonoFlatMap.java:189) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055331+00:00at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:140) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055338+00:00at io.asyncer.r2dbc.mysql.client.ReactorNettyClient.lambda$close$11(ReactorNettyClient.java:200) ~[r2dbc-mysql-1.0.2.jar:1.0.2]
2023-07-24 11:05:32.055346+00:00at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:58) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055353+00:00at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055360+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055368+00:00at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055375+00:00at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055383+00:00at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055390+00:00at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055397+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055405+00:00at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055413+00:00at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055420+00:00at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055428+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onError(MonoIgnoreThen.java:278) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055435+00:00at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onError(MonoIgnoreElements.java:84) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055443+00:00at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:201) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055450+00:00at reactor.core.publisher.MonoSupplier$MonoSupplierSubscription.request(MonoSupplier.java:145) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055458+00:00at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.request(FluxHandleFuseable.java:260) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055465+00:00at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onSubscribe(MonoIgnoreElements.java:72) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055473+00:00at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onSubscribe(FluxHandleFuseable.java:164) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055480+00:00at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:48) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055488+00:00at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055496+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055504+00:00at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055511+00:00at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055518+00:00at io.r2dbc.pool.MonoDiscardOnCancel.subscribe(MonoDiscardOnCancel.java:50) ~[r2dbc-pool-1.0.0.RELEASE.jar:1.0.0.RELEASE]
2023-07-24 11:05:32.055526+00:00at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:165) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055534+00:00at reactor.pool.AbstractPool$Borrower.deliver(AbstractPool.java:467) ~[reactor-pool-1.0.0.jar:1.0.0]
2023-07-24 11:05:32.055542+00:00at reactor.pool.SimpleDequePool.lambda$drainLoop$8(SimpleDequePool.java:368) ~[reactor-pool-1.0.0.jar:1.0.0]
2023-07-24 11:05:32.055549+00:00at reactor.core.scheduler.ImmediateScheduler.schedule(ImmediateScheduler.java:52) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055556+00:00at reactor.pool.SimpleDequePool.drainLoop(SimpleDequePool.java:368) ~[reactor-pool-1.0.0.jar:1.0.0]
2023-07-24 11:05:32.055564+00:00at reactor.pool.SimpleDequePool.pendingOffer(SimpleDequePool.java:598) ~[reactor-pool-1.0.0.jar:1.0.0]
2023-07-24 11:05:32.055571+00:00at reactor.pool.SimpleDequePool.doAcquire(SimpleDequePool.java:294) ~[reactor-pool-1.0.0.jar:1.0.0]
2023-07-24 11:05:32.055578+00:00at reactor.pool.AbstractPool$Borrower.request(AbstractPool.java:430) ~[reactor-pool-1.0.0.jar:1.0.0]
2023-07-24 11:05:32.055586+00:00at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055594+00:00at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2341) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055601+00:00at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2215) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055609+00:00at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055616+00:00at reactor.pool.SimpleDequePool$QueueBorrowerMono.subscribe(SimpleDequePool.java:716) ~[reactor-pool-1.0.0.jar:1.0.0]
2023-07-24 11:05:32.055623+00:00at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055631+00:00at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055638+00:00at reactor.core.publisher.FluxRetry$RetrySubscriber.resubscribe(FluxRetry.java:117) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055645+00:00at reactor.core.publisher.FluxRetry$RetrySubscriber.onError(FluxRetry.java:101) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055653+00:00at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:241) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055660+00:00at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:315) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055669+00:00at io.r2dbc.pool.MonoDiscardOnCancel$MonoDiscardOnCancelSubscriber.onError(MonoDiscardOnCancel.java:98) ~[r2dbc-pool-1.0.0.RELEASE.jar:1.0.0.RELEASE]
2023-07-24 11:05:32.055676+00:00at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055684+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onError(MonoIgnoreThen.java:278) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055691+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:231) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055699+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055707+00:00at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055714+00:00at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055722+00:00at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055730+00:00at reactor.netty.FutureMono$FutureSubscription.operationComplete(FutureMono.java:196) ~[reactor-netty-core-1.1.8.jar:1.1.8]
2023-07-24 11:05:32.055737+00:00at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055744+00:00at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:557) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055752+00:00at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055759+00:00at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055766+00:00at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055774+00:00at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055783+00:00at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:84) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055792+00:00at io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetSuccess(AbstractChannel.java:990) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055799+00:00at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:686) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055807+00:00at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:620) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055814+00:00at io.netty.channel.DefaultChannelPipeline$HeadContext.close(DefaultChannelPipeline.java:1352) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055822+00:00at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:749) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055829+00:00at io.netty.channel.AbstractChannelHandlerContext.access$1200(AbstractChannelHandlerContext.java:61) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055837+00:00at io.netty.channel.AbstractChannelHandlerContext$11.run(AbstractChannelHandlerContext.java:732) ~[netty-transport-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055844+00:00at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055852+00:00at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055859+00:00at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055867+00:00at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:403) ~[netty-transport-classes-epoll-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055874+00:00at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055881+00:00at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055889+00:00at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.94.Final.jar:4.1.94.Final]
2023-07-24 11:05:32.055896+00:00at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
2023-07-24 11:05:32.055904+00:00Suppressed: java.lang.Exception: #block terminated with an error
2023-07-24 11:05:32.055912+00:00at reactor.core.publisher.BlockingOptionalMonoSubscriber.blockingGet(BlockingOptionalMonoSubscriber.java:126) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055920+00:00at reactor.core.publisher.Mono.blockOptional(Mono.java:1762) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.055927+00:00at run.halo.app.extension.DelegateExtensionClient.fetch(DelegateExtensionClient.java:37) ~[classes/:2.7.0]
2023-07-24 11:05:32.055934+00:00at run.halo.app.core.extension.reconciler.MenuItemReconciler.reconcile(MenuItemReconciler.java:34) ~[classes/:2.7.0]
2023-07-24 11:05:32.055942+00:00at run.halo.app.core.extension.reconciler.MenuItemReconciler.reconcile(MenuItemReconciler.java:22) ~[classes/:2.7.0]
2023-07-24 11:05:32.055949+00:00at run.halo.app.extension.controller.DefaultController$Worker.run(DefaultController.java:163) ~[api-2.7.0.jar:na]
2023-07-24 11:05:32.055957+00:00at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:na]
2023-07-24 11:05:32.055964+00:00at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
2023-07-24 11:05:32.055972+00:00at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
2023-07-24 11:05:32.055979+00:00at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
2023-07-24 11:05:32.055986+00:00... 1 common frames omitted
2023-07-24 11:05:32.055993+00:00Caused by: io.r2dbc.spi.R2dbcNonTransientResourceException: Connection validation failed
2023-07-24 11:05:32.056000+00:00at io.r2dbc.pool.Validation.lambda$validate$2(Validation.java:45) ~[r2dbc-pool-1.0.0.RELEASE.jar:1.0.0.RELEASE]
2023-07-24 11:05:32.056008+00:00at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:179) ~[reactor-core-3.5.7.jar:3.5.7]
2023-07-24 11:05:32.056016+00:00... 60 common frames omitted

回答

7

数据库可以正常访问

3

从日志来看是因为连接数据库异常,你部署 MySQL 和 Halo 的方式是什么呢?

2

一眼看出问题,在1.x的时候,就出现这个连接的问题了。我当时修改过连接池也不行。2.x也是同样的情况,所以这个与halo无关,应该是我部署Mysql服务的问题。

我是在truenas scale上部署的mysql服务与halo服务,以docker的方式来运行的。但是这种方式,我也怀疑是有问题的,我后续独立部署Mysql服务,再看看

8

以上错误一般只会发生在MySQL 重启的时候。MySQL 正常运行后,Halo 也会恢复正常。

测试方法:

  1. 本地启动 MySQL

    docker run -it --rm --name halodb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=openmysql -e MYSQL_DATABASE=halo mysql:8
  2. 启动 Halo(启用 dev 和 mysql profile)

    ./gradlew bootRun --args="--spring.profiles.active=dev,mysql --halo.plugin.runtime-mode=deployment"
  3. 测试 Halo 是否正常运行

  4. 重启 MySQL 容器

    docker restart halodb
  5. 在 MySQL 重启过程中测试 Halo 是否出现 Connection validation failed 异常

  6. 在 MySQL 重启成功后测试 Halo 是否运行正常

6

好的,我回家测试一下

9

image

image

果然如此,确实是这样,但是我这个mysql服务,确实没有重启的现象,怀疑就是网络的问题

7

第6点,在重启成功后,之前是访问有问题的,这个连接断了后,就无法重连。我后来在连接参数中,加了这个:autoReconnect=true 现在访问的时候,没有问题,能正常访问

9

请问下作者大佬,该项目是取消使用用数据库连接池吗?请问是考虑到哪些点,取消使用连接池呢?

4

好的,谢谢,感谢作者