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

no STDOUT/STDERR #4

Closed
onlyjob opened this issue Nov 6, 2019 · 6 comments
Closed

no STDOUT/STDERR #4

onlyjob opened this issue Nov 6, 2019 · 6 comments

Comments

@onlyjob
Copy link
Contributor

onlyjob commented Nov 6, 2019

STDOUT and STDERR are not visible in Nomad.

Something like the following config demonstrates that the output is going nowhere and no log appears in the alloc directory:

config {
    image = "docker.io/library/debian:stable"
    command = "/bin/echo"
    args = [ "4444" ]
}
@towe75
Copy link
Collaborator

towe75 commented Nov 9, 2019

Thank you for the feedback, i'll look into it.

towe75 added a commit that referenced this issue Nov 19, 2019
@towe75
Copy link
Collaborator

towe75 commented Nov 19, 2019

Check my latest commit. Now the podman log should be forwarded into the nomad logging facility. It's thus also visible in the nomad web ui and of course accessible via nomad alloc logs. Again there is a small unit test and a hint in the readme.
I did not explicitely check stderr handling but i assume that it will be included in the podman log output by default.

@onlyjob
Copy link
Contributor Author

onlyjob commented Nov 21, 2019

This is much better now and I can see STDOUT in Nomad log. Thanks.

However STDERR is not quite working as expected. Consider the following example:

command = "/bin/sh"
args = [ "-c", "hostname >&2; echo test"]

Nomad show output of both commands in Logs/stdout while Logs/stderr is empty.

The command line reproducer would be something like

podman run -t --rm docker.io/library/debian:stable /bin/sh -c "hostname >&2; echo test" 2>>/dev/null

The above command also prints the output of both commands to STDOUT because Podman apparently redirects STDERR-->STDOUT when option -t is given.

The following command (without -t) works as expected:

podman run --rm docker.io/library/debian:stable /bin/sh -c "hostname >&2; echo test" 2>>/dev/null

Therefore I suspect that driver starts Podman with equivalent of -t which mixes STDOUT and STDERR together.

@towe75
Copy link
Collaborator

towe75 commented Nov 21, 2019

Thank you for the hints, i will give it another try.

@towe75
Copy link
Collaborator

towe75 commented Nov 23, 2019

@onlyjob I'm a bit unsure about the "right" approach, so i filed a question into podmans issue tracker.

@towe75 towe75 closed this as completed Jul 7, 2020
@drewbailey
Copy link
Contributor

@towe75 I think there is mention of this in #37 but we currently don't have STDERR logging, we ultimately will likely need something like docker logger to stream logs from containers to alloc fifos

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