envoyproxy / envoyproxy/nighthawk
nighthawk_client prints a stray line to stdout on the tunneling startup error path
- Dominant language
- C++
- Stars
- 414
- Forks
- 95
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 11
Description
*Title*: nighthawk_client prints a stray line to stdout on the tunneling startup error path
*Description*:
When the encapsulating Envoy fails to start (`--tunnel-uri`), `ProcessImpl` writes `error caught by envoy ...` to `std::cout` in addition to logging it (`source/client/process_impl.cc`). stdout is where `nighthawk_client` writes its formatted result, so a consumer parsing `--output-format json` sees a non-JSON line first in that error case. The message should go to the logger (stderr) only, keeping stdout reserved for the output.
*Reproduction steps*:
Run with a tunnel URI whose Envoy bootstrap fails to start, e.g. an unresolvable `--tunnel-uri`, with `--output-format json`, and capture stdout separately from stderr.
*Logs*:
```
error caught by envoy <- on stdout, before the JSON
```
*Call Stack*:
Not a crash.
Contributor guide
Research direction
Start in source/client/process_impl.cc, where the tunneling startup exception reports "error caught by envoy". Reproduce with an unresolvable --tunnel-uri and --output-format json while capturing stdout and stderr separately. Done means the error is logged to stderr only and stdout contains the formatted result without a stray line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100