Intermittent error: failed: java.lang.IllegalArgumentException: invalid version format: 0

I intermittently get an error on one of my test steps. But only when I have more than one thread going. I don’t see any errors from the app server side.

The log shows this:

InvitationFlow 7899323386084019634-2 REQUEST GET /api/onboardings/onboarding_details?invite_code=adventwamanda 1451861549487 1451861549487 1451861549487 1451861549488 KO java.lang.IllegalArgumentException: invalid version format: 0

15:39:58.800 [WARN ] i.g.h.a.AsyncHandlerActor - Request ‘GET /api/onboardings/onboarding_details?invite_code=adventwamanda’ failed: java.lang.IllegalArgumentException: invalid version format: 0

My gatling version is this: gatling-charts-highcharts-bundle-2.1.7

This test step is run via this simulation:

class InvitationFlow extends Simulation {

val scn = scenario(“InvitationFlow”)

.exec(UserData.setup,GetClientToken.slash,

Status.endpoint,

GuestUser.create,

Username.check,

Email.check,

RegisteredUser.create,

Session.create,

Session.track,

Onboarding.setup,

Onboarding.details,

Onboarding.onboard_user,

Onboarding.get_onboarding_champion,

RegisteredUser.dashboard,

Content.get_session,

Content.get_current_page,

Content.next_page,

Content.get_current_page,

Content.next_page,

Content.get_current_page

)

setUp(

// scn.inject( rampUsersPerSec(1) to(1) during(1 minutes))

scn.inject(atOnceUsers(4))

).protocols(httpConf)

// .maxDuration(1 minute)

}

object Onboarding {

val setup = exec(_.set(“invite_code”, “adventwamanda”))

var details = exec(http(“GET /api/onboardings/onboarding_details?invite_code=${invite_code}”)

.get("/api/onboardings/onboarding_details?invite_code=${invite_code}")

.headers(headers_with_token("${currentUserToken}","${xGlooApplication}"))

.check(status.is(200))

.check(jsonPath("$.onboarding.champion.id").ofType[Int].find.saveAs(“onboardingChampion”)))

var onboard_user = exec(http(“POST /api/onboardings/onboard_user”)

.post("/api/onboardings/onboard_user")

.headers(headers_with_token("${currentUserToken}","${xGlooApplication}"))

.body(StringBody("""

{“invite_code”:"${invite_code}"}

“”"))

.check(status.is(200)))

var get_onboarding_champion = exec(http(“GET /api/champions/:onboardingChampion”)

.get("/api/champions/${onboardingChampion}")

.headers(headers_with_token("${currentUserToken}","${xGlooApplication}"))

.check(status.is(200)))

}

Sometimes the error is different and it looks like the response in Gatling is blank. But it is not blank coming from the server.

17:05:13.993 [WARN ] i.g.h.a.AsyncHandlerActor - Request ‘GET /api/onboardings/onboarding_details?invite_code=adventwamanda’ failed: java.lang.IllegalArgumentException: empty text

17:05:13.996 [DEBUG] i.g.h.a.AsyncHandlerActor -

Hi,

It looks like a bug in underlying Netty/AsyncHttpClient.
Would you be able to grant access to a reproducer, please?

Regards,

For your information, another user on this mailing recently reported a similar issue and I just managed to investigate it (kuddos to him for granting me access).

It turned out to be a server side issue (either Tomcat or AWS’s ELB, yet to be identified) where a dandling 0CRLFCRLF was appended after a proper HTTP response, causing the next response read to crash when trying to parse it into a HTTP response line (that should start with something like HTTP/1.1).

ELB issue confirmed (thanks Benoit Delbosc): it sometimes appends some crap (a chunking footer) after the backend payload that messes up the next socket read on the client side, ex:

Backend response:

-- single packet --
  HTTP/1.1 404 Not Found
  ...
  Content-Length: 0