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

docker info emits data to both stderr and stdout #31708

Closed
hholst80 opened this issue Mar 9, 2017 · 6 comments
Closed

docker info emits data to both stderr and stdout #31708

hholst80 opened this issue Mar 9, 2017 · 6 comments

Comments

@hholst80
Copy link

hholst80 commented Mar 9, 2017

docker info emits information on two channels, where essential information can be lost when piping through less or more.

Steps to reproduce the issue:

  1. docker info 1> stdout 2> stderr

Describe the results you received:

stderr contains

 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.

Describe the results you expected:

I think it would be better if all information is kept together in one file. Splitting things up into two files makes it hard to use the pattern docker info | less as warnings would get discarded.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      1.12.5
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   7392c3b
 Built:        Fri Dec 16 02:23:59 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.5
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   7392c3b
 Built:        Fri Dec 16 02:23:59 2016
 OS/Arch:      linux/amd64
@hholst80
Copy link
Author

hholst80 commented Mar 9, 2017

The warning is not really an error either - I think the intention is to give friendly help to the user not that the command docker info failed in some way.

@cpuguy83
Copy link
Member

cpuguy83 commented Mar 9, 2017

I'm not sure I agree with this.
The output on stdout is structured data, the output on stderr does not match the structure and is additive.

It also means for things like docker info > blah, the user will still see the warning, which is the intent.
Likewise for the less case, the user will see the warning once less is exited.

@hholst80
Copy link
Author

With the same logic: If the user docker info > blah and then just looks at blah the warning will be lost. I think it is unexpected that some information is emitted to another stream. If docker info fails in itself to generate the requested information it should emit to stderr, not otherwise. Like this:

$ docker info > info.txt
warning: could not read /path/to/some/file - some information might be missing!

@hholst80
Copy link
Author

This bug is turning 2 years old soon. Should we buy it a present?

@cpuguy83
Copy link
Member

I think this is working as expected still.

@thaJeztah ?

@thaJeztah
Copy link
Member

Let me close this ticket for now, as it looks like it went stale.

@thaJeztah thaJeztah closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants