gravitee-io / issues

Gravitee.io - API Platform - Issues
65 stars 26 forks source link

Bot detection plugin error #9909

Closed exalate-issue-sync[bot] closed 2 months ago

exalate-issue-sync[bot] commented 3 months ago

Describe the bug :

describe-the-bug-

Bot Detection causes gateway errors.

To Reproduce :

to-reproduce-

Steps to reproduce the behaviour:

  1. In Settings > Bot Detection, create a new Bot Detection (Google reCAPTCHA v3 mechanism).
  2. After it has been created, check the gateway logs, to find the two errors related to bot detection.
  3. These errors also appear when starting an environment that already has an existing Bot Detection.

Expected behaviour :

expected-behaviour-

New bot detection should be created successfully.

Current behaviour :

current-behaviour-

Creating a new bot detection results in errors.

Useful information :

useful-information-

First error:

ERROR i.g.a.p.h.a.c.ProviderPluginManager - An unexpected error occurs while loadingjava.lang.NullPointerException: Cannot invoke "org.springframework.core.env.Environment.getProperty(String, java.lang.Class, Object)" because "this.environment" is nullat io.gravitee.am.service.http.WebClientBuilder.httpClientTimeout(WebClientBuilder.java:120)at io.gravitee.am.service.http.WebClientBuilder.createWebClient(WebClientBuilder.java:58)at io.gravitee.am.botdetection.google.recaptcha.provider.GoogleReCaptchaV3Provider.start(GoogleReCaptchaV3Provider.java:55)at io.gravitee.am.botdetection.google.recaptcha.provider.GoogleReCaptchaV3Provider.start(GoogleReCaptchaV3Provider.java:38)at io.gravitee.am.plugins.handlers.api.core.ProviderPluginManager.createProvider(ProviderPluginManager.java:81)at io.gravitee.am.plugins.handlers.api.core.ProviderPluginManager.createProvider(ProviderPluginManager.java:61)at io.gravitee.am.plugins.handlers.api.core.ProviderPluginManager.createProvider(ProviderPluginManager.java:54)at io.gravitee.am.plugins.botdetection.core.BotDetectionPluginManager.create(BotDetectionPluginManager.java:58)at io.gravitee.am.gateway.handler.manager.botdetection.impl.BotDetectionManagerImpl.updateBotDetection(BotDetectionManagerImpl.java:181)at io.gravitee.am.gateway.handler.manager.botdetection.impl.BotDetectionManagerImpl.lambda$afterPropertiesSet$0(BotDetectionManagerImpl.java:90)at io.reactivex.rxjava3.internal.subscribers.LambdaSubscriber.onNext(LambdaSubscriber.java:65)at io.reactivex.rxjava3.internal.operators.flowable.FlowableOnErrorNext$OnErrorNextSubscriber.onNext(FlowableOnErrorNext.java:76)at io.reactivex.rxjava3.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:69)at reactor.adapter.rxjava.RxJava3Adapter$FluxAsFlowable$FluxAsFlowableSubscriber.onNext(RxJava3Adapter.java:438)at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onNext(FluxConcatMapNoPrefetch.java:197)at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmit(FluxFlatMap.java:544)at reactor.core.publisher.FluxFlatMap$FlatMapInner.onNext(FluxFlatMap.java:985)at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:194)at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drainRegular(FluxWindowPredicate.java:670)at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drain(FluxWindowPredicate.java:748)at reactor.core.publisher.FluxWindowPredicate$WindowFlux.onNext(FluxWindowPredicate.java:790)at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.onNext(FluxWindowPredicate.java:268)at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)at reactor.core.publisher.FluxTakeUntilOther$TakeUntilMainSubscriber.onNext(FluxTakeUntilOther.java:243)at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)at io.r2dbc.mssql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onNext(FluxDiscardOnCancel.java:94)at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:113)at reactor.core.publisher.FluxHandle$HandleConditionalSubscriber.onNext(FluxHandle.java:343)at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:113)at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)at reactor.core.publisher.FluxHandle$HandleConditionalSubscriber.onNext(FluxHandle.java:343)at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)at reactor.core.publisher.SinkManyEmitterProcessor.drain(SinkManyEmitterProcessor.java:471)at reactor.core.publisher.SinkManyEmitterProcessor.tryEmitNext(SinkManyEmitterProcessor.java:269)at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100)at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27)at io.r2dbc.mssql.client.ReactorNettyClient$1.next(ReactorNettyClient.java:295)at io.r2dbc.mssql.client.ReactorNettyClient$1.next(ReactorNettyClient.java:214)at io.r2dbc.mssql.client.ReactorNettyClient$2.onNext(ReactorNettyClient.java:326)at io.r2dbc.mssql.client.ReactorNettyClient$2.onNext(ReactorNettyClient.java:315)at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drainAsync(FluxFlattenIterable.java:453)at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drain(FluxFlattenIterable.java:724)at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.onNext(FluxFlattenIterable.java:256)at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:279)at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:388)at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:404)at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)at io.r2dbc.mssql.client.ssl.TdsSslHandler.channelRead(TdsSslHandler.java:380)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)at java.base/java.lang.Thread.run(Unknown Source)

Second error:

ERROR i.g.a.g.h.m.b.i.BotDetectionManagerImpl - Unable to create bot detection provider for domain Testjava.lang.NullPointerException: nullat java.base/java.util.concurrent.ConcurrentHashMap.putVal(Unknown Source)at java.base/java.util.concurrent.ConcurrentHashMap.put(Unknown Source)at io.gravitee.am.gateway.handler.manager.botdetection.impl.BotDetectionManagerImpl.updateBotDetection(BotDetectionManagerImpl.java:182)at io.gravitee.am.gateway.handler.manager.botdetection.impl.BotDetectionManagerImpl.lambda$afterPropertiesSet$0(BotDetectionManagerImpl.java:90)at io.reactivex.rxjava3.internal.subscribers.LambdaSubscriber.onNext(LambdaSubscriber.java:65)at io.reactivex.rxjava3.internal.operators.flowable.FlowableOnErrorNext$OnErrorNextSubscriber.onNext(FlowableOnErrorNext.java:76)at io.reactivex.rxjava3.internal.operators.flowable.FlowableMap$MapSubscriber.onNext(FlowableMap.java:69)at reactor.adapter.rxjava.RxJava3Adapter$FluxAsFlowable$FluxAsFlowableSubscriber.onNext(RxJava3Adapter.java:438)at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onNext(FluxConcatMapNoPrefetch.java:197)at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onNext(FluxUsingWhen.java:345)at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmit(FluxFlatMap.java:544)at reactor.core.publisher.FluxFlatMap$FlatMapInner.onNext(FluxFlatMap.java:985)at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:194)at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drainRegular(FluxWindowPredicate.java:670)at reactor.core.publisher.FluxWindowPredicate$WindowFlux.drain(FluxWindowPredicate.java:748)at reactor.core.publisher.FluxWindowPredicate$WindowFlux.onNext(FluxWindowPredicate.java:790)at reactor.core.publisher.FluxWindowPredicate$WindowPredicateMain.onNext(FluxWindowPredicate.java:268)at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)at reactor.core.publisher.FluxTakeUntilOther$TakeUntilMainSubscriber.onNext(FluxTakeUntilOther.java:243)at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)at io.r2dbc.mssql.util.FluxDiscardOnCancel$FluxDiscardOnCancelSubscriber.onNext(FluxDiscardOnCancel.java:94)at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:113)at reactor.core.publisher.FluxHandle$HandleConditionalSubscriber.onNext(FluxHandle.java:343)at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:113)at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)at reactor.core.publisher.FluxHandle$HandleConditionalSubscriber.onNext(FluxHandle.java:343)at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)at reactor.core.publisher.SinkManyEmitterProcessor.drain(SinkManyEmitterProcessor.java:471)at reactor.core.publisher.SinkManyEmitterProcessor.tryEmitNext(SinkManyEmitterProcessor.java:269)at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100)at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27)at io.r2dbc.mssql.client.ReactorNettyClient$1.next(ReactorNettyClient.java:295)at io.r2dbc.mssql.client.ReactorNettyClient$1.next(ReactorNettyClient.java:214)at io.r2dbc.mssql.client.ReactorNettyClient$2.onNext(ReactorNettyClient.java:326)at io.r2dbc.mssql.client.ReactorNettyClient$2.onNext(ReactorNettyClient.java:315)at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drainAsync(FluxFlattenIterable.java:453)at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.drain(FluxFlattenIterable.java:724)at reactor.core.publisher.FluxFlattenIterable$FlattenIterableSubscriber.onNext(FluxFlattenIterable.java:256)at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:279)at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:388)at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:404)at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)at io.r2dbc.mssql.client.ssl.TdsSslHandler.channelRead(TdsSslHandler.java:380)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)at java.base/java.lang.Thread.run(Unknown Source)

Desktop :

desktop-

* Please see Zendesk Support tab for further comments and attachments.

exalate-issue-sync[bot] commented 2 months ago

This issue will be fixed in versions 4.4.5, 4.1.29, 4.3.12, 4.5.0, 4.2.20