Bug 1779563 - Failed to parse timestamp for `oc adm node-logs` with --since argument
Summary: Failed to parse timestamp for `oc adm node-logs` with --since argument
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks: 1763807
TreeView+ depends on / blocked
 
Reported: 2019-12-04 09:29 UTC by zhou ying
Modified: 2020-05-13 21:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Typo in timestamp format. Consequence: oc adm node-logs was having issues parsing correct format. Fix: Fix typo in timestamp format. Result: oc adm node-logs works fine with --since argument.
Clone Of:
Environment:
Last Closed: 2020-05-13 21:53:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift origin pull 24258 0 'None' closed Bug 1779563: fix oc adm node logs and add tests 2021-02-19 05:13:05 UTC
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-13 21:53:58 UTC

Description zhou ying 2019-12-04 09:29:58 UTC
Description of problem:
When use --since argument for `oc adm node-logs`  met error: Failed to parse timestamp: 2019-12-04T02:00:00.999999Z

Version-Release number of selected component (if applicable):
[root@dhcp-140-138 ~]# oc version -oyaml
clientVersion:
  buildDate: "2019-12-03T14:24:28Z"
  gitCommit: a82d2ce4efdbfa9836480d8567acccfde19d297b
  gitTreeState: clean
  gitVersion: v4.3.0
  goVersion: go1.12.12
  platform: linux/amd64
openshiftVersion: 4.3.0-0.nightly-2019-12-03-211441

How reproducible:
Always

Steps to Reproduce:
1. Use command `oc adm node-logs ip-1xxxxx --since "2019-12-04T02:00:00.999999Z"`

Actual results:
1. Met error: Failed to parse timestamp: 2019-12-04T02:00:00.999999Z

Expected results:
1. -since='': Return logs after a specific ISO timestamp or relative date. Only applies to node journal logs.  works well

Additional info:

Comment 1 Maciej Szulik 2019-12-04 20:29:18 UTC

*** This bug has been marked as a duplicate of bug 1763807 ***

Comment 3 zhou ying 2019-12-18 03:27:56 UTC
Confirmed with latest oc client, the issue has fixed:

[root@dhcp-140-138 ~]# oc adm node-logs node/ip-10-0-172-171.us-east-2.compute.internal --since  "2019-12-18 03:22:00.9999"
-- Logs begin at Wed 2019-12-18 01:03:06 UTC, end at Wed 2019-12-18 03:26:00 UTC. --
-- No entries --
-- Logs begin at Wed 2019-12-18 01:03:06 UTC, end at Wed 2019-12-18 03:26:00 UTC. --
Dec 18 03:22:01 ip-10-0-172-171 hyperkube[2053]: I1218 03:22:01.170984    2053 kubelet_pods.go:1328] Generating status for "apiserver-jg8sw_openshift-apiserver(9318f0cf-e4a7-4333-a942-a1370cfb3cc5)"
Dec 18 03:22:01 ip-10-0-172-171 hyperkube[2053]: I1218 03:22:01.171060    2053 kubelet_pods.go:1328] Generating status for "downloads-5fb976fdbc-2klrd_openshift-console(965803d9-f943-4e3d-87db-c1d3b9d375de)"
...



[root@dhcp-140-138 ~]# oc adm node-logs node/ip-10-0-172-171.us-east-2.compute.internal --since=-2m --until=-1m
-- Logs begin at Wed 2019-12-18 01:03:06 UTC, end at Wed 2019-12-18 03:25:17 UTC. --
-- No entries --
-- Logs begin at Wed 2019-12-18 01:03:06 UTC, end at Wed 2019-12-18 03:25:17 UTC. --
Dec 18 03:23:17 ip-10-0-172-171 hyperkube[2053]: I1218 03:23:17.938543    2053 prober.go:129] Readiness probe for "thanos-querier-55d4f9968c-jcfsg_openshift-monitoring(2366dd7d-af6b-4fce-9d7c-c8afad20dcbb):thanos-querier" succeeded
Dec 18 03:23:18 ip-10-0-172-171 hyperkube[2053]: I1218 03:23:18.065973    2053 prober.go:129] Readiness probe for "etcd-member-ip-10-0-172-171.us-east-2.compute.internal_openshift-etcd(e564ce30c033f447ff234c779602b125):etcd-member" succeeded
...

[root@dhcp-140-138 ~]# oc version -o yaml 
clientVersion:
  buildDate: "2019-12-16T10:31:48Z"
  compiler: gc
  gitCommit: ff590d4496deedc069232984c20b4e5159c43b28
  gitTreeState: clean
  gitVersion: v4.4.0
  goVersion: go1.12.12
  major: ""
  minor: ""
  platform: linux/amd64

Comment 5 errata-xmlrpc 2020-05-13 21:53:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0581


Note You need to log in before you can comment on or make changes to this bug.