HTTP doesn't wait until request completion and returns "500 Internal Server Error"

May 11, 2015 at 11:53 PM
I'm submitting POST request to the REST server in the following form:
return client.request( methods::POST, builder.to_string(), argument ).then( []( http_response response ) -> pplx::task < json::value >
            {
                if( response.status_code() == status_codes::OK || response.status_code() == status_codes::Accepted )
//extract/parse JSON
and then wait() for the task to complete...

The results come back in a JSON after computations are done on the server. For relatively quick submissions (up to ~10 seconds), everything works perfectly. However, for longer submissions (>~15 seconds), it doesn't wait long enough and returns response with "500 Internal Server Error".. However, I can see that the server is running normally and completes with no errors, it just takes a bit longer. I've also tried the same request with cURL and it completes with no issues.

I thought that this may be a timeout issue but default value is http_config is 30 seconds, which is definitely more than it takes for the request to be completed.

I'd appreciate any advice on this issue!
May 11, 2015 at 11:57 PM

Hi olegshirokikh,

Is this a public server that I can access? To help further investigate, what version of the C++ REST SDK are you using and what platform and compiler version?

Thanks,

Steve

May 12, 2015 at 12:16 AM
Edited May 12, 2015 at 12:19 AM
Hi stevegates,

Thanks a lot for such a quick response! I'm using Casablanca 2.5 on Windows 8.1, Visual Studio 2013 Update 4 - I've manually built static libraries. It's "kind of" private REST server (currently in development) which is build with Spray.io and runs on Linux and is supposed to communicate with a Big Data cluster, which in turn runs on AWS Linux instances... Does this help at all to get any insight? If not, then I could think how to open up an access so you can take a look at the issue since it's pretty "scary" issue given the commitment to Casablanca and existing code written with Casablanca - if that's the case, would you need to submit actual full HTTP request to reproduce the issue or there are some other ways how this can be investigated?

Really appreciate your assistance.
Oleg
May 12, 2015 at 8:21 PM

Hi Oleg,

We don’t officially support static linking right now on Windows. Are you able to reproduce the problem using dynamic linking?

Thanks,

Steve