Bug 1873204

Summary: podman run --log-driver journald didn't works as expected
Product: Red Hat Enterprise Linux 8 Reporter: Joy Pu <ypu>
Component: podmanAssignee: Jindrich Novy <jnovy>
Status: CLOSED ERRATA QA Contact: Alex Jia <ajia>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: bbaude, dwalsh, fsayyed, jligon, jnovy, kanderso, lsm5, mheon, tsweeney
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: podman-2.1.1-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-16 14:21:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joy Pu 2020-08-27 15:38:13 UTC
Description of problem:
podman run --log-driver journald didn't work as expect. When set log driver to journald, podman logs can not read logs from journald as expect.

Version-Release number of selected component (if applicable):
podman-2.0.4-3.module+el8.3.0+7716+ce654703.x86_64

How reproducible:


Steps to Reproduce:
1. start a container with --log-driver journald
# podman run --log-driver journald --name test-journald ubi8 echo x3issjHHMm4yiacrJDWZfN82hatJFo
x3issjHHMm4yiacrJDWZfN82hatJFo
2. Check if it logs the output into journald
# journalctl | grep x3issjHHMm4yiacrJDWZfN82hatJFo
Aug 27 11:22:35 hpe-dl380pgen8-02-vm-9.hpe2.lab.eng.bos.redhat.com conmon[166134]: x3issjHHMm4yiacrJDWZfN82hatJFo
3. Use podman logs to check if we can get the logs from journald
# podman  logs test-journald

Actual results:
podman logs return nothing

Expected results:
podman logs should can get the string echo from run

Additional info:

Comment 1 Tom Sweeney 2020-08-27 15:58:35 UTC
Ashley, I suspect this is fixed upstream.  Can you verify please, and if not, dig in?

Comment 2 Ashley Cui 2020-08-27 16:36:22 UTC
nope, looks broken, ill start digging soon

```
[acui@localhost podman]$ ./bin/podman run --log-driver journald --name test-journald ubi8 echo x3issjHHMm4yiacrJDWZfN82hatJFo
x3issjHHMm4yiacrJDWZfN82hatJFo
[acui@localhost podman]$ journalctl | grep x3issjHHMm4yiacrJDWZfN82hatJFo
Aug 27 12:34:48 localhost.localdomain conmon[146551]: x3issjHHMm4yiacrJDWZfN82hatJFo
[acui@localhost podman]$ ./bin/podman  logs test-journald
```

Comment 3 Tom Sweeney 2020-08-27 19:29:32 UTC
Just noting that an issue with the same footprint was also logged against upstream: https://github.com/containers/podman/issues/7476

Comment 4 Tom Sweeney 2020-08-27 19:38:08 UTC
*** Bug 1873228 has been marked as a duplicate of this bug. ***

Comment 6 Ashley Cui 2020-10-02 15:07:47 UTC
PR here: https://github.com/containers/podman/pull/7893

Comment 15 Alex Jia 2020-11-10 14:15:39 UTC
Verified on podman-2.1.1-3.module+el8.3.1+8686+2a59bca3.x86_64 w/ crun-0.15.1-1.module+el8.3.1+8686+2a59bca3.x86_64
and runc-1.0.0-68.rc92.module+el8.3.1+8686+2a59bca3.x86_64.

[root@ibm-x3650m4-01-vm-15 ~]# podman run --log-driver journald --name test-journald ubi8 echo x3issjHHMm4yiacrJDWZfN82hatJFo
Trying to pull registry.access.redhat.com/ubi8...
Getting image source signatures
Copying blob 6500ac87b29f done
Copying blob 1b8dabac56ed done
Copying config 33df2983b0 done
Writing manifest to image destination
Storing signatures
x3issjHHMm4yiacrJDWZfN82hatJFo
[root@ibm-x3650m4-01-vm-15 ~]# journalctl | grep x3issjHHMm4yiacrJDWZfN82hatJFo
Nov 10 09:10:38 ibm-x3650m4-01-vm-15.ibm2.lab.eng.bos.redhat.com conmon[2274]: x3issjHHMm4yiacrJDWZfN82hatJFo
[root@ibm-x3650m4-01-vm-15 ~]# podman  logs test-journald
x3issjHHMm4yiacrJDWZfN82hatJFo

[root@ibm-x3650m4-01-vm-15 ~]# podman info|grep -iA2 runtime
  ociRuntime:
    name: crun
    package: crun-0.15.1-1.module+el8.3.1+8686+2a59bca3.x86_64

[root@ibm-x3650m4-01-vm-15 ~]# podman run --runtime=/usr/bin/runc --log-driver journald --name test-journald-runc ubi8 echo helloissjHHMm4yiacrJDWZfN82hatJFo
helloissjHHMm4yiacrJDWZfN82hatJFo
[root@ibm-x3650m4-01-vm-15 ~]# journalctl | grep helloissjHHMm4yiacrJDWZfN82hatJFo
Nov 10 09:13:17 ibm-x3650m4-01-vm-15.ibm2.lab.eng.bos.redhat.com conmon[2598]: helloissjHHMm4yiacrJDWZfN82hatJFo
[root@ibm-x3650m4-01-vm-15 ~]# podman logs test-journald-runc
helloissjHHMm4yiacrJDWZfN82hatJFo

Comment 17 errata-xmlrpc 2021-02-16 14:21:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:0531