You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please fill out the issue checklist below and provide ALL the requested information.
I reviewed open and closed github issues that may be related to my problem.
I tried updating to the latest version of the CF CLI to see if it fixed my problem.
I attempted to run the command with CF_TRACE=1 to help debug the issue.
I am reporting a bug that others will be able to reproduce.
Describe the bug and the command you saw an issue with
In cloudfoundry/cloud_controller_ng#2227 we decided to set the X-Cf-Warnings header when one of the services backing the /v3/processes/:guid/stats endpoint has an error and we decide to return a partial response.
This is nice because the user will still get informed that something is not quite right by the cf cli, but otherwise continue to see other information about their process. Using the cf7 CLI it looks like this warning is usually printed to stderr, but for cf curl it is being printed to stdout and making the response difficult to parse.
What happened
When I use cf curl to hit an endpoint that sets the X-Cf-Warnings header the warning is printed to stdout and makes the output no longer JSON parseable. Example:
Expected behavior
The X-Cf-Warnings header would either be printed to stderr or ignored and only displayed if the user requests it via the -i (Include response headers in the output) flag.
Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:
Push an app
bosh ssh doppler
sudo su -
monit stop log-cache
cf curl /v3/apps/$(cf app MY_APP --guid)/processes to get the web process guid for the app
- Since the `/v3/processes/:guid/stats endpoint now may set an
`X-Cf-Warnings` header (see
cloudfoundry/cloud_controller_ng#2227), the
CLI may return the contents of this header along with the endpoint's
regular JSON response which causes parsing errors in the BARAs
- Logged cloudfoundry/cli#2164 with the CLI to
make it so that header isn't printed to `stdout` for this command, but
until then we can just switch to use a regular http client to fetch this
endpoint
[#177518468](https://www.pivotaltracker.com/story/show/177518468)
Authored-by: Tim Downey <[email protected]>
Please fill out the issue checklist below and provide ALL the requested information.
CF_TRACE=1
to help debug the issue.Describe the bug and the command you saw an issue with
In cloudfoundry/cloud_controller_ng#2227 we decided to set the
X-Cf-Warnings
header when one of the services backing the/v3/processes/:guid/stats
endpoint has an error and we decide to return a partial response.This is nice because the user will still get informed that something is not quite right by the
cf cli
, but otherwise continue to see other information about their process. Using thecf7
CLI it looks like this warning is usually printed tostderr
, but forcf curl
it is being printed tostdout
and making the response difficult to parse.What happened
When I use
cf curl
to hit an endpoint that sets theX-Cf-Warnings
header the warning is printed tostdout
and makes the output no longer JSON parseable. Example:Expected behavior
The
X-Cf-Warnings
header would either be printed tostderr
or ignored and only displayed if the user requests it via the-i
(Include response headers in the output) flag.Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:
bosh ssh doppler
sudo su -
monit stop log-cache
cf curl /v3/apps/$(cf app MY_APP --guid)/processes
to get theweb
process guid for the appcf curl /v3/processes/:guid/stats
Provide more context
cf version 7.2.0+be4a5ce2b.2020-12-10
Related Issues and PRs
The text was updated successfully, but these errors were encountered: