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

Podman 2.1.1 libpod/events endpoint returns status code 500 #8125

Closed
j2mcv opened this issue Oct 23, 2020 · 7 comments · Fixed by #8164
Closed

Podman 2.1.1 libpod/events endpoint returns status code 500 #8125

j2mcv opened this issue Oct 23, 2020 · 7 comments · Fixed by #8164
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@j2mcv
Copy link

j2mcv commented Oct 23, 2020

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

The endpoint always returns status code 500

Steps to reproduce the issue:

  1. Install podman 2.1.1

  2. curl -s --unix-socket /run/podman/podman.sock http://d/v1.12/libpod/events

Describe the results you received:

{"cause":"failed to read message field: bad message","message":"failed to read message field: bad message","response":500}

Describe the results you expected:

a string of json data describing an event

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

cockpit-podman returns that the service is not active, as reported here:
cockpit-project/cockpit-podman#546

Output of podman version:

Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.15.2
Built:        Mon Oct  5 01:25:24 2020
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.16.1
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.21-3.fc33.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.21, commit: 0f53fb68333bdead5fe4dc5175703e22cf9882ab'
  cpus: 4
  distribution:
    distribution: fedora
    version: "33"
  eventLogger: journald
  hostname: piticli.lan
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.8.15-301.fc33.x86_64
  linkmode: dynamic
  memFree: 4887814144
  memTotal: 7972184064
  ociRuntime:
    name: crun
    package: crun-0.15-5.fc33.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.15
      commit: 56ca95e61639510c7dbd39ff512f80f626404969
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  rootless: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 4155502592
  swapTotal: 4155502592
  uptime: 59h 3m 43.8s (Approximately 2.46 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 0
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 2.0.0
  Built: 1601853924
  BuiltTime: Mon Oct  5 01:25:24 2020
  GitCommit: ""
  GoVersion: go1.15.2
  OsArch: linux/amd64
  Version: 2.1.1

Package info (e.g. output of rpm -q podman or apt list podman):

podman-2.1.1-10.fc33.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes, this package is the last version available on fedora 33.

Additional environment details (AWS, VirtualBox, physical, etc.):

physical machine.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 23, 2020
@Luap99
Copy link
Member

Luap99 commented Oct 24, 2020

This is not an api problem. If you run podman events you should get the same error.

The error is unfortunately not very informative. Looking at the code there is a problem while reading the journal. Does journalctl --verify reports a corruption?

@mheon
Copy link
Member

mheon commented Oct 24, 2020

I had this problem before, and it turned out to be a spurious journal entry with the word "podman" in it that did not properly decode as JSON.

@j2mcv
Copy link
Author

j2mcv commented Oct 25, 2020

This is not an api problem. If you run podman events you should get the same error.

The error is unfortunately not very informative. Looking at the code there is a problem while reading the journal. Does journalctl --verify reports a corruption?

I had 2 corrupted files in the journal, after removing them I do not get more error responses.

Certainly the message coul be more informative.

Cheers.

@j0057
Copy link

j0057 commented Oct 27, 2020

I have the same issue, some corrupted journal files. For me, this works as a work-around: journalctl --follow --since=now --output=json PODMAN_TYPE=container.

@Luap99
Copy link
Member

Luap99 commented Oct 27, 2020

Could you try podman events --since 1s if podman events still fails?

Luap99 pushed a commit to Luap99/libpod that referenced this issue Oct 27, 2020
Fix the AddMatch/SeekTail conflict. This prevents reading
unnecessary journal entries which could cause errors.

Also wrap the sdjournal errors to provide better error messages.

Fixes containers#8125

Signed-off-by: Paul Holzinger <[email protected]>
@j0057
Copy link

j0057 commented Oct 27, 2020

With --since 1s it works with the corrupted files still present.

@Luap99
Copy link
Member

Luap99 commented Oct 27, 2020

Thanks for the confirmation. PR #8164 will fix this problem.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants