I built a simple backend server using R2DBC, it connects to the local PostgreSQL database.
I then deployed it in a docker container.
The API works at first, but after 10~20 minutes, it will return a 500 internal service error.
Sometimes it fixes itself after some time.
Docker Log
```
2023-07-13 17:48:45 2023-07-13T09:48:45.881Z ERROR 1 --- [tor-tcp-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter : [cfda2763-28] 500 Server Error for HTTP GET "/product/findAll"
2023-07-13 17:48:45
2023-07-13 17:48:45 org.springframework.dao.DataAccessResourceFailureException: executeMany; SQL [SELECT product.* FROM product]; An I/O error occurred while sending to the backend or receiving from the backend
2023-07-13 17:48:45 at org.springframework.r2dbc.connection.ConnectionFactoryUtils.convertR2dbcException(ConnectionFactoryUtils.java:231) ~[spring-r2dbc-6.0.10.jar!/:6.0.10]
2023-07-13 17:48:45 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
2023-07-13 17:48:45 Error has been observed at the following site(s):
2023-07-13 17:48:45 *__checkpoint ⇢ Handler com.example.springreactivecrud.controller.ProductController#getAllProduct() [DispatcherHandler]
2023-07-13 17:48:45 *__checkpoint ⇢ HTTP GET "/product/findAll" [ExceptionHandlingWebHandler]
2023-07-13 17:48:45 Original Stack Trace:
2023-07-13 17:48:45 at org.springframework.r2dbc.connection.ConnectionFactoryUtils.convertR2dbcException(ConnectionFactoryUtils.java:231) ~[spring-r2dbc-6.0.10.jar!/:6.0.10]
2023-07-13 17:48:45 at org.springframework.r2dbc.core.DefaultDatabaseClient.lambda$inConnectionMany$8(DefaultDatabaseClient.java:151) ~[spring-r2dbc-6.0.10.jar!/:6.0.10]
2023-07-13 17:48:45 at reactor.core.publisher.Flux.lambda$onErrorMap$28(Flux.java:7236) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Flux.lambda$onErrorResume$29(Flux.java:7289) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.deferredError(FluxUsingWhen.java:398) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxUsingWhen$RollbackInner.onComplete(FluxUsingWhen.java:475) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2205) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2205) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.pool.SimpleDequePool.maybeRecycleAndDrain(SimpleDequePool.java:531) ~[reactor-pool-1.0.0.jar!/:1.0.0]
2023-07-13 17:48:45 at reactor.pool.SimpleDequePool$QueuePoolRecyclerInner.onComplete(SimpleDequePool.java:761) ~[reactor-pool-1.0.0.jar!/:1.0.0]
2023-07-13 17:48:45 at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.pool.SimpleDequePool$QueuePoolRecyclerMono.subscribe(SimpleDequePool.java:873) ~[reactor-pool-1.0.0.jar!/:1.0.0]
2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onComplete(MonoIgnoreElements.java:89) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onComplete(FluxHandleFuseable.java:239) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoSupplier$MonoSupplierSubscription.request(MonoSupplier.java:148) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.request(FluxHandleFuseable.java:260) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onSubscribe(MonoIgnoreElements.java:72) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onSubscribe(FluxHandleFuseable.java:164) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:48) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onError(MonoIgnoreElements.java:84) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxFilter$FilterSubscriber.onError(FluxFilter.java:157) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onError(FluxFilter.java:291) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onError(FluxUsingWhen.java:364) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:843) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:609) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:589) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.onError(FluxFlatMap.java:452) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at io.r2dbc.postgresql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onError(FluxDiscardOnCancel.java:97) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onError(FluxMapFuseable.java:142) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onError(FluxContextWrite.java:121) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.signalAsyncError(FluxWindowPredicate.java:354) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.checkTerminated(FluxWindowPredicate.java:536) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.drainLoop(FluxWindowPredicate.java:488) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.drain(FluxWindowPredicate.java:432) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.onError(FluxWindowPredicate.java:291) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at io.r2dbc.postgresql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onError(FluxDiscardOnCancel.java:97) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onError(FluxContextWrite.java:121) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$BaseSink.error(FluxCreate.java:474) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:802) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$BufferAsyncSink.error(FluxCreate.java:747) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$SerializedFluxSink.drainLoop(FluxCreate.java:237) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$SerializedFluxSink.drain(FluxCreate.java:213) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$SerializedFluxSink.error(FluxCreate.java:189) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$Conversation.onError(ReactorNettyClient.java:698) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.close(ReactorNettyClient.java:971) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.drainError(ReactorNettyClient.java:530) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.handleConnectionError(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.access$300(ReactorNettyClient.java:92) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onError(ReactorNettyClient.java:843) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:213) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onError(FluxPeekFuseable.java:903) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:478) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:273) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.onInboundError(FluxReceive.java:466) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperations.onInboundError(ChannelOperations.java:500) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperationsHandler.exceptionCaught(ChannelOperationsHandler.java:144) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1377) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:907) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.handleReadException(AbstractEpollStreamChannel.java:728) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:826) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
2023-07-13 17:48:45 Caused by: io.r2dbc.postgresql.client.ReactorNettyClient$PostgresConnectionException: An I/O error occurred while sending to the backend or receiving from the backend
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.lambda$handleConnectionError$19(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
2023-07-13 17:48:45 Error has been observed at the following site(s):
2023-07-13 17:48:45 *__checkpoint ⇢ SQL "SELECT product.* FROM product" [DatabaseClient]
2023-07-13 17:48:45 Original Stack Trace:
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.lambda$handleConnectionError$19(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.close(ReactorNettyClient.java:971) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.drainError(ReactorNettyClient.java:530) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.handleConnectionError(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.access$300(ReactorNettyClient.java:92) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onError(ReactorNettyClient.java:843) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE]
2023-07-13 17:48:45 at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:213) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onError(FluxPeekFuseable.java:903) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7]
2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:478) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:273) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.onInboundError(FluxReceive.java:466) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperations.onInboundError(ChannelOperations.java:500) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperationsHandler.exceptionCaught(ChannelOperationsHandler.java:144) ~[reactor-netty-core-1.1.8.jar!/:1.1.8]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1377) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:907) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.handleReadException(AbstractEpollStreamChannel.java:728) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:826) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final]
2023-07-13 17:48:45 at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
2023-07-13 17:48:45 Caused by: io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer
2023-07-13 17:48:45
2023-07-13 17:48:45 2023-07-13T09:48:45.888Z ERROR 1 --- [tor-tcp-epoll-1] i.r.p.client.ReactorNettyClient : Connection Error
2023-07-13 17:48:45
2023-07-13 17:48:45 io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer
2023-07-13 17:48:45
```
Dockerfile
FROM openjdk:17-jdk
ARG JAR_FILE=target/*.jar
COPY ./target/product-backend.jar app.jar
EXPOSE 9090
ENTRYPOINT ["java", "-jar", "/app.jar"]
pom.xml4.0.0org.springframework.bootspring-boot-starter-parent3.1.1com.exampleSpringReactiveCRUD0.0.1-SNAPSHOTSpringReactiveCRUDSpringReactiveCRUD17org.springframework.bootspring-boot-starter-data-r2dbcorg.springframework.bootspring-boot-starter-webfluxorg.postgresqlpostgresqlruntimeorg.postgresqlr2dbc-postgresqlruntimeorg.projectlomboklomboktrueorg.springframework.bootspring-boot-starter-testtestio.projectreactorreactor-testtestorg.springframework.dataspring-data-relational3.1.1jakarta.persistencejakarta.persistence-api3.1.0org.springframework.dataspring-data-r2dbc3.1.1org.springframework.bootspring-boot-maven-pluginorg.projectlomboklombokproduct-backend
Steps to reproduce
I use intellij.
I click clean and install in Maven.
I run docker build -t image .
and docker run -p 8080:9090 image
After that I open the browser localhost:8080/api to check if my API is working correctly, here it works
After 10~20 minutes, I refresh the site, and it returns 500 internal service error
Expected behavior/code
I expect the API to work as long as the docker container is running
Connection reset by peer are infrastructure errors that a pool cannot handle. From the stack trace it seems that during the query the database server has closed its connection.
Bug Report
Versions
Current Behavior
I built a simple backend server using R2DBC, it connects to the local PostgreSQL database. I then deployed it in a docker container. The API works at first, but after 10~20 minutes, it will return a 500 internal service error. Sometimes it fixes itself after some time.
Docker Log
``` 2023-07-13 17:48:45 2023-07-13T09:48:45.881Z ERROR 1 --- [tor-tcp-epoll-1] o.s.w.s.adapter.HttpWebHandlerAdapter : [cfda2763-28] 500 Server Error for HTTP GET "/product/findAll" 2023-07-13 17:48:45 2023-07-13 17:48:45 org.springframework.dao.DataAccessResourceFailureException: executeMany; SQL [SELECT product.* FROM product]; An I/O error occurred while sending to the backend or receiving from the backend 2023-07-13 17:48:45 at org.springframework.r2dbc.connection.ConnectionFactoryUtils.convertR2dbcException(ConnectionFactoryUtils.java:231) ~[spring-r2dbc-6.0.10.jar!/:6.0.10] 2023-07-13 17:48:45 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 2023-07-13 17:48:45 Error has been observed at the following site(s): 2023-07-13 17:48:45 *__checkpoint ⇢ Handler com.example.springreactivecrud.controller.ProductController#getAllProduct() [DispatcherHandler] 2023-07-13 17:48:45 *__checkpoint ⇢ HTTP GET "/product/findAll" [ExceptionHandlingWebHandler] 2023-07-13 17:48:45 Original Stack Trace: 2023-07-13 17:48:45 at org.springframework.r2dbc.connection.ConnectionFactoryUtils.convertR2dbcException(ConnectionFactoryUtils.java:231) ~[spring-r2dbc-6.0.10.jar!/:6.0.10] 2023-07-13 17:48:45 at org.springframework.r2dbc.core.DefaultDatabaseClient.lambda$inConnectionMany$8(DefaultDatabaseClient.java:151) ~[spring-r2dbc-6.0.10.jar!/:6.0.10] 2023-07-13 17:48:45 at reactor.core.publisher.Flux.lambda$onErrorMap$28(Flux.java:7236) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Flux.lambda$onErrorResume$29(Flux.java:7289) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.deferredError(FluxUsingWhen.java:398) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxUsingWhen$RollbackInner.onComplete(FluxUsingWhen.java:475) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2205) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2205) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:209) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.pool.SimpleDequePool.maybeRecycleAndDrain(SimpleDequePool.java:531) ~[reactor-pool-1.0.0.jar!/:1.0.0] 2023-07-13 17:48:45 at reactor.pool.SimpleDequePool$QueuePoolRecyclerInner.onComplete(SimpleDequePool.java:761) ~[reactor-pool-1.0.0.jar!/:1.0.0] 2023-07-13 17:48:45 at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.pool.SimpleDequePool$QueuePoolRecyclerMono.subscribe(SimpleDequePool.java:873) ~[reactor-pool-1.0.0.jar!/:1.0.0] 2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:240) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:203) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onComplete(MonoIgnoreElements.java:89) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onComplete(FluxHandleFuseable.java:239) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoSupplier$MonoSupplierSubscription.request(MonoSupplier.java:148) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.request(FluxHandleFuseable.java:260) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onSubscribe(MonoIgnoreElements.java:72) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onSubscribe(FluxHandleFuseable.java:164) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:48) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onError(MonoIgnoreElements.java:84) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxFilter$FilterSubscriber.onError(FluxFilter.java:157) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onError(FluxFilter.java:291) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onError(FluxUsingWhen.java:364) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.checkTerminated(FluxFlatMap.java:843) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:609) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:589) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxFlatMap$FlatMapMain.onError(FluxFlatMap.java:452) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at io.r2dbc.postgresql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onError(FluxDiscardOnCancel.java:97) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onError(FluxMapFuseable.java:142) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onError(FluxContextWrite.java:121) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.signalAsyncError(FluxWindowPredicate.java:354) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.checkTerminated(FluxWindowPredicate.java:536) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.drainLoop(FluxWindowPredicate.java:488) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.drain(FluxWindowPredicate.java:432) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.onError(FluxWindowPredicate.java:291) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at io.r2dbc.postgresql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onError(FluxDiscardOnCancel.java:97) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onError(FluxContextWrite.java:121) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$BaseSink.error(FluxCreate.java:474) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:802) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$BufferAsyncSink.error(FluxCreate.java:747) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$SerializedFluxSink.drainLoop(FluxCreate.java:237) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$SerializedFluxSink.drain(FluxCreate.java:213) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxCreate$SerializedFluxSink.error(FluxCreate.java:189) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$Conversation.onError(ReactorNettyClient.java:698) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.close(ReactorNettyClient.java:971) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.drainError(ReactorNettyClient.java:530) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.handleConnectionError(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.access$300(ReactorNettyClient.java:92) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onError(ReactorNettyClient.java:843) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:213) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onError(FluxPeekFuseable.java:903) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:478) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:273) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.onInboundError(FluxReceive.java:466) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperations.onInboundError(ChannelOperations.java:500) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperationsHandler.exceptionCaught(ChannelOperationsHandler.java:144) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1377) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:907) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.handleReadException(AbstractEpollStreamChannel.java:728) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:826) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] 2023-07-13 17:48:45 Caused by: io.r2dbc.postgresql.client.ReactorNettyClient$PostgresConnectionException: An I/O error occurred while sending to the backend or receiving from the backend 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.lambda$handleConnectionError$19(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 2023-07-13 17:48:45 Error has been observed at the following site(s): 2023-07-13 17:48:45 *__checkpoint ⇢ SQL "SELECT product.* FROM product" [DatabaseClient] 2023-07-13 17:48:45 Original Stack Trace: 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.lambda$handleConnectionError$19(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.close(ReactorNettyClient.java:971) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.drainError(ReactorNettyClient.java:530) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.handleConnectionError(ReactorNettyClient.java:525) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient.access$300(ReactorNettyClient.java:92) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onError(ReactorNettyClient.java:843) ~[r2dbc-postgresql-1.0.1.RELEASE.jar!/:1.0.1.RELEASE] 2023-07-13 17:48:45 at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:213) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onError(FluxPeekFuseable.java:903) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.5.7.jar!/:3.5.7] 2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.terminateReceiver(FluxReceive.java:478) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:273) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.FluxReceive.onInboundError(FluxReceive.java:466) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperations.onInboundError(ChannelOperations.java:500) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at reactor.netty.channel.ChannelOperationsHandler.exceptionCaught(ChannelOperationsHandler.java:144) ~[reactor-netty-core-1.1.8.jar!/:1.1.8] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1377) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:907) ~[netty-transport-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.handleReadException(AbstractEpollStreamChannel.java:728) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:826) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) ~[netty-transport-classes-epoll-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.94.Final.jar!/:4.1.94.Final] 2023-07-13 17:48:45 at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na] 2023-07-13 17:48:45 Caused by: io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer 2023-07-13 17:48:45 2023-07-13 17:48:45 2023-07-13T09:48:45.888Z ERROR 1 --- [tor-tcp-epoll-1] i.r.p.client.ReactorNettyClient : Connection Error 2023-07-13 17:48:45 2023-07-13 17:48:45 io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer 2023-07-13 17:48:45 ```Dockerfile
FROM openjdk:17-jdk ARG JAR_FILE=target/*.jar COPY ./target/product-backend.jar app.jar EXPOSE 9090 ENTRYPOINT ["java", "-jar", "/app.jar"]pom.xml
Steps to reproduce
I use intellij. I click clean and install in Maven. I run
docker build -t image .
anddocker run -p 8080:9090 image
After that I open the browserlocalhost:8080/api
to check if my API is working correctly, here it works After 10~20 minutes, I refresh the site, and it returns 500 internal service errorExpected behavior/code
I expect the API to work as long as the docker container is running