java.nio.channels.ClosedChannelException: null

I’m seeing some weird behavior in a Gatling test while hitting an internal server. I did a simple single test that just do a GET to an endpoint, that GET is not allowed and when testing from the browser, server returns: {“code”:405,“message”:“HTTP 405 Method Not Allowed”}
So, since requests are more complicated, I’m testing this problem with a simple GET and I would expect the same 405 response from Gatling.
But instead, it fails and this is the stack trace shown:

`

16:24:34.243 [DEBUG] i.g.h.a.AsyncHandler - Request ‘test_request’ failed for user 1
java.nio.channels.ClosedChannelException: null
at io.netty.handler.ssl.SslHandler.channelInactive(…)(Unknown Source)
Wrapped by: java.net.ConnectException: <internal_server_here>
at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:162)
at org.asynchttpclient.netty.channel.NettyConnectListener$1.onFailure(NettyConnectListener.java:133)
at org.asynchttpclient.netty.SimpleFutureListener.operationComplete(SimpleFutureListener.java:26)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:500)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:479)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:420)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:122)
at io.netty.handler.ssl.SslHandler.notifyHandshakeFailure(SslHandler.java:1375)
at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1367)
at io.netty.handler.ssl.SslHandler.channelInactive(SslHandler.java:856)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:241)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:227)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:220)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1289)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:241)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:227)
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:893)
at io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:691)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:399)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:446)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:745)
16:24:34.247 [WARN ] i.g.h.a.ResponseProcessor - Request ‘test_request’ failed: j.n.ConnectException: <internal_server_here>
16:24:34.251 [TRACE] i.g.h.a.ResponseProcessor -

Request:
test_request: KO j.n.ConnectException: <internal_server_here>

Session:
Session(single test,1,Map(gatling.http.cache.dns → io.gatling.http.resolver.ShuffleJdkNameResolver@785d0db7),1492111471974,0,KO,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$166/559998250@3a3aa15b)

HTTP request:
GET <internal_server_here/searchQueryService/search

HTTP response:

`

The test I’m doing:

`

class SingleTest extends Simulation {

val httpConf = http
.disableWarmUp
.baseURL(“<internal_server_here>”)

val test_scenario = scenario(“single test”)
.exec(http(“test_request”)
.get(“/searchQueryService/search”)
.check(status.is(405)))

setUp(test_scenario.inject(atOnceUsers(1))).protocols(httpConf)

}

`

Using gatling and gatling maven plugin 2.2.4.
Any hint?

Sorry, but there’s no way to tell without a reproducer.