-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[v.0.8.5] consul monitor breaks on HTTP response in healthcheck output #3253
Comments
Hi @ashald thanks for opening an issue. I wasn't able to reproduce this with other endpoints that produce HTTP response using |
In fact, this is very easy to reproduce with Consul itself. Here is minimal config I used: {
"service": {
"checks": [
{
"interval": "3s",
"name": "my-service",
"script": "curl -fisS http://localhost:8500",
"timeout": "1s"
}
],
"name": "my-service",
"port": 8500
}
} and started consul using: $ consul agent -dev -config-dir . -data-dir data Once we have it running now we just start monitoring with debug log level: $ consul monitor -log-level=debug
2017/08/08 21:18:46 [DEBUG] Using random ID "58c772ea-79d6-7a2b-e70e-10a1e24ec571" as node ID
2017/08/08 21:18:46 [INFO] raft: Initial configuration (index=1): [{Suffrage:Voter ID:127.0.0.1:8300 Address:127.0.0.1:8300}]
2017/08/08 21:18:46 [INFO] raft: Node at 127.0.0.1:8300 [Follower] entering Follower state (Leader: "")
2017/08/08 21:18:46 [INFO] serf: EventMemberJoin: iebdev13 127.0.0.1
2017/08/08 21:18:46 [INFO] consul: Adding LAN server iebdev13 (Addr: tcp/127.0.0.1:8300) (DC: dc1)
2017/08/08 21:18:46 [INFO] serf: EventMemberJoin: iebdev13.dc1 127.0.0.1
2017/08/08 21:18:46 [DEBUG] agent: pausing 2.052145682s before first invocation of curl -fisS http://localhost:8500
2017/08/08 21:18:46 [INFO] agent: Started DNS server 127.0.0.1:8600 (udp)
2017/08/08 21:18:46 [INFO] agent: Started DNS server 127.0.0.1:8600 (tcp)
2017/08/08 21:18:46 [INFO] consul: Handled member-join event for server "iebdev13.dc1" in area "wan"
2017/08/08 21:18:46 [INFO] agent: Started HTTP server on 127.0.0.1:8500
2017/08/08 21:18:46 [WARN] raft: Heartbeat timeout from "" reached, starting election
2017/08/08 21:18:46 [INFO] raft: Node at 127.0.0.1:8300 [Candidate] entering Candidate state in term 2
2017/08/08 21:18:46 [DEBUG] raft: Votes needed: 1
2017/08/08 21:18:46 [DEBUG] raft: Vote granted from 127.0.0.1:8300 in term 2. Tally: 1
2017/08/08 21:18:46 [INFO] raft: Election won. Tally: 1
2017/08/08 21:18:46 [INFO] raft: Node at 127.0.0.1:8300 [Leader] entering Leader state
2017/08/08 21:18:46 [INFO] consul: cluster leadership acquired
2017/08/08 21:18:46 [INFO] consul: New leader elected: iebdev13
2017/08/08 21:18:46 [DEBUG] consul: reset tombstone GC to index 3
2017/08/08 21:18:46 [INFO] consul: member 'iebdev13' joined, marking health alive
2017/08/08 21:18:46 [INFO] agent: Synced service 'consul'
2017/08/08 21:18:46 [INFO] agent: Synced service 'my-service'
2017/08/08 21:18:46 [DEBUG] agent: Check 'service:my-service' in sync
2017/08/08 21:18:46 [DEBUG] agent: Node info in sync
2017/08/08 21:18:48 [DEBUG] agent: Check 'service:my-service' script 'curl -fisS http://localhost:8500' output: HTTP/1.1 200 OK
Date: Tue, 08 Aug 2017 21:18:48 GMT
Content-Length: 12
Content-Type: text/plain; charset=utf-8
Remote side ended the monitor! This usually means that the
remote side has exited or crashed. |
Thanks! |
consul version
for both Client and ServerClient:
0.8.5
Server:
0.8.5
Reproduction steps & Description of the Issue (and unexpected/desired result)
curl
based HTTP health-check crashesconsul monitor -lo-level=debug
:Presumably, writing logged HTTP response to the log stream forces client to close the stream. I.e., log output is not escaped.
Check definition:
Yes, we do know that curl-based checks should be avoided in favor of native http checks but this is what we've got after updating from the 0.7.4 to the 0.8.5 (since the former one didn't support headers and Host header support seem to be broken until 0.9).
Please let me know whether I provided enough details.
The text was updated successfully, but these errors were encountered: