wiremock 2.5.1 response not sent on time

1,011 views
Skip to first unread message

Nabeel Ibrahim

unread,
Feb 13, 2017, 1:45:58 PM2/13/17
to wiremock-user
Hi,
Im having an issue where wiremock does not send the response on time and my app fails and my app navigates to a retry screen. upon clicking retry it resends the request and this time wiremock sends out the response. This stub is part of a scenario and the response file is about 66 kb. Not sure why this is happening. below is the command im using. Any ideas on  how I could i prevent this from happening?
java -jar wiremock-standalone-2.5.1.jar --verbose --no-request-journal

Tom Akehurst

unread,
Feb 13, 2017, 2:13:04 PM2/13/17
to wiremock-user
What is happening inside your app? Is a socket read timeout occurring?

What is the timeout value configured to?

Nabeel Ibrahim

unread,
Feb 13, 2017, 2:43:00 PM2/13/17
to wiremock-user
When I inspect the logs in XCode I get the following error when the endpoint is first accessed

Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set., NSUnderlyingError=0x6080002543d0 {Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x6000006205a0> { URL: http://localhost:8080/application/v1/config?lang=en } { status code: 500, headers {


    "Cache-Control" = "must-revalidate,no-cache,no-store";


    Connection = close;


    "Content-Length" = 448;


    "Content-Type" = "text/html; charset=ISO-8859-1";


    Server = "Jetty(9.2.z-SNAPSHOT)";


} }, NSErrorFailingURLKey=http://localhost:8080/application/v1/config?lang=en, com.alamofire.serialization.response.error.data=<3c68746d 6c3e0a3c 68656164 3e0a3c6d 65746120 68747470 2d657175 69763d22 436f6e74 656e742d 54797065 2220636f 6e74656e 743d2274 6578742f 68746d6c 3b636861 72736574 3d49534f 2d383835 392d3122 2f3e0a3c 7469746c 653e4572 726f7220 35303020 3c2f7469 746c653e 0a3c2f68 6561643e 0a3c626f 64793e0a 3c68323e 48545450 20455252 4f523a20 3530303c 2f68323e 0a3c703e 50726f62 6c656d20 61636365 7373696e 67202f61 70706c69 63617469 6f6e2f76 312f636f 6e666967 2e205265 61736f6e 3a0a3c70 72653e20 2020206a 6176612e 6c616e67 2e52756e 74696d65 45786365 7074696f 6e3a206a 6176612e 696f2e46 696c654e 6f74466f 756e6445 78636570 74696f6e 3a202f55 73657273 2f6e6162 696c2f44 6f776e6c 6f616473 2f576972 654d6f63 6b2f2e2f 5f5f6669 6c65732f 47656e65 7269632f 4e6f6e4e 6574776f 726b436f 6e666967 2e6a736f 6e20284e 6f207375 63682066 696c6520 6f722064 69726563 746f7279 293c2f70 72653e3c 2f703e0a 3c687220 2f3e3c69 3e3c736d 616c6c3e 506f7765 72656420 6279204a 65747479 3a2f2f3c 2f736d61 6c6c3e3c 2f693e0a 3c2f626f 64793e0a 3c2f6874 6d6c3e0a>, NSLocalizedDescription=Request failed: internal server error (500)}}})


but when I tap on retry in my app, it hits the endpoint and get the response as expected. Not sure why I was assuming maybe the response is not sent on time

Tom Akehurst

unread,
Feb 13, 2017, 2:45:06 PM2/13/17
to wiremock-user
Looks like WireMock is returning a 500 response. Are you sure your scenario isn't configured to send a 500 followed by a 200?

Nabeel Ibrahim

unread,
Feb 13, 2017, 2:50:51 PM2/13/17
to wiremock-user
No all my responses return status code of 200. This just started happening a day ago I did not change anything really in a day so not really sure why. One thing I tried to do is run wiremock on a different port. I tried 8088 and it was actually worse. Both times the I got the 500 error. 


On Monday, 13 February 2017 13:45:58 UTC-5, Nabeel Ibrahim wrote:

Tom Akehurst

unread,
Feb 13, 2017, 2:55:19 PM2/13/17
to wiremock-user
In that case I'd double check it's actually WireMock you're talking to.

If you're certain it is, make sure it's running with verbose logging switched on so you can see the error if it's caused by WireMock itself.

Also probably worth checking the request log to see if that provides any clue as to where the 500 is coming from. It's on http://<host>:<port>/__admin/requests

Reply all
Reply to author
Forward
0 new messages