containers / podman

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

podman machine 5 has not an up-to-date time on macOS #22037

Closed benoitf closed 8 months ago

benoitf commented 8 months ago

Issue Description

I've my podman machine running since few days

but then the time inside my podman machine is outdated

I noticed that when trying to build an image using fedora

I was receiving RPM: Signature 20f8 created at Wed Mar 13 10:19:14 2024 invalid: signature is not alive error

Steps to reproduce the issue

Steps to reproduce the issue

  1. launch podman machine on macOS
  2. wait one day (with computer goes into sleep mode)
  3. try the 'uptime' or 'date' command it'll be in the past

Describe the results you received

I received inside the podman machine

date
Tue Mar 12 13:59:08 CET 2024

while on my computer

date
Thu Mar 14 09:59:38 CET 2024

Describe the results you expected

same date in the machine than on the host

podman info output

host:
  arch: arm64
  buildahVersion: 1.35.0
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.10-1.fc39.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.10, commit: '
  cpuUtilization:
    idlePercent: 99.79
    systemPercent: 0.1
    userPercent: 0.11
  cpus: 6
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: coreos
    version: "39"
  eventLogger: journald
  freeLocks: 2014
  hostname: localhost.localdomain
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
    uidmap:
    - container_id: 0
      host_id: 501
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
  kernel: 6.7.5-200.fc39.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 1135312896
  memTotal: 2047725568
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.10.0-1.20240229100444279141.main.16.g03ce519.fc39.aarch64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.11.0-dev
    package: netavark-1.10.1-1.20240305172227372729.main.44.g3a1902a.fc39.aarch64
    path: /usr/libexec/podman/netavark
    version: netavark 1.11.0-dev
  ociRuntime:
    name: crun
    package: crun-1.14.4-1.20240302220834691516.main.10.g64ee22c.fc39.aarch64
    path: /usr/bin/crun
    version: |-
      crun version UNKNOWN
      commit: feb70bc2ab11944a6443e4f5d2eb96a22f186b80
      rundir: /run/user/501/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-0^20240220.g1e6f92b-1.fc39.aarch64
    version: |
      pasta 0^20240220.g1e6f92b-1.fc39.aarch64-pasta
      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: true
    path: /run/user/501/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: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-1.fc39.aarch64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 41h 8m 40.00s (Approximately 1.71 days)
  variant: v8
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 24
    paused: 0
    running: 3
    stopped: 21
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphRootAllocated: 106769133568
  graphRootUsed: 6045200384
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 15
  runRoot: /run/user/501/containers
  transientStore: false
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 5.0.0-dev-642a8f13a
  Built: 1709856000
  BuiltTime: Fri Mar  8 01:00:00 2024
  GitCommit: ""
  GoVersion: go1.21.7
  Os: linux
  OsArch: linux/arm64
  Version: 5.0.0-dev-642a8f13a

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

$ timedatectl
               Local time: Tue 2024-03-12 14:04:25 CET
           Universal time: Tue 2024-03-12 13:04:25 UTC
                 RTC time: Thu 2024-03-14 09:01:03
                Time zone: Europe/Paris (CET, +0100)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

It was an issue in podman 4 https://github.com/containers/podman/issues/11541 https://github.com/containers/podman/issues/18552

Luap99 commented 8 months ago

Sad enough that the native hypervisor has the same problem.

I am not sure what changed but it looks like coreos actually broke us here. coreos seems to overwrite the default chronyd config so our config doesn't take effect.

https://github.com/coreos/fedora-coreos-tracker/issues/1449 My guess is because the config files are now part of the base image and no longer added via ignition the detection logic no longer works.

cc @baude

baude commented 8 months ago

i think https://github.com/baude/podman-machine-images/commit/a6633e6976b08d6ee560e37def91ada62e63b03f will fix this.

benoitf commented 8 months ago

@baude I tried but still no luck

core@localhost:~$ timedatectl
               Local time: Fri 2024-03-15 23:50:25 CET
           Universal time: Fri 2024-03-15 22:50:25 UTC
                 RTC time: Mon 2024-03-18 09:34:10
                Time zone: Europe/Paris (CET, +0100)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

and

core@localhost:~$ sudo cat /run/coreos/sysconfig-chrony
cat: /run/coreos/sysconfig-chrony: No such file or directory
benoitf commented 8 months ago

@baude with your new experimental image it is working

core@localhost:~$ timedatectl
               Local time: Tue 2024-03-19 09:08:05 CET
           Universal time: Tue 2024-03-19 08:08:05 UTC
                 RTC time: Tue 2024-03-19 08:08:06
                Time zone: Europe/Paris (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
baude commented 8 months ago

this has been fixed in the machine-os images ...