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 --remote events prints wrong timestamps #12629

Closed
leahneukirchen opened this issue Dec 16, 2021 · 6 comments · Fixed by #12644
Closed

podman --remote events prints wrong timestamps #12629

leahneukirchen opened this issue Dec 16, 2021 · 6 comments · Fixed by #12644
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. 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. volunteers-wanted Issues good for community/volunteer contributions

Comments

@leahneukirchen
Copy link
Contributor

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

/kind bug

Description

Steps to reproduce the issue:

  1. Run podman --remote events

  2. Run something to generate some log lines, e.g. podman --remote run --rm -it alpine:latest echo foo

Describe the results you received:

2073-12-01 07:02:04.713047665 +0100 CET container create cb949b75b2b65c0ed36ac4d0ded85fe5a8ecaedc7b1e45ad298b7793b3f0a0f9 (image=docker.io/library/alpine:latest, name=eager_darwin)

Describe the results you expected:

The current date and time (2021-12-16T16:02:31,178233183+01:00)

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

The time and timeNano timestamps in the API response are correct. The system clock is correct too. :)

Output of podman version:

podman version 3.4.4

Same on 3.4.2.

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: Unknown
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.30, commit: unknown'
  cpus: 8
  distribution:
    distribution: '"void"'
    version: unknown
  eventLogger: file
  hostname: rhea
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 1100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 1100000
      size: 65536
  kernel: 5.13.12_1
  linkmode: dynamic
  logDriver: k8s-file
  memFree: 5408837632
  memTotal: 50040606720
  ociRuntime:
    name: runc
    package: Unknown
    path: /usr/bin/runc
    version: |-
      runc version unknown
      spec: 1.0.2-dev
      go: go1.17
      libseccomp: 2.4.3
  os: linux
  remoteSocket:
    exists: true
    path: /tmp/runtime-leah/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: ""
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: Unknown
    version: |-
      slirp4netns version 1.1.12
      commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.3
  swapFree: 5470408704
  swapTotal: 25769795584
  uptime: 2880h 45m 20.86s (Approximately 120.00 days)
plugins:
  log:
  - k8s-file
  - none
  network:
  - bridge
  - macvlan
  volume:
  - local
registries: {}
store:
  configFile: /home/leah/.config/containers/storage.conf
  containerStore:
    number: 39
    paused: 0
    running: 0
    stopped: 39
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /data/podman/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 9
  runRoot: /tmp/user/1000
  volumePath: /home/leah/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.4
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.17.5
  OsArch: linux/amd64
  Version: 3.4.4


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

(Void Linux)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Dec 16, 2021
@Luap99
Copy link
Member

Luap99 commented Dec 16, 2021

Does this only happens with podman-remote or also local podman?

@leahneukirchen
Copy link
Contributor Author

Without --remote it is correct.

@leahneukirchen leahneukirchen changed the title podman events prints wrong timestamps podman --remote events prints wrong timestamps Dec 16, 2021
@rhatdan
Copy link
Member

rhatdan commented Dec 16, 2021

Interested in opening a PR?

@rhatdan rhatdan added Good First Issue This issue would be a good issue for a first time contributor to undertake. volunteers-wanted Issues good for community/volunteer contributions labels Dec 16, 2021
@leahneukirchen
Copy link
Contributor Author

I found the error here: https://github.com/containers/podman/blob/main/pkg/domain/entities/events.go#L45
e.TimeNano contains nanoseconds since the epoch, not just the nanosecond part of e.Time.

@leahneukirchen
Copy link
Contributor Author

time.Unix(0, e.TimeNano) should work.

@rhatdan
Copy link
Member

rhatdan commented Dec 16, 2021

Please open a PR.

@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. 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. volunteers-wanted Issues good for community/volunteer contributions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants