Bug 1895105

Summary: Podman events nonfunctional as rootless
Product: Red Hat Enterprise Linux 8 Reporter: Matthew Heon <mheon>
Component: skopeoAssignee: Tom Sweeney <tsweeney>
Status: CLOSED ERRATA QA Contact: Yuhui Jiang <yujiang>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.3CC: bbaude, dwalsh, jligon, jnovy, kanderso, lsm5, mheon, pthomas, santiago, tsweeney, umohnani, ypu
Target Milestone: rc   
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: skopeo-1.2.0-4.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-16 14:21:54 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 Matthew Heon 2020-11-05 18:40:17 UTC
Description of problem:

All Podman events functionality is nonfunctional using the default configuration as shipped in RHEL 8.3.1

Version-Release number of selected component (if applicable):

Podman v2.1.1 as will be shipped in RHEL 8.3.1

How reproducible:

100%

Steps to Reproduce:
0. Ensure you are logged in as a non-root user who is *not* part of the wheel group.
1. `podman run -t -i --name test fedora ls` in one terminal
2. `podman rm --force test` in a second terminal

(The `podman events` command is another good example)

Actual results:

The command returns an error that we were unable to retrieve the error code

Expected results:

Command succeeds and correctly returns error code

Additional info:

The default for events prior to v2.1.1 was `file`, which does not have this issue. In v2.1.1, we swapped the default to `journald` backend to resolve some issues with the `file` backend (it could fill up `/run` on systems generating a lot of events). Unfortunately, on RHEL 8.x, it appears that non-root users that are not in the wheel group cannot access the journal; this was not caught elsewhere because other distributions ship a more modern systemd that does not have this issue.

We have contacted the systemd team and are inquiring about further details, but any potential backports and fixes there can wait until 8.4.0. For now, we can swap the default back in Podman via a configuration file change to resolve the issue.

Comment 5 Ed Santiago 2020-11-09 15:09:19 UTC
Simplest reproducer I can find:

    $ podman run --name foo --log-driver journald alpine echo hi
    hi
    $ podman logs foo
    [there is no output. Expected: "hi"]

AFAICT it does not matter what groups the user is in: neither wheel nor systemd-journal make any difference, there is never any output from `podman logs`. In fact, there isn't even any output when running `podman run` + `podman logs` as root. Am I responding to the wrong issue?

Comment 6 Ed Santiago 2020-11-09 15:18:27 UTC
Followup: I was testing the wrong podman. With podman-2.1.1-3.module+el8.3.1+8686+2a59bca3.x86_64:

   testuser in group adm, wheel, or systemd-journal group : 'podman logs' emits 'hi' as expected
   testuser NOT in any of the above groups                : 'podman logs' emits nothing

Comment 13 errata-xmlrpc 2021-02-16 14:21:54 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