Bug 1825281 - oc logs does not forward errors from server correctly
Summary: oc logs does not forward errors from server correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.4
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-17 14:32 UTC by Steve Kuznetsov
Modified: 2020-05-18 13:35 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-18 13:35:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2133 0 None None None 2020-05-18 13:35:23 UTC

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


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