dnsnameresolver missing from session (Gatling 3.4.1)

I get an error when I try to send a http request where the hostname is an IP address.

So for example:
.formParam(“request”, “${request}”))

The IP address is that from another server. I am not able to use the hostname to reach that server.

In version 3.3.1 of Gatling I did not have issues with this. Now I get the error:

11:57:33.315 [ERROR] i.g.h.a.HttpRequestAction - ‘httpRequest-11’ failed to execute: DnsNameResolver missing from Session

Are you sure you’re not actually using Gatling 3.4.0 and are experiencing this bug: https://github.com/gatling/gatling/issues/3977?

I have a maven project in IntelliJ for Gatling 3.3.1. In the POM I changed the version for Gatling and tried my script.
This was apparently not enough (maybe something to do with gatling.conf ???) because that gave me the error.

I tried to create a fresh project with mvn archetype: generate, but I do not get a working project with that (a different issue).
I finally downloaded the sample project for gatling-maven-plugin (https://github.com/gatling/gatling-maven-plugin-demo).
With that project I don’t have the error. I hoped that migrating from 3.3 to 3.4 would be as simple as changing the version number in the POM, alas.

Thank you! Regards,

Well, that’s why we write migration guides: https://gatling.io/docs/current/migration_guides/

No idea what your actual issue was, though.
As usual, a reproducer would help.

I was able to pinpoint the issue.
By default I clean the session at the start of each iteration with flushCookieJar and flushHttpCache.
The flushHttpCache removes item gatling.http.cache.dns with value io.gatling.http.resolver.ShufflingNameResolver@…
This explains the error above.

How can I keep using flushHttpCache?

It’s indeed a bug, thanks for reporting!