vityaman-edu / lms

A simple learning management system.
Apache License 2.0
4 stars 0 forks source link

Fix error when posting event fkey violation #172

Open vityaman opened 5 months ago

vityaman commented 5 months ago
curl -X 'POST' \
  'http://localhost:8080/api/v1/homework/16/workspace/1/event' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer FuzzingFuzzingFuzzingFuzzingFuzzingFuzzing' \
  -H 'Content-Type: application/json' \
  -d '{"kind": "feedback", "comment": "WellWellWellWellWellWellWell"}'
botalka-1             | 2024-06-21T13:04:25.893Z  WARN 1 --- [botalka] [tor-tcp-epoll-1] WorkspaceService                         : Failed to produce and event at workspace with id (16, 1): SQL [insert into "lms"."homework_feedback" ("homework_id", "student_id", "teacher_id", "comment", "score") values ($1, $2, $3, $4, $5) returning "lms"."homework_feedback"."id", "lms"."homework_feedback"."homework_id", "lms"."homework_feedback"."student_id", "lms"."homework_feedback"."teacher_id", "lms"."homework_feedback"."comment", "lms"."homework_feedback"."score", "lms"."homework_feedback"."creation_moment", "lms"."homework_feedback"."is_published"]; insert or update on table "homework_feedback" violates foreign key constraint "homework_feedback_student_id_fkey"
botalka-1             | 2024-06-21T13:04:25.925Z ERROR 1 --- [botalka] [tor-tcp-epoll-1] a.w.r.e.AbstractErrorWebExceptionHandler : [0f2f5f82-704]  500 Server Error for HTTP POST "/api/v1/homework/16/workspace/1/event"
botalka-1             | 
botalka-1             | ru.vityaman.lms.botalka.storage.jooq.exception.LinkViolationException: SQL [insert into "lms"."homework_feedback" ("homework_id", "student_id", "teacher_id", "comment", "score") values ($1, $2, $3, $4, $5) returning "lms"."homework_feedback"."id", "lms"."homework_feedback"."homework_id", "lms"."homework_feedback"."student_id", "lms"."homework_feedback"."teacher_id", "lms"."homework_feedback"."comment", "lms"."homework_feedback"."score", "lms"."homework_feedback"."creation_moment", "lms"."homework_feedback"."is_published"]; insert or update on table "homework_feedback" violates foreign key constraint "homework_feedback_student_id_fkey"
botalka-1             |         at ru.vityaman.lms.botalka.storage.jooq.exception.ConstraintViolationMappingKt$mapping$2.invoke(ConstraintViolationMapping.kt:13) ~[!/:0.0.1]
botalka-1             |         Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
botalka-1             | Error has been observed at the following site(s):
botalka-1             |         *__checkpoint ⇢ Handler ru.vityaman.lms.botalka.app.spring.api.http.endpoint.HomeworkHttpApi#postEvent(int, int, WorkspaceEventDraftMessage, Continuation) [DispatcherHandler]
botalka-1             |         *__checkpoint ⇢ AuthorizationWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ ExceptionTranslationWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ LogoutWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ ServerRequestCacheWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ ReactorContextWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ HttpHeaderWriterWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
botalka-1             |         *__checkpoint ⇢ HTTP POST "/api/v1/homework/16/workspace/1/event" [ExceptionHandlingWebHandler]
botalka-1             | Original Stack Trace:
botalka-1             |                 at ru.vityaman.lms.botalka.storage.jooq.exception.ConstraintViolationMappingKt$mapping$2.invoke(ConstraintViolationMapping.kt:13) ~[!/:0.0.1]
botalka-1             |                 at ru.vityaman.lms.botalka.storage.jooq.exception.ConstraintViolationMappingKt$mapping$2.invoke(ConstraintViolationMapping.kt:12) ~[!/:0.0.1]
botalka-1             |                 at ru.vityaman.lms.botalka.storage.jooq.exception.ConstraintViolationMappingKt.toStorage(ConstraintViolationMapping.kt:21) ~[!/:0.0.1]
botalka-1             |                 at ru.vityaman.lms.botalka.app.spring.storage.SpringDatabase$mono$2.invoke(SpringDatabase.kt:48) ~[!/:0.0.1]
botalka-1             |                 at ru.vityaman.lms.botalka.app.spring.storage.SpringDatabase$mono$2.invoke(SpringDatabase.kt:47) ~[!/:0.0.1]
botalka-1             |                 at ru.vityaman.lms.botalka.app.spring.storage.SpringDatabase.mono$lambda$3(SpringDatabase.kt:47) ~[!/:0.0.1]
botalka-1             |                 at reactor.core.publisher.Mono.lambda$onErrorMap$27(Mono.java:3840) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Mono.lambda$onErrorResume$29(Mono.java:3930) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Mono.subscribe(Mono.java:4568) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoUsingWhen$MonoUsingWhenSubscriber.deferredError(MonoUsingWhen.java:277) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxUsingWhen$RollbackInner.onComplete(FluxUsingWhen.java:480) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2231) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2231) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:210) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:210) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.pool.SimpleDequePool.maybeRecycleAndDrain(SimpleDequePool.java:540) ~[reactor-pool-1.0.5.jar!/:1.0.5]
botalka-1             |                 at reactor.pool.SimpleDequePool$QueuePoolRecyclerInner.onComplete(SimpleDequePool.java:770) ~[reactor-pool-1.0.5.jar!/:1.0.5]
botalka-1             |                 at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Mono.subscribe(Mono.java:4568) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.pool.SimpleDequePool$QueuePoolRecyclerMono.subscribe(SimpleDequePool.java:882) ~[reactor-pool-1.0.5.jar!/:1.0.5]
botalka-1             |                 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:241) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Operators.complete(Operators.java:137) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Mono.subscribe(Mono.java:4568) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:265) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:241) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onComplete(MonoIgnoreElements.java:89) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onComplete(FluxHandleFuseable.java:239) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoSupplier$MonoSupplierSubscription.request(MonoSupplier.java:148) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.request(FluxHandleFuseable.java:260) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onSubscribe(MonoIgnoreElements.java:72) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onSubscribe(FluxHandleFuseable.java:164) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoSupplier.subscribe(MonoSupplier.java:48) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Mono.subscribe(Mono.java:4568) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:265) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Mono.subscribe(Mono.java:4568) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onError(MonoIgnoreElements.java:84) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxFilter$FilterSubscriber.onError(FluxFilter.java:157) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onError(FluxFilter.java:291) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onError(FluxMap.java:265) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.Mono.subscribe(Mono.java:4568) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onError(FluxUsingWhen.java:368) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at org.jooq.impl.Internal$1.onError(Internal.java:754) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at org.jooq.impl.R2DBC$Forwarding.lambda$onError$0(R2DBC.java:249) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at org.jooq.impl.R2DBC$AbstractNonBlockingSubscription.lambda$cancel0$4(R2DBC.java:656) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at java.base/java.util.concurrent.atomic.AtomicReference.updateAndGet(AtomicReference.java:210) ~[na:na]
botalka-1             |                 at org.jooq.impl.R2DBC$AbstractNonBlockingSubscription.cancel0(R2DBC.java:644) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at org.jooq.impl.R2DBC$AbstractSubscription.complete(R2DBC.java:210) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at org.jooq.impl.R2DBC$AbstractResultSubscriber.complete(R2DBC.java:300) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at org.jooq.impl.R2DBC$Forwarding.complete(R2DBC.java:262) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at org.jooq.impl.R2DBC$Forwarding.onError(R2DBC.java:249) ~[jooq-3.19.6.jar!/:na]
botalka-1             |                 at reactor.core.publisher.StrictSubscriber.onError(StrictSubscriber.java:106) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:213) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onError(MonoFlatMapMany.java:256) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:201) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onNext(FluxFilterFuseable.java:337) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at io.r2dbc.postgresql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onNext(FluxDiscardOnCancel.java:91) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |                 at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:113) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:129) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:880) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:805) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:163) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at io.r2dbc.postgresql.client.ReactorNettyClient$Conversation.emit(ReactorNettyClient.java:684) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |                 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.emit(ReactorNettyClient.java:936) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |                 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onNext(ReactorNettyClient.java:810) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |                 at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onNext(ReactorNettyClient.java:716) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |                 at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:129) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:224) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:224) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |                 at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:294) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |                 at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:403) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |                 at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:426) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |                 at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:454) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |                 at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
botalka-1             | Caused by: org.jooq.exception.IntegrityConstraintViolationException: SQL [insert into "lms"."homework_feedback" ("homework_id", "student_id", "teacher_id", "comment", "score") values ($1, $2, $3, $4, $5) returning "lms"."homework_feedback"."id", "lms"."homework_feedback"."homework_id", "lms"."homework_feedback"."student_id", "lms"."homework_feedback"."teacher_id", "lms"."homework_feedback"."comment", "lms"."homework_feedback"."score", "lms"."homework_feedback"."creation_moment", "lms"."homework_feedback"."is_published"]; insert or update on table "homework_feedback" violates foreign key constraint "homework_feedback_student_id_fkey"
                        * Consumed search budget: 0.137%; covered targets: 0; time per test: 60.8ms (5.6 actions)
botalka-1             |         at org.jooq.impl.Tools.translate(Tools.java:3559) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at org.jooq.impl.Tools.translate(Tools.java:3543) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at org.jooq.impl.R2DBC$Forwarding.lambda$onError$0(R2DBC.java:249) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at org.jooq.impl.R2DBC$AbstractNonBlockingSubscription.lambda$cancel0$4(R2DBC.java:656) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at java.base/java.util.concurrent.atomic.AtomicReference.updateAndGet(AtomicReference.java:210) ~[na:na]
botalka-1             |         at org.jooq.impl.R2DBC$AbstractNonBlockingSubscription.cancel0(R2DBC.java:644) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at org.jooq.impl.R2DBC$AbstractSubscription.complete(R2DBC.java:210) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at org.jooq.impl.R2DBC$AbstractResultSubscriber.complete(R2DBC.java:300) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at org.jooq.impl.R2DBC$Forwarding.complete(R2DBC.java:262) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at org.jooq.impl.R2DBC$Forwarding.onError(R2DBC.java:249) ~[jooq-3.19.6.jar!/:na]
botalka-1             |         at reactor.core.publisher.StrictSubscriber.onError(StrictSubscriber.java:106) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxHandle$HandleSubscriber.onError(FluxHandle.java:213) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onError(MonoFlatMapMany.java:256) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:201) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onNext(FluxFilterFuseable.java:337) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at io.r2dbc.postgresql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onNext(FluxDiscardOnCancel.java:91) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |         at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:113) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:129) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:880) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:805) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:163) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at io.r2dbc.postgresql.client.ReactorNettyClient$Conversation.emit(ReactorNettyClient.java:684) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |         at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.emit(ReactorNettyClient.java:936) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |         at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onNext(ReactorNettyClient.java:810) ~[r2dbc-postgresql-1.0.4.
                        * Consumed search budget: 0.144%; covered targets: 0; time per test: 56.6ms (5.4 actions)
botalka-1             |         at io.r2dbc.postgresql.client.ReactorNettyClient$BackendMessageSubscriber.onNext(ReactorNettyClient.java:716) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |         at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:129) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:224) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:224) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:294) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |         at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:403) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |         at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:426) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |         at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114) ~[reactor-netty-core-1.1.17.jar!/:1.1.17]
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:454) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[netty-codec-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.107.F
                        * Consumed search budget: 0.151%; covered targets: 0; time per test: 57.1ms (5.6 actions)
botalka-1             |         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[netty-transport-classes-epoll-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.107.Final.jar!/:4.1.107.Final]
botalka-1             |         at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
botalka-1             | Caused by: io.r2dbc.postgresql.ExceptionFactory$PostgresqlDataIntegrityViolationException: insert or update on table "homework_feedback" violates foreign key constraint "homework_feedback_student_id_fkey"
botalka-1             |         at io.r2dbc.postgresql.ExceptionFactory.createException(ExceptionFactory.java:102) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |         at io.r2dbc.postgresql.ExceptionFactory.createException(ExceptionFactory.java:65) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |         at io.r2dbc.postgresql.ExceptionFactory.handleErrorResponse(ExceptionFactory.java:132) ~[r2dbc-postgresql-1.0.4.RELEASE.jar!/:1.0.4.RELEASE]
botalka-1             |         at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:179) ~[reactor-core-3.6.4.jar!/:3.6.4]
botalka-1             |         ... 43 common frames omitted
botalka-1             | 
vityaman commented 5 months ago

"homework_feedback_student_id_fkey" is also possible