Strange problem during testing: "curl: (52) Empty reply from server"

2,813 views
Skip to first unread message

Chris Cooper

unread,
Oct 31, 2012, 5:54:46 AM10/31/12
to dropwiz...@googlegroups.com
This isn't really a DW problem, but I'm hoping one of you guys may have come accross this problem and know of a solution.

I'm running DW on an Amazon Linux instance, and I'm finding during testing that using curl from the Bash shell to POST a request times out almost immediately if the request takes some time to come back.

I have modified my resource to do nothing, and its response comes back fine, but as soon as the resource takes more than a second or two to respond then I get the curl (52) error message.

Here's a run so you can see what I mean:

[Wed 31/Oct 08:34:09 chris@DEV]$ curl -v -v -v --keepalive-time 10 -i -H 'Content-Type: application/json' -X POST -d @requests/broadcastDraft.json http://localhost:9090/draft/D1/broadcast
* About to connect() to localhost port 9090 (#0)
*   Trying 127.0.0.1...
Warning: Keep-alive functionality somewhat crippled due to missing support in
Warning: your operating system!
* connected
* Connected to localhost (127.0.0.1) port 9090 (#0)
> POST /draft/D1/broadcast HTTP/1.1
> User-Agent: curl/7.24.0 (i386-redhat-linux-gnu) libcurl/7.24.0 NSS/3.13.5.0 zlib/1.2.5 libidn/1.18 libssh2/1.2.2
> Host: localhost:9090
> Accept: */*
> Content-Type: application/json
> Content-Length: 377
>
* upload completely sent off: 377 out of 377 bytes
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
* Closing connection #0



A similar run with the delaying code commented out:

[Wed 31/Oct 09:39:26 chris@DEV]$ curl -v -v -v --keepalive-time 10 -i -H 'Content-Type: application/json' -X POST -d @requests/broadcastDraft.json http://localhost:9090/draft/D1/broadcast
* About to connect() to localhost port 9090 (#0)
*   Trying 127.0.0.1...
Warning: Keep-alive functionality somewhat crippled due to missing support in
Warning: your operating system!
* connected
* Connected to localhost (127.0.0.1) port 9090 (#0)
> POST /draft/D1/broadcast HTTP/1.1
> User-Agent: curl/7.24.0 (i386-redhat-linux-gnu) libcurl/7.24.0 NSS/3.13.5.0 zlib/1.2.5 libidn/1.18 libssh2/1.2.2
> Host: localhost:9090
> Accept: */*
> Content-Type: application/json
> Content-Length: 377
>
* upload completely sent off: 377 out of 377 bytes
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Date: Wed, 31 Oct 2012 09:39:27 GMT
Date: Wed, 31 Oct 2012 09:39:27 GMT
< Content-Type: application/json
Content-Type: application/json
< Content-Length: 82
Content-Length: 82

<
* Connection #0 to host localhost left intact
{"ok":true,"message":"OK","errorMessage":null,"idType":"BroadcastId","id":"B1"}* 
Closing connection #0



I can see the keep-alive warning in there, does anyone know how to not cripple this option on an Amazon Linux box?

The keep-alive switch was the last in several settings I tried adding (max-time & connect-timeout (I was clutching at straws)), but none seem to make any difference.

As far as I can tell from the DW logs everything is going well at the DW end, but it is curl that is crapping out during the test.

Anyone have any ideas?

BmRb

unread,
Aug 7, 2013, 8:18:13 PM8/7/13
to dropwiz...@googlegroups.com
Hi, 

Have you solved this problem? I am having the exact same issue here.

Thanks.

Matt Brown

unread,
Aug 8, 2013, 4:31:36 PM8/8/13
to dropwiz...@googlegroups.com
I would try a tcpdump to see exactly what is happening between curl's request and what the service is sending back.

Felix Gao

unread,
Sep 14, 2013, 8:45:39 PM9/14/13
to dropwiz...@googlegroups.com
I am currently facing the same problem with my get request that fork a new thread that does http request to an external source.  If you have solved this maybe it can help me. 


On Wednesday, October 31, 2012 2:54:46 AM UTC-7, Chris Cooper wrote:

Ryan Kennedy

unread,
Sep 14, 2013, 8:48:12 PM9/14/13
to dropwiz...@googlegroups.com

Have you tried increasing the curl timeout? There is a command line parameter to do that. Set it a really high and see if that fixes the problem.

Ryan

Reply all
Reply to author
Forward
0 new messages