Skip to content

Incorrect duration status in podman ps #26192

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

Open
Ep0chalypse opened this issue May 23, 2025 · 3 comments
Open

Incorrect duration status in podman ps #26192

Ep0chalypse opened this issue May 23, 2025 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triaged Issue has been triaged

Comments

@Ep0chalypse
Copy link

Issue Description

Hi all, when I run podman ps it shows an incorrect uptime under 'status'. For example it's showing 'Up 2 months' but the system has only been running for 16 hours and this entire system was only installed 1 month ago with a clean install.

I'm running this all on Almalinux 9 on a Raspberry pi 5 8bg

podman ps
CONTAINER ID  IMAGE                                        COMMAND               CREATED       STATUS       PORTS                                                                                                                                                                         NAMES
af3525776677  docker.io/timescale/timescaledb-ha:pg17      postgres              2 months ago  Up 2 months  0.0.0.0:5432->5432/tcp, 8008/tcp, 8081/tcp                                                                                                                                    timescaledb
cat /etc/os-release
NAME="AlmaLinux"
VERSION="9.6 (Sage Margay)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.6"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.6 (Sage Margay)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.6"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.6"
SUPPORT_END=2032-06-01
podman version
Client:       Podman Engine
Version:      5.4.0
API Version:  5.4.0
Go Version:   go1.23.6 (Red Hat 1.23.6-2.el9_6)
Built:        Tue May 13 16:18:56 2025
OS/Arch:      linux/arm64
uptime
 16:37:49 up 20:02,  1 user,  load average: 0.14, 0.10, 0.09
rpm -qi basesystem|grep Install
Install Date: Mon Apr 14 20:55:37 2025

Steps to reproduce the issue

Steps to reproduce the issue

  1. Install Almalinux 9 and podman
  2. Run container
  3. run podman ps

Describe the results you received

Incorrect uptime

Describe the results you expected

Correct uptime

podman info output

host:                                                                                                                                                                     arch: arm64                                                                                                                                                             buildahVersion: 1.39.4                                                                                                                                                  cgroupControllers:                                                                                                                                                      - pids                                                                                                                                                                  cgroupManager: systemd                                                                                                                                                  cgroupVersion: v2                                                                                                                                                       conmon:                                                                                                                                                                   package: conmon-2.1.12-1.el9.aarch64                                                                                                                                    path: /usr/bin/conmon                                                                                                                                                   version: 'conmon version 2.1.12, commit: 14d5d44d7845e0ec00e607c1a80a2c6b9b33784e'                                                                                    cpuUtilization:                                                                                                                                                           idlePercent: 99.53                                                                                                                                                      systemPercent: 0.3                                                                                                                                                      userPercent: 0.16                                                                                                                                                     cpus: 4                                                                                                                                                                 databaseBackend: sqlite                                                                                                                                                 distribution:                                                                                                                                                             distribution: almalinux                                                                                                                                                 version: "9.6"                                                                                                                                                        eventLogger: journald                                                                                                                                                   freeLocks: 2027                                                                                                                                                         hostname: hostname.local 
idMappings:                                                                                                                                                               gidmap:                                                                                                                                                                 - container_id: 0                                                                                                                                                         host_id: 1000                                                                                                                                                           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: 6.6.74-20250127.v8.1.el9                                                                                                                                        linkmode: dynamic                                                                                                                                                       logDriver: journald                                                                                                                                                     memFree: 4321705984                                                                                                                                                     memTotal: 8331169792                                                                                                                                                    networkBackend: netavark                                                                                                                                                networkBackendInfo:                                                                                                                                                       backend: netavark                                                                                                                                                       dns:                                                                                                                                                                      package: aardvark-dns-1.14.0-1.el9.aarch64                                                                                                                              path: /usr/libexec/podman/aardvark-dns                                                                                                                                  version: aardvark-dns 1.14.0                                                                                                                                          package: netavark-1.14.1-1.el9_6.aarch64                                                                                                                                path: /usr/libexec/podman/netavark                                                                                                                                      version: netavark 1.14.1                                                                                                                                              ociRuntime:                                                                                                                                                               name: crun                                                                                                                                                              package: crun-1.21-1.el9_6.aarch64                                                                                                                                      path: /usr/bin/crun                                                                                                                                                     version: |-                                                                                                                                                               crun version 1.21                                                                                                                                                       commit: 10269840aa07fb7e6b7e1acff6198692d8ff5c88                                                                                                                        rundir: /run/user/1000/crun                                                                                                                                             spec: 1.0.0 
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL                                                                                                         os: linux                                                                                                                                                               pasta:                                                                                                                                                                    executable: /usr/bin/pasta                                                                                                                                              package: passt-0^20250217.ga1e48a0-1.el9.aarch64                                                                                                                        version: ""                                                                                                                                                           remoteSocket:                                                                                                                                                             exists: true                                                                                                                                                            path: /run/user/1000/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: /usr/bin/slirp4netns                                                                                                                                        package: slirp4netns-1.3.2-1.el9.aarch64                                                                                                                                version: |-                                                                                                                                                               slirp4netns version 1.3.2                                                                                                                                               commit: 0f13345bcef588d2bb70d662d41e92ee8a816d85                                                                                                                        libslirp: 4.4.0                                                                                                                                                         SLIRP_CONFIG_VERSION_MAX: 3                                                                                                                                             libseccomp: 2.5.2                                                                                                                                                   swapFree: 4294963200                                                                                                                                                    swapTotal: 4294963200                                                                                                                                                   uptime: 20h 6m 19.00s (Approximately 0.83 days)                                                                                                                         variant: v8 
plugins:                                                                                                                                                                  authorization: null                                                                                                                                                     log:                                                                                                                                                                    - k8s-file                                                                                                                                                              - none                                                                                                                                                                  - passthrough                                                                                                                                                           - journald                                                                                                                                                              network:                                                                                                                                                                - bridge                                                                                                                                                                - macvlan                                                                                                                                                               - ipvlan                                                                                                                                                                volume:                                                                                                                                                                 - local                                                                                                                                                               registries:                                                                                                                                                               search:                                                                                                                                                                 - registry.access.redhat.com                                                                                                                                            - registry.redhat.io                                                                                                                                                    - docker.io                                                                                                                                                           store:                                                                                                                                                                    configFile: /home/user/.config/containers/storage.conf                                                                                                                  containerStore:                                                                                                                                                           number: 8                                                                                                                                                               paused: 0                                                                                                                                                               running: 7                                                                                                                                                              stopped: 1                                                                                                                                                            graphDriverName: overlay                                                                                                                                                graphOptions: {}                                                                                                                                                        graphRoot: /home/user/.local/share/containers/storage                                                                                                                   graphRootAllocated: 235732176896                                                                                                                                        graphRootUsed: 88643289088                                                                                                                                              graphStatus:                                                                                                                                                              Backing Filesystem: extfs                                                                                                                                               Native Overlay Diff: "true"                                                                                                                                             Supports d_type: "true"                                                                                                                                                 Supports shifting: "false"                                                                                                                                              Supports volatile: "true"                                                                                                                                               Using metacopy: "false"                                                                                                                                               imageCopyTmpDir: /var/tmp                                                                                                                                               imageStore:                                                                                                                                                               number: 15 
plugins:                                                                                                                                                                  authorization: null                                                                                                                                                     log:                                                                                                                                                                    - k8s-file                                                                                                                                                              - none                                                                                                                                                                  - passthrough                                                                                                                                                           - journald                                                                                                                                                              network:                                                                                                                                                                - bridge                                                                                                                                                                - macvlan                                                                                                                                                               - ipvlan                                                                                                                                                                volume:                                                                                                                                                                 - local                                                                                                                                                               registries:                                                                                                                                                               search:                                                                                                                                                                 - registry.access.redhat.com                                                                                                                                            - registry.redhat.io                                                                                                                                                    - docker.io                                                                                                                                                           store:                                                                                                                                                                    configFile: /home/user/.config/containers/storage.conf                                                                                                                  containerStore:                                                                                                                                                           number: 8                                                                                                                                                               paused: 0                                                                                                                                                               running: 7                                                                                                                                                              stopped: 1                                                                                                                                                            graphDriverName: overlay                                                                                                                                                graphOptions: {}                                                                                                                                                        graphRoot: /home/user/.local/share/containers/storage                                                                                                                   graphRootAllocated: 235732176896                                                                                                                                        graphRootUsed: 88643289088                                                                                                                                              graphStatus:                                                                                                                                                              Backing Filesystem: extfs                                                                                                                                               Native Overlay Diff: "true"                                                                                                                                             Supports d_type: "true"                                                                                                                                                 Supports shifting: "false"                                                                                                                                              Supports volatile: "true"                                                                                                                                               Using metacopy: "false"                                                                                                                                               imageCopyTmpDir: /var/tmp                                                                                                                                               imageStore:                                                                                                                                                               number: 15

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

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

@Ep0chalypse Ep0chalypse added the kind/bug Categorizes issue or PR as related to a bug. label May 23, 2025
@Luap99
Copy link
Member

Luap99 commented May 26, 2025

Is it possible that your system clock is/was wrong and then later adjusted after the container was started?

Podman stores timestamps and then if you change the system time any such calculations will be wrong.

@Ep0chalypse
Copy link
Author

Is it possible that your system clock is/was wrong and then later adjusted after the container was started?

Podman stores timestamps and then if you change the system time any such calculations will be wrong.

It's possible as I didn't explicitly check the date/time at system boot, but I do run tmux which has a date/clock in it's status bar and it's always been correct. After rebooting the raspberry pi today podman ps shows the correct values:

podman ps
CONTAINER ID  IMAGE                                        COMMAND               CREATED      STATUS      PORTS                                                                                                                                                                         NAMES
a915664d8bb1  docker.io/timescale/timescaledb-ha:pg17      postgres              9 hours ago  Up 9 hours  0.0.0.0:5432->5432/tcp, 8008/tcp, 8081/tcp                                                                                                                                    timescaledb
dd62a5332837  ghcr.io/caddybuilds/caddy-cloudflare:latest  caddy run --confi...  9 hours ago  Up 9 hours  0.0.0.0:443->443/udp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 2019/tcp                                                                                                      caddy
ce8f52d4b5cc  docker.io/library/mariadb:11                 --innodb-buffer-p...  9 hours ago  Up 9 hours  3306/tcp                                                                                                                                                                      photoprism_mariadb
69b5e4ef8b45  docker.io/pihole/pihole:latest                                     9 hours ago  Up 9 hours  0.0.0.0:53->53/tcp, 0.0.0.0:88->80/tcp, 0.0.0.0:4433->443/tcp, 0.0.0.0:53->53/udp, 67/udp, 123/udp                                                                            pihole
ef75d2d44a10  lscr.io/linuxserver/plex:latest                                    9 hours ago  Up 9 hours  0.0.0.0:8324->8324/tcp, 0.0.0.0:32400->32400/tcp, 0.0.0.0:32469->32469/tcp, 0.0.0.0:1900->1900/udp, 0.0.0.0:32410->32410/udp, 0.0.0.0:32412-32414->32412-32414/udp, 5353/udp  plex
cf59ec75e160  docker.io/cloudflare/cloudflared:latest      tunnel --no-autou...  9 hours ago  Up 9 hours                                                                                                                                                                                cloudflared
19e17cf29a82  ghcr.io/hotio/qbittorrent:latest                                   9 hours ago  Up 9 hours  0.0.0.0:8080->8080/tcp                                                                                                                                                        qbittorrent
9b0c177becd6  docker.io/photoprism/photoprism:latest                             9 hours ago  Up 9 hours  0.0.0.0:2342->2342/tcp, 2442-2443/tcp                                                                                                                                         photoprism```

@Luap99
Copy link
Member

Luap99 commented May 27, 2025

I think that is the most likely explanation.
For proper duration one should use CLOCK_MONOTONIC generally that but is not really an option in most cases for us here because the remote API only contains a timestamp and the client is actually actually calculating the duration, and the client could be an another system where the MONOTONIC timestamp would be meaningless. And for created we cannot use CLOCK_MONOTONIC anyway since that has no meaning across reboots.

So overall I see no good way to fix this, I suppose for uptime of the container we could generate the duration on the server and adding this as new API field but given it cannot be used for the created time that seems like unnecessary complexity.
Thus I would say ensure your time is synchronized before creating/starting any containers.

There is also #23022 which shows that even some internals of podman depend on the time which is obviously not good.

@Luap99 Luap99 added the triaged Issue has been triaged label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triaged Issue has been triaged
Projects
None yet
Development

No branches or pull requests

2 participants