Bug 1825281

Summary: oc logs does not forward errors from server correctly
Product: OpenShift Container Platform Reporter: Steve Kuznetsov <skuznets>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: zhou ying <yinzhou>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4CC: aos-bugs, bbennett, jokerman, mfojtik
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-18 13:35:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steve Kuznetsov 2020-04-17 14:32:04 UTC
Not a useful error:

$ oc --context build01 adm node-logs --since '1 day' ip-10-0-140-81.ec2.internal
error: ip-10-0-140-81.ec2.internal the server rejected our request for an unknown reason

Real error has better text that can be forwarded:

$ oc --context build01 adm node-logs --since '1 day' ip-10-0-140-81.ec2.internal --loglevel 10
...
I0416 11:39:49.069687 1605372 request.go:942] Response Body: parameter 'since' is invalid: date must be a relative time of the form '(+|-)[0-9]+(s|m|h|d)' or a date in 'YYYY-MM-DD HH:MM:SS' form



$ oc --context build01 version
Client Version: v4.2.14
Server Version: 4.3.0-0.nightly-2020-04-13-190424
Kubernetes Version: v1.16.2

Comment 1 zhou ying 2020-04-21 09:59:58 UTC
I can't reproduce the issue: 

[root@dhcp-140-138 cucushift]# oc adm  node-logs --since '1 day' ip-10-0-166-19.us-east-2.compute.internal
error: the server rejected our request for an unknown reason
  parameter 'since' is invalid: date must be a relative time of the form '(+|-)[0-9]+(s|m|h|d)' or a date in 'YYYY-MM-DD HH:MM:SS' form


[root@dhcp-140-138 cucushift]# oc version 
Client Version: 4.4.0-202004210425-2576e48
Server Version: 4.4.0-0.nightly-2020-04-18-095545

Comment 2 Maciej Szulik 2020-05-08 18:27:08 UTC
IIRC Clayton and I fixed this back in 4.4, so moving accordingly.

Comment 5 zhou ying 2020-05-09 03:00:48 UTC
[root@dhcp-140-138 ~]# oc adm  node-logs --since '1 day' ip-10-0-128-178.ap-northeast-2.compute.internal
error: the server rejected our request for an unknown reason
  parameter 'since' is invalid: date must be a relative time of the form '(+|-)[0-9]+(s|m|h|d)' or a date in 'YYYY-MM-DD HH:MM:SS' form

[root@dhcp-140-138 ~]# oc version 
Client Version: 4.5.0-202005072157-f415627
Server Version: 4.5.0-0.nightly-2020-05-08-200452

Comment 7 errata-xmlrpc 2020-05-18 13:35:02 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:2133