Bug 1212720 - podman logs -f fails with Error: using --follow with the journald --log-driver but without the journald --events-backend (file) is not supported
Summary: podman logs -f fails with Error: using --follow with the journald --log-drive...
Status: CONFIRMED
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Other (show other bugs)
Version: Leap 15.4
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Dan Čermák
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on: 1199871
Blocks:
  Show dependency treegraph
 
Reported: 2023-06-26 10:01 UTC by sesso
Modified: 2024-07-18 12:02 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sesso 2023-06-26 10:01:00 UTC
Hi, this bug report has been sent here as recommended by the podman developers after the bug report I made on GitHub was closed because they believe this is an opensuse issue. https://github.com/containers/podman/issues/18987


Below you can find the report again:

Issue Description

I get the error Error: using --follow with the journald --log-driver but without the journald --events-backend (file) is not supported when doing podman logs -f {containedid}

Steps to reproduce the issue

Steps to reproduce the issue

Install opensuse leap 15.4
Install podman
Run a container
Try to get the logs via podman logs -f {containedid}
Describe the results you received

Error: using --follow with the journald --log-driver but without the journald --events-backend (file) is not supported

Describe the results you expected

The logs

podman info output

host:
  arch: amd64
  buildahVersion: 1.29.0
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.5-150400.3.8.1.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.5, commit: unknown'
  cpuUtilization:
    idlePercent: 67.37
    systemPercent: 2.55
    userPercent: 30.07
  cpus: 2
  distribution:
    distribution: '"opensuse-leap"'
    version: "15.4"
  eventLogger: file
  hostname: nine-eleven
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 100
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.14.21-150400.24.63-default
  linkmode: dynamic
  logDriver: journald
  memFree: 123572224
  memTotal: 2480283648
  networkBackend: cni
  ociRuntime:
    name: runc
    package: runc-1.1.5-150000.43.1.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.1.5
      commit: v1.1.5-0-gf19387a6bec4
      spec: 1.0.2-dev
      go: go1.19.9
      libseccomp: 2.5.3
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /etc/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-150300.8.5.2.x86_64
    version: |-
      slirp4netns version 1.2.0
      commit: unknown
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 5
      libseccomp: 2.5.3
  swapFree: 1268625408
  swapTotal: 1341104128
  uptime: 0h 44m 22.00s
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.opensuse.org
  - registry.suse.com
  - docker.io
store:
  configFile: /home/fuomag9/.config/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 1
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/fuomag9/.local/share/containers/storage
  graphRootAllocated: 19595788288
  graphRootUsed: 4189528064
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 1
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/fuomag9/.local/share/containers/storage/volumes
version:
  APIVersion: 4.4.4
  Built: 1680004800
  BuiltTime: Tue Mar 28 14:00:00 2023
  GitCommit: ""
  GoVersion: go1.18.10
  Os: linux
  OsArch: linux/amd64
  Version: 4.4.4
Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

No response

Additional information

No response
Comment 1 Alexandre Vicenzi 2024-06-20 13:13:29 UTC
This is still reproducible and depends on Bug 1199871.
Comment 2 Alexandre Vicenzi 2024-07-18 09:24:01 UTC
The --follow option works on Tumbleweed and Leap 15.6 if you use the file log driver, which is the default driver for rootless Podman.

The command `podman logs -f {containedid}` used to not work in 15.4 because the default log driver was journald. This issue was fixed by https://build.opensuse.org/request/show/1167004 and the now command works in 15.6. The SR changed the default log_drive from journald to unset.

-log_driver = "journald"
+#log_driver = "k8s-file"

The journald log driver does not work with rootless Podman in openSUSE as journald does not allow non-root users to read its logs. This is currently a design decision.

An up-to-date system should not have this issue, and if you still face this issue on an older system you can for example create a user config in ~/.config/containers/containers.conf or system-wide /usr/share/containers/containers.conf:

[containers]
log_driver = "k8s-file"
[engine]
events_logger = "file"

For journald log driver, you need to run Podman in rootful mode, not in rootless.