Illegal character in path

We have some problems in a gatling simulation where one of the requests we sends, results in a redirect to a URL containing the following URL-encoded character: %20.

When this redirect occurs, we get the following error in our gatling log:

java.net.URISyntaxException: Illegal character in path at index 37: htttp://www-t3.nav.no/Arbeid/Utlogging Fra Tjenesten

We have tried setting useRawUrl in gatling.conf to true, but with no effect.

Any tips on how to fix this problem?

Do you have an example of the returned “Location” header ?

java.net.URISyntaxException: Illegal character in path at index 37: htttp://www-t3.nav.no/Arbeid/Utlogging Fra Tjenesten

Did you noticed that there is 3 “t” in “htttp” here ?

cheers
nicolas

Sorry, a typo from me when pasting the error message… The URL and the redirect works in browsers, but when we run a simulation (recorded by Gatling) we get this error.

Henrik

kl. 14:45:42 UTC+2 mandag 6. mai 2013 skrev Nicolas Rémond følgende:

If the issue is about the white space in your Location header:

  • Yes, as per RFC, your header is invalid
  • I’ve add support for those malformed header in AHC 1.7.15 (https://github.com/AsyncHttpClient/async-http-client/issues/268), which is about to be shipped in Gatling 1.5.0 and 2.0.0-M2 that I’m releasing at this very moment.
    Making it short, please wait 30 minutes and stay tuned.

BTW, if you can get this Location header fixed, you’ll do the internet some good (even minor).

The Location header looks like this:

http://www-t3.nav.no/Arbeid/Utlogging fra tjenesten

The same as the URL printed in the error message.

-Henrik

kl. 14:49:32 UTC+2 mandag 6. mai 2013 skrev Henrik Wingerei følgende:

Done, Gatling 1.5.0 and 2.0.0-M2 are out! Check them out!

Thanks! Seems to work fine!

One thing: Seems like the links to the different versions have been mixed up on gatling-tool.org. The link for 1.5.0 points to 2.0.0-M2, and the link for 2.0.0-M2 points to 1.5.0

kl. 15:14:49 UTC+2 mandag 6. mai 2013 skrev Stéphane Landelle følgende:

Yep, I just fixed them, thanks!

So you no longer have your weird “Exception in thread “main” java.util.zip.ZipException: ZIP file must have at least one entry”?

No. The weird error got away when installing a fresh copy of Gatling.

But, I was a bit quick on checking our original error. Seems like it’s still there in version 1.5.0. I’ve also set useRawUrls to true in gatling.conf.

Here is the full stack trace. I can’t see that AsyncHttpProviderUtils is active in the call stack?

[ERROR] [05/06/2013 15:54:46.28] [GatlingSystem-akka.actor.default-dispatcher-13]
[akka://GatlingSystem/user/$c/$a] Illegal character in path at index 37: http://www-t3.nav.no/Arbeid/Utlogging fra tjenesten
java.lang.IllegalArgumentException: Illegal character in path at index 37: http://www-t3.nav.no/Arbeid/Utlogging fra tjenesten
at java.net.URI.create(URI.java:859)
at com.ning.http.client.RequestBuilderBase.buildURI(RequestBuilderBase.java:390)
at com.ning.http.client.RequestBuilderBase.setUrl(RequestBuilderBase.java:373)
at com.ning.http.client.RequestBuilder.setUrl(RequestBuilder.java:154)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor.handleFollowRedirect$1(GatlingAsyncHandlerActor.scala:178)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor.com$excilys$ebi$gatling$http$ahc$GatlingAsyncHandlerActor$$processResponse(GatlingAsyncHandlerActor.scala:210)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor$$anonfun$receive$1.apply(GatlingAsyncHandlerActor.scala:108)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor$$anonfun$receive$1.apply(GatlingAsyncHandlerActor.scala:84)
at akka.actor.Actor$class.apply(Actor.scala:318)
at com.excilys.ebi.gatling.http.ahc.GatlingAsyncHandlerActor.apply(GatlingAsyncHandlerActor.scala:70)
at akka.actor.ActorCell.invoke(ActorCell.scala:626)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197)
at akka.dispatch.Mailbox.run(Mailbox.scala:179)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516)
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259)
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479)
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: java.net.URISyntaxException: Illegal character in path at index 37: http://www-t3.nav.no/Arbeid/Utlogging fra tjenesten
at java.net.URI$Parser.fail(URI.java:2829)
at java.net.URI$Parser.checkChars(URI.java:3002)
at java.net.URI$Parser.parseHierarchical(URI.java:3086)
at java.net.URI$Parser.parse(URI.java:3034)
at java.net.URI.(URI.java:595)
at java.net.URI.create(URI.java:857)
… 17 more

kl. 15:55:23 UTC+2 mandag 6. mai 2013 skrev Stéphane Landelle følgende:

Ah, I see. That’s something I didn’t backport in Gatling 1. Will do for 1.5.1.

If your willing to migrate to 2.0.0-M2, it should work.

Sounds good!

Looks like we’re able to change the Location in the header. Any idea of when 1.5.1 will be released?

kl. 16:16:20 UTC+2 mandag 6. mai 2013 skrev Stéphane Landelle følgende:

Looks like we're able to change the Location in the header.

Great.

Any idea of when 1.5.1 will be released?

It depends on this issues that might arise in the next days. We tend to
release fixes at most every 2 weeks.

Also note that you can grab SNAPSHOTs from our CI: http://repository-gatling.forge.cloudbees.com/snapshot

A 1.5.X build is under way with the backport: https://github.com/excilys/gatling/issues/1138