containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.24k stars 2.37k forks source link

MongoDB exits after about 3 minutes it has started #23543

Closed matteo-gambarutti closed 1 month ago

matteo-gambarutti commented 1 month ago

Issue Description

I'm running MongoDB as a podman container and it exists about 3 minutes after it has started

Steps to reproduce the issue

Steps to reproduce the issue

  1. Run MongoDB as a container (tried versions 4.4.25 and 7.0.12)
  2. Wait couple of minutes
  3. Inspect the logs and systemd shows that the container has been restarted

Describe the results you received

I can see this as last line in the logs (before the the container gets restarted): conmon cc85f5451522c54da6b2 <nwarn>: Failed to open cgroups file: /sys/fs/cgroup/user.slice/user-1002.slice/user@1002.service/app.slice/unifi_mongodb.service/libpod-payload-cc85f5451522c54da6b2b0c9971d99f13f706814c1e2ef4abb8aa5d6c013816f/memory.events

Describe the results you expected

MongoDB to run without being restarted

podman info output

podman@host:~> podman info
host:
  arch: amd64
  buildahVersion: 1.36.0
  cgroupControllers:
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.12-1.1.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: unknown'
  cpuUtilization:
    idlePercent: 96.51
    systemPercent: 1.28
    userPercent: 2.21
  cpus: 12
  databaseBackend: sqlite
  distribution:
    distribution: opensuse-tumbleweed
    version: "20240731"
  eventLogger: journald
  freeLocks: 2036
  hostname: homeserver-tst
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1002
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1002
      size: 1
    - container_id: 1
      host_id: 165536
      size: 65536
  kernel: 6.10.2-1-default
  linkmode: dynamic
  logDriver: journald
  memFree: 190427136
  memTotal: 4099280896
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.11.0-2.1.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.11.0
    package: netavark-1.11.0-1.1.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.11.0
  ociRuntime:
    name: crun
    package: crun-1.15-1.1.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.15
      commit: e6eacaf4034e84185fd8780ac9262bbf57082278
      rundir: /run/user/1002/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-20240624.1ee2eca-2.1.x86_64
    version: |
      pasta 20240624.1ee2eca-2.1
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: false
    path: /run/user/1002/podman/podman.sock
  rootlessNetworkCmd: pasta
  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: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 0
  swapTotal: 0
  uptime: 1h 3m 51.00s (Approximately 0.04 days)
  variant: ""
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/podman/.config/containers/storage.conf
  containerStore:
    number: 11
    paused: 0
    running: 11
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/podman/.local/share/containers/storage
  graphRootAllocated: 68181536768
  graphRootUsed: 6939168768
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 11
  runRoot: /run/user/1002/containers
  transientStore: false
  volumePath: /home/podman/.local/share/containers/storage/volumes
version:
  APIVersion: 5.1.2
  Built: 1720683261
  BuiltTime: Thu Jul 11 09:34:21 2024
  GitCommit: ""
  GoVersion: go1.21.12
  Os: linux
  OsArch: linux/amd64
  Version: 5.1.2

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

openSUSE Tumbleweed, SELinux in enforcing mode

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

matteo-gambarutti commented 1 month ago

It turned out to be an issue with a specific virtual machine when forcing AVX on a specific CPU virtualization. Nothing wrong with podman and/or the mongo image.