Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SETHOOK is not doing POST - Client.Timeout exceeded while awaiting headers #208

Closed
karnivas opened this issue Aug 3, 2017 · 4 comments
Closed

Comments

@karnivas
Copy link

karnivas commented Aug 3, 2017

I'm a newbie and exploring tile38.
Did a new build on tile38-1.9.0.tar.gz with dependency go1.8.3.linux-amd64.tar.gz on RHEL 6.4 x86_64

I face an issue after doing a SETHOOK. Let me know what is missed here and suggest to overcome this issue. Any help is much appreciated.

Below one works fine whenever I update the object (eg: fleet), as it is doing a POST to the same server using
Console1

./tile38-server --webhook-http-consumer-port 7070

Console2

127.0.0.1:9851> SETHOOK warehouse http://localhost:9999/mock NEARBY fleet FENCE POINT 33.5123 -112.2693 500
{"ok":true,"elapsed":"94.829µs"}
127.0.0.1:9851> SET fleet truck1 POINT 33.5123 -112.2694
{"ok":true,"elapsed":"38.474µs"}

But, if the same is done as below it doesn't POST and throws the error

127.0.0.1:9851> SETHOOK warehouse http://httpbin.org/post NEARBY fleet FENCE POINT 33.5123 -112.2693 500
{"ok":true,"elapsed":"125.639µs"}
127.0.0.1:9851> SET fleet truck1 POINT 33.5123 -112.269
{"ok":true,"elapsed":"39.889µs"}

Error
> 2017/08/03 11:39:45 [DEBU] queued hook: 98
2017/08/03 11:39:50 [DEBU] Endpoint connect/send error: 98: http://httpbin.org/post: Post http://httpbin.org/post: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2017/08/03 11:39:55 [DEBU] Endpoint connect/send error: 98: http://httpbin.org/post: Post http://httpbin.org/post: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

However using CURL the endpoint is accessible and able to get 200 OK.

[root@server5 tile38-1.9.0]# curl -i -X POST -d '{"requestbody": "Hello World"}' 'http://httpbin.org/post'
HTTP/1.1 200 OK
Server: meinheld/0.6.1
Date: Thu, 03 Aug 2017 06:32:57 GMT
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
X-Powered-By: Flask
X-Processed-Time: 0.00150895118713
Content-Length: 553
Via: 1.1 vegur
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
{
"args": {},
"data": "",
"files": {},
"form": {
"{"requestbody": "Hello World"}": ""
},
"headers": {
"Accept": "/",
"Connection": "close",
"Content-Length": "30",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "httpbin.org",
"User-Agent": "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.18 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2",
"X-Bluecoat-Via": "981d4b96a6c4133e"
},
"json": null,
"origin": "15.219.201.82",
"url": "http://httpbin.org/post"
}

tidwall added a commit that referenced this issue Aug 3, 2017
@tidwall
Copy link
Owner

tidwall commented Aug 3, 2017

Hi karnivas,

It seems to be sending from my side. Here's the my console log:

2017/08/03 03:01:04 [INFO] Server started, Tile38 version 1.9.0, git 1ccaf71
2017/08/03 03:01:04 [INFO] AOF loaded 2 commands: 0.00s, 18952/s, 2 MB/s
2017/08/03 03:01:04 [INFO] The server is now ready to accept connections on port 9851
2017/08/03 03:01:20 [DEBU] opened connection: 127.0.0.1:60499
2017/08/03 03:01:20 [DEBU] queued hook: 3
2017/08/03 03:01:20 [DEBU] Endpoint send ok: 3: http://localhost:9999/mock: <nil>
2017/08/03 03:01:27 [DEBU] queued hook: 4
2017/08/03 03:01:27 [DEBU] Endpoint send ok: 4: http://httpbin.org/post: <nil>

The Endpoint send ok messages are brand new. I just added the an extra debug trace to the master branch that prints a line to the console when the POST succeeds. To see from your side, you'll need pull the latest changes from this repo and make.

I'm wondering if the connection to the httpbin.org service may have been interrupted for a moment.

@karnivas
Copy link
Author

karnivas commented Aug 9, 2017

Had some firewall issues. Resolved by testing in another machine. Thanks for your time. Closing the issue.

@karnivas karnivas closed this as completed Aug 9, 2017
@tidwall
Copy link
Owner

tidwall commented Aug 9, 2017

No problem. Let me know if anything else pops up.

@hmarcelodn
Copy link

hmarcelodn commented Sep 1, 2018

Are those errors in hooks closing your redis connections by the way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants